unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Re: [CM] funny scheme code (fwd)
@ 2009-07-20 19:09 Kjetil S. Matheussen
  2009-07-22 10:42 ` Segfault with do (Re: [CM] funny scheme code (fwd)) Kjetil S. Matheussen
  2009-07-23 22:19 ` [CM] funny scheme code (fwd) Andy Wingo
  0 siblings, 2 replies; 4+ messages in thread
From: Kjetil S. Matheussen @ 2009-07-20 19:09 UTC (permalink / raw)
  To: guile-devel



---------- Forwarded message ----------
Date: Mon, 20 Jul 2009 21:02:38 +0200 (CEST)
From: Kjetil S. Matheussen <k.s.matheussen@notam02.no>
To: Bill Schottstaedt <bil@ccrma.Stanford.EDU>
Cc: cmdist@ccrma.Stanford.EDU, guile-devel-request@gnu.org
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:


[kjetil@ttleon 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
[kjetil@ttleon bin]$
[kjetil@ttleon bin]$
[kjetil@ttleon 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.
[kjetil@ttleon bin]$


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Segfault with do (Re: [CM] funny scheme code (fwd))
  2009-07-20 19:09 [CM] funny scheme code (fwd) Kjetil S. Matheussen
@ 2009-07-22 10:42 ` Kjetil S. Matheussen
  2009-07-22 11:59   ` Ludovic Courtès
  2009-07-23 22:19 ` [CM] funny scheme code (fwd) Andy Wingo
  1 sibling, 1 reply; 4+ messages in thread
From: Kjetil S. Matheussen @ 2009-07-22 10:42 UTC (permalink / raw)
  To: Kjetil S. Matheussen; +Cc: guile-devel



On Mon, 20 Jul 2009, Kjetil S. Matheussen wrote:
> A slight modifications makes Guile (the one included
> with fedora 11) crash:
>
>
> [kjetil@ttleon 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
> [kjetil@ttleon bin]$
> [kjetil@ttleon bin]$
> [kjetil@ttleon bin]$ guile --version
> Guile 1.8.6

Guile 1.8.0 segfaults as well.

Here's the code ready for pasting:

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

Sorry for not having time debugging it myself right now.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Segfault with do (Re: [CM] funny scheme code (fwd))
  2009-07-22 10:42 ` Segfault with do (Re: [CM] funny scheme code (fwd)) Kjetil S. Matheussen
@ 2009-07-22 11:59   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2009-07-22 11:59 UTC (permalink / raw)
  To: guile-devel

Hello Kjetil,

"Kjetil S. Matheussen" <k.s.matheussen@notam02.no> writes:

> Guile 1.8.0 segfaults as well.
>
> Here's the code ready for pasting:
>
> (let ((j (lambda () 0))
>         (k 0))
>   (do ((i (j) (j))
>           (l (lambda () 1) (lambda () (+ i 1))))
>           ((= i 3) k)
>      (set! k (+ k i))))
>
> Sorry for not having time debugging it myself right now.

I added it to the bug tracker: http://savannah.gnu.org/bugs/?27062 .
Please follow-up there (changes are reported to anyone involved and to
`bug-guile').

Also, next time you find a bug, it will be even better if you submit it
to the bug tracker directly.  :-)

Thanks,
Ludo'.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [CM] funny scheme code (fwd)
  2009-07-20 19:09 [CM] funny scheme code (fwd) Kjetil S. Matheussen
  2009-07-22 10:42 ` Segfault with do (Re: [CM] funny scheme code (fwd)) Kjetil S. Matheussen
@ 2009-07-23 22:19 ` Andy Wingo
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2009-07-23 22:19 UTC (permalink / raw)
  To: Kjetil S. Matheussen; +Cc: guile-devel

On Mon 20 Jul 2009 21:09, "Kjetil S. Matheussen" <k.s.matheussen@notam02.no> writes:

> 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))))

I get an endless loop here, at least with the VM. But I will have to
admit that I never did understand `do' ;-)

Andy
-- 
http://wingolog.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-23 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 19:09 [CM] funny scheme code (fwd) Kjetil S. Matheussen
2009-07-22 10:42 ` Segfault with do (Re: [CM] funny scheme code (fwd)) Kjetil S. Matheussen
2009-07-22 11:59   ` Ludovic Courtès
2009-07-23 22:19 ` [CM] funny scheme code (fwd) Andy Wingo

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).