in reply to Re: Reference to a function
in thread Reference to a function

In computer science, there are two methods of passing arguments to a subroutine:

Three, counting pass by name.

See "Programming Language Pragmatics"
Language features that most designers now believe were mistakes, at least in part because of implementation difficulties:
* by-name parameters in Algol 60: Section 8.3.1 (Call By Name)

The argument gets evaluated each time it is used in the subroutine.

Replies are listed 'Best First'.
Re: Re: Re: Reference to a function
by oylee (Pilgrim) on Jul 25, 2003 at 21:54 UTC
    There's also call-by-need, which is basically just call-by-name with cached lazy evaluation. Basically, turn all your parameters into thunks (closure of no arguments) so they don't get evaluated when the method is invoked, and then evaluate them once and only once if they are referenced in the method.

    This post made for full-on nitpicking compliance :).
    Allen