This is the mail archive of the guile@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: set! (The GIMP! By gum, I forgot all about it!)


Tel <telford@eng.uts.edu.au> writes:

> I have to agree that I always liked the way (setq) used to return
> the value in LISP and I see it as only bloody-mindedness on the part
> of some purist that guile forces everything to #<unspecified>
> (probably more the fault of R4RS than guile though). It would be
> nice to be able to use (set!) in (cond) (and) and (or) expressions
> rather than dick around with local variables.

I think you should define a 'setq' macro, and then use it in your own
programs.

> While we are at it I find (while) far more intuitive than (do)
> especially the stupid way that (do) specifies an expression that
> must be true to LEAVE the loop rather than to KEEP GOING. This is
> different to for() and while() in C.

Doesn't C have a do-until?  Anyway I think you can address the problem
for yourself by defining a macro with the desired semantics.

> I must presume that a lot of R4RS and R5RS was written by people
> that just hated C programmers.

I wouldn't know about that.  Scheme and C are very different, to be
sure.

> Anyhow, there isn't much to be done at this late stage because even
> if guile did return a sensible value from (set!), no one could
> depend on what that value was and remain portable to other scheme
> implementations.

Ah yes, we're actually in agreement!  It's not likely that the Scheme
standard is going to change in these areas.  If the point of your post
is that you hate these things so much that you can't use Scheme, I'm
very sorry.

I think Scheme can meet your needs, even though you don't like some of
the choices that the language designers made.  Scheme is great in this
regard, you can change the language with macros to make it do what you
want.

It's true that the rest of the world won't have the benefit of your
nifty macros by default, but at least you'll have them for your own
programs.  These macros will be portable across Scheme
implementations, of course.  And you can distribute them as you see
fit, to the benefit of C programmers everywhere, who are trying to
learn Scheme!

-russ


--
ATTENTION, all abducting aliens!  you DON'T need to RETURN them!