Re: Call by Reference
- From: "davidnwelton@xxxxxxxxx" <davidnwelton@xxxxxxxxx>
- Date: Tue, 23 Oct 2007 07:51:22 -0000
On Oct 23, 8:02 am, Andreas Leitgeb <a...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Joe English <jengl...@xxxxxxxxxxxxx> wrote:
Andreas Leitgeb wrote:...
Gerald W. Lester wrote:
Upvar is used to implement pass-by-reference semantics.
I suspect Gerald is thinking of the traditional formal
definitions of call-by-reference and call-by-name.
Yes, after googling for "call-by-name" and then reading
a wikipedia article I now know what he referred to and I
accuse him of nitpicking, despite clearly understanding :-)
I agree. What most languages consider pass by reference is when the
reference refers to some value directly, rather than a key in a hash
table that can be used to get at the value. I don't recall how its
internals work, but I suppose upvar points the new variable name at
the old value, so I guess you could argue for that. However, in
practical terms, what you are passing to the proc that utilizes upvar
is the name - the key in the hash table, not the value - so I would
say that 'pass by name' is in some way a more accurate description.
.
- Follow-Ups:
- Re: Call by Reference
- From: Donal K. Fellows
- Re: Call by Reference
- References:
- Call by Reference
- From: Andreas Leitgeb
- Re: Call by Reference
- From: Andreas Leitgeb
- Re: Call by Reference
- From: Gerald W. Lester
- Re: Call by Reference
- From: Andreas Leitgeb
- Re: Call by Reference
- From: Joe English
- Re: Call by Reference
- From: Andreas Leitgeb
- Call by Reference
- Prev by Date: Re: Call by Reference
- Next by Date: Re: lambda... again
- Previous by thread: Re: Call by Reference
- Next by thread: Re: Call by Reference
- Index(es):