[gambit-list] REPL, values and '#'

Steve Graham jsgrahamus at yahoo.com
Mon Aug 22 09:34:18 EDT 2011





________________________________
From: Steve Graham <jsgrahamus at yahoo.com>
To: Gambit List <Gambit-list at iro.umontreal.ca>
Sent: Monday, August 22, 2011 6:37 AM
Subject: Re: [gambit-list] REPL, values and '#'






________________________________
From: Marc Feeley <feeley at iro.umontreal.ca>
To: Adrien Piérard <pierarda at iro.umontreal.ca>
Cc: Gambit List <gambit-list at iro.umontreal.ca>
Sent: Monday, August 22, 2011 6:32 AM
Subject: Re: [gambit-list] REPL, values and '#'


On 2011-08-22, at 2:09 AM, Adrien Piérard wrote:

> Hello,
> 
> Given that '#' is supposed to be a placeholder for the latest returned
> value, I'd expect
> 
>> (values 1 2)
> 1
> 2
>> #
> 1
> 2
> 
> instead of
> 
>> (values 1 2)
> 1
> 2
>> #
> 2
> 
> Or at least, the returned value to be the first one of multiple
> values, not the last.
> 
> I think that it's not common to use # and values together in the REPL,
> but I find the above behaviour not very natural.

Personally I find it more natural, and simpler, to think of each result printed by the REPL being added to the REPL history in the order printed. That's why # always refers to the last result printed, which will be the last value if multiple values were the result of the interaction. For
 example:

> 777
777
> (values 111 222)
111
222
> #
222
> 777
777
> (values 111 222)
111
222
> ##
111
> 777
777
> (values 111 222)
111
222
> ###
777

Marc

---

On my Windows 7x64 system I get the following:



CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.5
windows-mingw32-x86 [ manyargs dload ptables ]
compiled Fri 03/25/2011  on hermes (MinGW)

#;1> (values 111 222)
111
222
; 2 values
#;2> #
111
#;3> 


Steve
---

How embarrassing - Wrong list.


Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110822/35b6da9d/attachment.htm>


More information about the Gambit-list mailing list