Chris Angelico wrote:
>On Thu, Aug 28, 2014 at 3:44 AM, Stephen R. van den Berg <[email protected]> wrote:
>> - There obviously is no `= lfun. Is that technically challenging or
>> hasn't there simply been no need to make it possible?
>Don't like this idea! When you assign to a name, it should always
>rebind. Imagine:
>mixed foo = String.Buffer();
>foo = "asdf";
>Should that call foo->`=("asdf"), or reassign foo? IMO it should
>absolutely always reassign. Otherwise you get something like PHP's
>references - a pain to work with.
The operation could be determined by "overloading" based on types.
I.e. a String Buffer `=(string a) would only activate when the lvalue is
a buffer type, and the rvalue is of type string.
--
Stephen.