guile-devel
[Top][All Lists]
Advanced

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

Re: srfi-1 map, for-each, member, assoc


From: Gary Houston
Subject: Re: srfi-1 map, for-each, member, assoc
Date: 3 Jul 2001 18:07:21 -0000

> From: Martin Grabmueller <address@hidden>
> Date: Tue, 03 Jul 2001 17:31:47 +0200
> 
> > From: Gary Houston <address@hidden>
> > Date: 3 Jul 2001 11:39:58 -0000
> > 
> > OK, here is one more problem: calling srfi-1 list-tabulate with a
> > negative or non-integer number will cause a loop until Guile runs out
> > of memory (I guess.  I've got a process at 205MB and still growing).
> > I think this will apply to other procedures too.
> 
> Right.  I've fixed that, but I'm not sure whether it's the correct
> fix, because that is of course an invalid use of list-tabulate.  Maybe
> it would be better to perform argument checking in the SRFI
> procedures, but I didn't do that for performance reasons (and perhaps
> lazyness...)

I think it's fine to leave error checking to some other procedure that
gets called, e.g., this one doesn't need anything more:

(define (xcons d a)
  (cons a d))

or:

guile> (list-tabulate 'a (lambda (i) i))
/usr/guile-cvs/share/guile/1.5.0/srfi/srfi-1.scm:245:9: In procedure <= in 
expression (<= n 0):
/usr/guile-cvs/share/guile/1.5.0/srfi/srfi-1.scm:245:9: Wrong type argument in 
position 1: a
ABORT: (wrong-type-arg)

but otherwise it should signal the error itself, not just give weird
or arbitrary output:

guile> (list-tabulate 0.2 (lambda (i) i))
(-0.8)



reply via email to

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