Perhaps I've been a bit singleminded about "smart" strings, presented in the original text. As I understood it you would send in a reference to SmartObject->string_variable whereas I suggested to make the entire SmartObject even "smarter" and send it in instead. As for the fishyness of `= I agree that it makes things to strange to be comfortable.
The reason why I've focused on this practical problem is because it is one of the few that has been presented as a reason for introducing pointers. Obviously there has to be something good about it since most C-programmers find it a good idea, I just awaits a nice example. The most positive thing so far is that if the new lfuns are added there has to be an updated manual, because there is no way that people are going to figure out what `_&this means on their own. This paragraph sounds moodier than I intended, but you can pretend that it is more gentle and nice instead of having me rewrite it.
/ Martin Nilsson (har bott i google)
Previous text:
2003-04-16 02:26: Subject: Pointers/lvalues
If I understand you correctly, your `= lfun would imply that an assignment to a variable becomes dependent on the old value in it. That's not something I'd expect of an assignment; in my view an assignment operates on a variable, not the value in it. It'd make objects too slippery for my taste:
object x = a_fishy_object; ... x = a_nice_object; if (x->is_fishy_object) { werror ("Foo?\n"); x = 0; // Begone! if (objectp (x) && x->is_fishy_object) { werror ("Arrgh!\n"); destruct (x); // Die, sucker! } }
If lfuns could be added to variables then a `= would make sense.
Anyway, how would such a thing help simulating pass-by-reference on the calling side? Where would the object instance with the `= come from?
/ Martin Stjernholm, Roxen IS