realbasic-betas.mbox
[Top] [All Lists]

Re: Ability to have more than one Lvalue

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: Ability to have more than one Lvalue
From: Guyren G Howe <guyren at mac dot com>
Date: Sun, 28 Jul 2002 12:58:07 -0700
Kevin Ballard wrote:

> To me, this just looks like it could be very confusing. What happens if you
> say
> 
> address=GetAddressAndPort(Server)
> 
> ? Would it say missing LValue? That would be wrong as it has an LValue.
> They'd have to have new errors and everything. I think it's a waste of time
> for something like this, which has good potential for confusion.
> 
> Besides, in response to a previous message, ByRef is not a kludge. If you
> understand what it's actually doing, you'll see it's perfectly fine. And it
> also has other uses, namely if you have a 2MB string you don't want to copy
> it, so you pass it around ByRef.

I don't think this semantics would be less confusing than using ByRef, for
the reasons I gave previously.

In response to your example, I think it would be quite simple to just make
all LValues optional. Sometimes, you don't need the results of a function.
Functional languages have been doing this for decades, and it really works
just fine.

I meant that ByRef is a kludge in the sense that you're implenting a
function that computes and returns multiple values, and using the arguments
to the function to return the result is just weird (if you think about it).
ByRef should be reserved for the 2MB string kind of example you describe.

If we made LValues optional, and you're explaining it all to a beginning
programmer, do you think it would be easier to explain ByRef or multiple
return values?

Guyren G Howe
REALbasic/4th Dimension Consultant
Technical Writer/Trainer



<Prev in Thread] Current Thread [Next in Thread>