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.
Cheers,
P!
Afficher les réponses par date
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
________________________________ From: Marc Feeley feeley@iro.umontreal.ca To: Adrien Piérard pierarda@iro.umontreal.ca Cc: Gambit List gambit-list@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 _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
________________________________ From: Steve Graham jsgrahamus@yahoo.com To: Gambit List Gambit-list@iro.umontreal.ca Sent: Monday, August 22, 2011 6:37 AM Subject: Re: [gambit-list] REPL, values and '#'
________________________________ From: Marc Feeley feeley@iro.umontreal.ca To: Adrien Piérard pierarda@iro.umontreal.ca Cc: Gambit List gambit-list@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
Hello,
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:
(values 111 222)
111 222
##
111
Oh, I hadn't thought of, nor tried, ## in that case. I would have preferred a behaviour à la CL (at least sbcl), where the first of multiple values is the one cached, but when there are 3 or less values returned (most of the time, as far as my use is concerned), being able to access each of them independently is quite nice indeed.
Thanks for the explanation.
P!