[TriLUG] Gmail invite

Rick DeNatale rick at denhaven2.homeip.net
Wed Aug 25 15:14:26 EDT 2004


On Tue, 2004-08-24 at 08:00 -0400, Matt Frye wrote:
> Copying _doesn't_ count, but Mike seems to at least understand
> Jensen's Device.
> 
> The key is pass-by-name parameter passing, whereby argument
> expressions are compiled to parameterless procedures - the infamous
> "thunk."  Thunks can be passed into a called procedure to re-evaluate
> the argument.
> 
> Good stuff.  

However, to be pedantic, Jensen's device isn't a synonym for call by
name, but rather a specific use of call by name to implement a generic
summation function.

It's interesting in that it points out the differences between call by
name and call by reference (the way early Fortran* did it) and call by
value, which is the way most languages designed since C work**.

* I once spent a frustrating period trying to debug a stubborn Fortran
II program. It wasn't until I realized that the "constant" 2 had changed
after passing it as a parameter to a subroutine that I twigged on the
subtleties of pass by reference.

** I'd also argue that today's object-oriented languages have also added
a new linkage semantics of pass by object reference.  Also you can of
course pass a reference in C as a value, but at least you've got a clue
of what's going on when you have to explicitly dereference it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20040825/039ffa56/attachment.pgp>


More information about the TriLUG mailing list