[plt-scheme] Interaction of shared and first, second, etc. (bug?)

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jul 29 10:39:16 EDT 2008

If you tried this in Advanced, the highest HtDP teaching level, this  
program would work just fine:

> Welcome to DrScheme, version 4.0.2.5-svn28jul2008 [3m].
> Language: Advanced Student custom; memory limit: 256 megabytes.
> Teachpack: world.ss.
> > (first (shared ((x (cons 1 x))) x))
> 1
> > (second (shared ((x (cons 1 x))) x))
> 1
> > (third (shared ((x (cons 1 x))) x))
> 1


So this could be a bug, depending on what language you are using.  
Remember PLT Scheme isn't a language, it's a lot of languages.

-- Matthias





On Jul 29, 2008, at 1:26 AM, Gregory Woodhouse wrote:

> I was under the impression that first was a synonym for car, second  
> for cadr, etc. But apparently,, this isn't so with shared variables
>
> > (shared ((a (cons 1 a))) (car a))
> 1
> > (shared ((a (cons 1 a))) (cadr a))
> 1
> > (shared ((a (cons 1 a))) (first a))
> . . first: expected argument of type <non-empty list>; given #0= 
> (1 . #0#)
> >
>
>
>
>
> "We may with advantage at times forget what we know."
> --Publilius Cyrus, c. 100 B.C.
>
> http://www.gwoodhouse.com
> http://GregWoodhouse.ImageKind.com
>
>
>
>
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080729/c7b0dddd/attachment.html>

Posted on the users mailing list.