1. Re: Rob: Q: Euphoria 2.6 + PD source bug

Greg Haberek wrote:

>>> Dynamic variable routines
>>> like, variable_id(), read_var(), write_var() would be great too.
>>
>> What can we do with those routines, that we can't do without them?
>
> Mmmmmm.. pass-by-reference!

Yes, I see now.

> A big VB feature. I sure do miss it since
> I converted to Euphoria. With pass-by-reference, both you and the
> routine you call can alter the *same* variable in memory, not just
> copy the value back and forth. It would essentailly turn half of the
> Euphoria built-in functions into procedures.

I don't know VB very well, but I've been programming in PB for years,
which uses pass-by-reference as default. The programmer can choose
pass-by-value by using the "byval" keyword. Since pass-by-value is the
default in Euphoria, IMHO the simplest way to let the user choose
pass-by-reference would be to introduce a "byref" keyword.

Introducing three new routines for achiving pass-by-reference, dozens of
years after BASIC and other languages have shown how simple (simple at
least from the point of view of the user of the language) it can be
done, is not a good idea IMHO -- especially in a language like Euphoria
that claims to be simple.

Before you and Pete had replied, I actually didn't recognize that
the purpose of variable_id(), read_var(), write_var() would be to achive
pass-by-reference. That gives an impression, how "intuitive" it would be
to use those routines.

Regards,
   Juergen

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu