This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Making Guile slower


Greg Harvey <Greg.Harvey@thezone.net> writes:

> Consider this:
> 
> SCM_NEWCELL(foo);
> SCM_SETCDR(foo, scm_must_malloc(foo_size, s_make_foo));
> SCM_SETCAR(foo, scm_tc16_foo);

... which should be written ...

  m = scm_must_malloc (foo_size, s_make_foo);
  SCM_NEWCELL (foo);
  SCM_SETCDR (foo, m);
  SCM_SETCAR (foo, scm_tc16_foo);

Wouldn't it be a solution, then, to abstract away this idiom, e.g. as
a macro, so that we both gain readability, safer code, and get the
freedom still to choose an efficient from of the NEWCELL operation
itself?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]