guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Textal interface to Guile


From: Dirk Herrmann
Subject: Re: Textal interface to Guile
Date: Tue, 8 May 2001 09:03:39 +0200 (MEST)

On Mon, 30 Apr 2001, Keith Wright wrote:

> > From: Marius Vollmer <address@hidden>
> > 
> > Rob Browning <address@hidden> writes:
> > 
> > >  my_str =
> > >     gh_scm2newstr(scm_simple_format(SCM_BOOL_F,
> > >                                     gh_str02scm("~S"),
> > >                                     gh_list(my_obj, SCM_EOL)));
> > >
> > >
> > > [...] I'm not sure whether you're supposed to use SCM_EOL or
> > > SCM_UNSPECIFIED, though I think SCM_EOL is right.
> > 
> > Nope, you should be using SCM_UNDEFINED.
> > 
> > Background: Both SCM_EOL and SCM_UNSPECIFIED can legitimately show up
> > in a list, but SCM_UNDEFINED will trigger a "variable unbound" error
> > when referenced (at certain strategically choosen points, it is not
> > checked for everywhere).  So SCM_UNDEFINED can be used to terminate
> > the arguments to gh_list, while SCM_EOL and SCM_UNSPECIFIED can not.
> 
> This is counter-intuitive.  (As I started writing this, that was
> my polite way of telling you that it was wrong.  As I worked out
> the details, I found it is right.  Let me explain why.)
> 
> SCM_EOL is the C-language name for the empty list '().

This indicates that SCM_EOL is actually a bad name - I remember to
have been tricked by the same misunderstanding.  A better name would
be SCM_EMPTY_LIST.  Maybe we should add this renaming to the guile-2.0
wishlist...

Best regards,
Dirk Herrmann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]