[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printNl question
From: |
bill-auger |
Subject: |
Re: printNl question |
Date: |
Sun, 18 Apr 2021 19:04:10 -0400 |
rather than casual explanations of the problem, it is usually
more helpful to show the exact commands and output - for
example, is this what you are seeing?
$ gst
st> 'hello' printNl
'hello'
'hello'
st> Transcript show: 'hello' ; cr
hello
Transcript
the first line is the side-effect of execution (displaying the
string)
the second line is the evaluation of the message chain
(the objects: 'hello' and Transcript) - think of those as the
return result of function evaluation, in other languages - in
both of those cases, the message chain evaluates to the receiver
this is a common idiom for REPLs - it is a little more evident in
ruby
$ irb
irb(main):001:0> puts 'hello'
hello
=> nil
irb(main):002:0> 'hello'
=> "hello"
`puts 'hello'` prints the string, then evaluates to nil
`'hello'` has no side-effect - it simply evaluates to itself
- printNl question, Duke Normandin, 2021/04/18
- Re: printNl question,
bill-auger <=
- Re: printNl question, Paolo Bonzini, 2021/04/19
- Re: printNl question, Duke Normandin, 2021/04/19
- Re: printNl question, address@hidden, 2021/04/19
- Re: printNl question, Duke Normandin, 2021/04/19
- Re: printNl question, bill-auger, 2021/04/20
- Re: printNl question, Duke Normandin, 2021/04/20
- RE: printNl question, Mark Bratcher, 2021/04/20