unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Alejandro Forero Cuervo <bachue@bachue.com>
Subject: bug with call-with/cc and lambda?
Date: Mon, 8 Apr 2002 14:11:16 -0500	[thread overview]
Message-ID: <20020408141116.A6050@bachue.com> (raw)
In-Reply-To: <200204062333.g36NXwl21935@mr-ed.jpl.nasa.gov>; from mwette@grover.jpl.nasa.gov on Sat, Apr 06, 2002 at 03:33:58PM -0800

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]


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?

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2002-04-08 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-06 23:33 guile as extension language Matthew R Wette
2002-04-08 19:11 ` Alejandro Forero Cuervo [this message]
2002-04-23 23:57   ` bug with call-with/cc and lambda? Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020408141116.A6050@bachue.com \
    --to=bachue@bachue.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).