the := operator (affectation

Martin Baxter martin at materiaprima.fsnet.co.uk
Fri Jun 24 02:37:37 EDT 2005


I haven't been following this thread closely, but the impression I've 
got is that the arguments have centered around whether: var gets val, or 
an equivalent is acceptable xtalk *style*.

I would say that var gets val conforms to the spirit of xtalk, but 
unfortunately it does not conform to the syntax, because you cannot 
start a program line with a container name. At present that is a syntax 
error, regardless of any operator that you might type after it.

A line of transcript must start with a command or keyword, so to be 
compatible the command would be constructed like:

gets A=1

or something along those lines. And all that is achieved is that you can 
type = instead of into. (The local command can actually take this form 
of course).

Martin Baxter

Dennis Brown wrote:
> Dar,
> 
> I am not arguing for "=", I am arguing for "gets" and some shortcut  
> that suits, if any.  "Gets" is a cousin of "get" command that is  
> already a left assignment operator.  It does not introduce a new  
> concept to the syntax, but just makes the "get" construct more  
> general.  I actually find  it a bit awkward when I have used the "get  
> x" construct, then decide later to use another variable instead of  
> "it".  The editing is a lot more than just changing variable names.    I 
> have even taken to "put x into it" on occasion, just so I can more  
> easily change my mind later.  I would be happy to be able to change  
> "get x" to "myVariable gets  x".
> 
> Dennis
> 
> On Jun 23, 2005, at 1:40 PM, Dar Scott wrote:
> 
>>
>> On Jun 23, 2005, at 11:17 AM, Dennis Brown wrote:
>>
>>
>>> The "get x" construct is already a syntactic equivalent of "it=  x" 
>>> (left assignment).
>>> That could be expanded to the general form "it gets x".
>>> Now we have a general xTalk flavored version using the new "gets"  
>>> keyword.
>>> From there just substitute any shortcut for "gets" like "gts" or "=".
>>>
>>> There you have it.  Elegance, consistency, and brevity!
>>>
>>
>> There is nothing elegant about "=" for assignment.  IMHO, ":=" is  
>> much superior and is less offensive.  In mathematics "=" is a  
>> relation or sometimes a function or sometimes used in "where" or  
>> "let" syntax (named value scoping).
>>
>> Commands in xTalk follow the English implied-you imperatives.  The  
>> deviation from that to a descriptive of the dataflow does not fit.   I 
>> come from a functional programming background, but I accept the  
>> imperative style.
>>
>> Dar
>> -- 
>> **********************************************
>>     DSC (Dar Scott Consulting & Dar's Lab)
>>     http://www.swcp.com/dsc/
>>     Programming and software
>> **********************************************
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 




More information about the use-livecode mailing list