the := operator (affectation

Dave Cragg dcragg at lacscentre.co.uk
Fri Jun 24 03:50:17 EDT 2005


On 24 Jun 2005, at 03:55, Richard Gaskin wrote:

> It's hard to get less "xTalk-like" than RegEx, but those who use it  
> seem to like it and those who don't aren't bothered by its  
> availability.

Nobody *likes* RegEx. But it is powerful, and we use it because there  
is no practical alternative. I wish there were.

An assignment operator is a different kettle of fish. I'm against  
adding an assignment operator whether it be "=" or ":=" because it  
would add a fundamental change to the way statements are structured.  
(I.e all xTalk statements begin with a command in the form of a  
single word imperative.) I'm not against fundamental change if it  
adds something substantially new to the language, but in this case  
the purpose is just to save a bit of typing. The downside is  
potential confusion among new users (and old ones for that matter).

For example, "put x into y" is used for all containers in xTalk:  
variables, fields, buttons, images (and even URLs where we treat them  
as containers). Would the same apply to a new assignment operator?  
Consistency would say it does.

x = 4
field "myField" = "This is some text"
button "myButton" = line 1 to 4 of x
image "myImage" = url "binfile:myImage.jpg"
the selObj = somevalue

Once we start seeing statements like these we basically have two  
languages being used at once when most of us have a hard time  
learning one.

So my plea is "Don't mess with the language without good reason." And  
I don't see one in this case.

Cheers
Dave


More information about the use-livecode mailing list