[racket] Pass by value/name/reference
On Jul 20, 2014, at 9:25 PM, Jon Zeppieri wrote:
> On Sun, Jul 20, 2014 at 6:27 PM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
>>
>> The phrase "call-by-value is a reduction strategy" has no meaning per se but is a left over from the time when people hadn't figured out the above (pre 1070).
>>
>
> I apologize for spreading this nonsense. Is it the phrase "reduction
> strategy" that's the problem? In the paper you cited, you refer to
> "evaluation strategies" and "binding strategies" and list
> call-by-value (eager) and call-by-name (delayed) as examples of the
> former. Is the problem with "reduction strategy" that it properly
> refers to rules for reducing redexes in a lambda calculus (and not
> parameter-passing in a programming language)? Or is it just nonsense
> tout court?
Yeap. Strategies exist in any LC. A strategy is simply a function
that picks the next redex to reduce. Strategies have uses BUT not
to describe parameter-passing mechanism. The latter are turned into
axioms directly. For example
BY NAME: (function (x) body) any-argument = body with all (free) x replaced by any-argument
BY VALUE: (function (x) body) value-argument = body with all (free) x replaced by value-argument
So you see there are two calculi and they each come with a different
axiom but the SAME strategies.
;; ---
The idea is so much ingrained in programmer's mind due to some
basic text books that I can't blame anybody and I am certainly
not blaming you.
I just don't like it that the idea is repeated 40+ years
after it was debunked in my neighborhood :-)
-- Matthias