This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: more guile for perl refugees (split, join)
- To: tell at telltronics dot org
- Subject: Re: more guile for perl refugees (split, join)
- From: Clark McGrew <mcgrew at ale dot physics dot sunysb dot edu>
- Date: Wed, 28 Jun 2000 10:07:53 -0400
- CC: dirk at ida dot ing dot tu-bs dot de, guile at sourceware dot cygnus dot com
- References: <Pine.LNX.4.21.0006280124260.10275-100000@ariel.lan.telltronics.org>
- Reply-to: clark dot mcgrew at sunysb dot edu
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.
If people (ie the developers) don't think this qualifies as bloat I
can dig out and polish one of my macros that does a simple "for" loop
and post it. I tend to use it like
(for (i 1 10)
(display i)
(newline))
Cheers,
Clark