guile-devel
[Top][All Lists]
Advanced

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

Re: [CM] funny scheme code (fwd)


From: Kjetil S. Matheussen
Subject: Re: [CM] funny scheme code (fwd)
Date: Mon, 20 Jul 2009 21:09:40 +0200 (CEST)



---------- Forwarded message ----------
Date: Mon, 20 Jul 2009 21:02:38 +0200 (CEST)
From: Kjetil S. Matheussen <address@hidden>
To: Bill Schottstaedt <address@hidden>
Cc: address@hidden, address@hidden
Subject: Re: [CM] funny scheme code



On Mon, 20 Jul 2009, Bill Schottstaedt wrote:

For some reason, this code strikes me as funny:

(let ((j (lambda () 0))
        (k 0))
 (do ((i (j) (j))
          (j (lambda () 1) (lambda () (+ i 1))))
         ((= i 3) k)
    (set! k (+ k i))))

would you believe 6?  Maybe I need a vacation.


A slight modifications makes Guile (the one included
with fedora 11) crash:


address@hidden bin]$ guile
guile> (let ((j (lambda () 0))
...       (k 0))
...   (do ((i (j)
...           (j))
...        (l (lambda ()
...             1)
...           (lambda ()
...             (+ i 1))))
...       ((= i 3) k)
...     (set! k (+ k i))))
Segmentation fault
address@hidden bin]$
address@hidden bin]$
address@hidden bin]$ guile --version
Guile 1.8.6
Copyright (c) 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008 Free Software Foundation
Guile may be distributed under the terms of the GNU General Public
Licence;
certain other uses are permitted as well.  For details, see the file
`COPYING', which is included in the Guile distribution.
There is no warranty, to the extent permitted by law.
address@hidden bin]$


_______________________________________________
Cmdist mailing list
address@hidden
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist




reply via email to

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