[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug with call-with/cc and lambda?
From: |
Alejandro Forero Cuervo |
Subject: |
bug with call-with/cc and lambda? |
Date: |
Mon, 8 Apr 2002 14:11:16 -0500 |
User-agent: |
Mutt/1.2.5i |
Hey.
I've been playing with a few Scheme interpreters and I noticed the
following issue in Guile.
When I do
(define (f x) (call-with-current-continuation f))
(call-with-current-continuation f)
I get the expexted behaviour: Guile just hangs (starts to use a lot of
processor power).
However, when I do the following very similar construction, Guile hangs
but also starts to consume a lot of memory, giving me the idea that
something that could be tail-recursive somewhere isn't:
(define (f x) (call-with-current-continuation (lambda (x) (f x))))
(call-with-current-continuation f)
Shouldn't this use constant memory?
Thanks. :)
Alejo.
http://bachue.com/alejo
--
The mere formulation of a problem is far more essential than its solution.
-- Albert Einstein.
$0='!/sfldbi!yjoV0msfQ!sfiupob!utvK'x44;print map{("\e[7m \e[0m",chr ord
(chop$0)-1)[$_].("\n")[++$i%77]}split//,unpack'B*',pack'H*',($F='F'x19).
"F0F3E0607879CC1E0F0F339F3FF399C666733333CCF87F99E6133999999E67CFFCCF3".
"219CC1CCC033E7E660198CCE4E66798303873CCE60F3387$F"#Don't you love Perl?
pgpgOCKJKVBV9.pgp
Description: PGP signature