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: more guile for perl refugees (split, join)


Clark McGrew wrote:
> 
> Steve Tell wrote:
> 
> ; some common idioms:
> ;
> ; for(i = 0; i < 5; i++) printf("hi\n");   becomes:
> ;
> ; (do ((i 0 (+ i 1))) ((>= i 5))
> ;  (display "hi\n"))
> 
> This has always been one of my bet peeves with scheme.  It's looping
> constructs are lousy (IMNSHO).  Yeah, I can think of several ways to
> do a loop, but they tend to obscure it's simple nature.  I guess what
> I really want is a standard (schemified)
> 
> "for i = 1 to 10"
> 
> or
> 
> "do i = 1, 10"
> 
> that is part of the normal guile environment.  This sort of trivial
> convenience function can really improve the programing experience.  If
> it doesn't belong directy in boot-9, maybe there should be a general
> convenience module "(ice-9 convenience)" (or maybe "(ice-9 7-11)")
> that collects this sort of stuff.

In boot-9.scm there is a "while" macro that looks a lot like the one in emacs.
It has a "break" and "continue".

-- 
Dale P. Smith
Altus Technologies Corp.
dsmith@altustech.com
400-746-9000 x309

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