[plt-scheme] Please help test version 359.100

From: Jos Koot (jos.koot at telefonica.net)
Date: Tue Nov 14 06:54:54 EST 2006

----- Original Message ----- 
  From: Robby Findler 
  To: Matthias Felleisen 
  Cc: Jacob Matthews ; plt-scheme at list.cs.brown.edu 
  Sent: Tuesday, November 14, 2006 4:09 AM
  Subject: Re: [plt-scheme] Please help test version 359.100


  My reading indicates they would both be legal.

  What seems to be illegal is

    (for-each (lambda (x) (values x x)) (list 1))
    -->
    (values 1 1)
If I understand well, the procedure is invoked in tail position when reaching the last element of the list. To me it seems up to the continuation of the for-each call how many values can be returned. (I don't bother much about this for in my code for-each calls always (I hope) have continuations that disregard any returned value(s)) 




  Robby

  At Mon, 13 Nov 2006 21:39:11 -0500, Matthias Felleisen wrote:
  > I don't think this is relevant. The true question is whether
  > 
  >   (+ (for-each add1 '()) (for-each sub1 '()))
  > 
  > steps to
  > 
  >   (+ some-value some-value)
  > 
  > or to
  > 
  >   (+ some-value some-different-value)
  > 
  > I believe that the second one is the case already. -- Matthias
  > 
  > 
  > On Nov 13, 2006, at 6:52 PM, Jacob Matthews wrote:
  > 
  > > On Nov 13, 2006, at 5:31 PM, Robby Findler wrote:
  > >
  > >> Is "some object" allowed to be multiple values or not? That text
  > >> suggests not.
  > >
  > > "Types are associated with values (also called objects) rather than  
  > > with variables" (section 1.1) seems to be the only definition of  
  > > what an 'object' is. I think it's clear that they are saying that  
  > > values are also called objects, and that by the normal rules of  
  > > English we can conclude that the singular 'object' means the same  
  > > thing as the singular 'value'. So the question becomes, are  
  > > multiple values the same thing as a single value?  The report seems  
  > > to think not (I'm going here by the descriptions of the values and  
  > > call-with-values functions in section 6.4), though it plays its  
  > > usual trick of simply not defining what happens if a context  
  > > expects a single value and it receives multiple ones.
  > >
  > > Applying this back to the original question, I think we have to  
  > > conclude that for-each is supposed to be able to be called in  
  > > contexts that expect exactly one value. In Schemes like PLT Scheme  
  > > where contexts that expect one value signal an error if they  
  > > receive some other number, then it's a violation of R5RS for for- 
  > > each to behave the way 359.100 did; but for Schemes like Bigloo  
  > > that have coercion rules that take a multi-value return to a single- 
  > > value context, it's not a violation.
  > >
  > > -jacob
  > >
  > > (I actually wrote up a version of this before and then deleted it,  
  > > thinking it was too technical for anybody to care about ... looks  
  > > like I was wrong. :) )
  _________________________________________________
    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/20061114/c26f74c9/attachment.html>

Posted on the users mailing list.