the := operator (affectation)

Dennis Brown see3d at writeme.com
Thu Jun 23 08:45:52 EDT 2005


John,

Of course you realize that if the = assignment operator was allowed  
in Transcript "put" would all but disappear from scripts.  Who wants  
to type putinto vs =.  Put would go the way of button vs btn.  I find  
myself reversing my opinion on this one.  "=" would make a nice  
shorthand notation.  I was just concerned that the syntax would be  
ambiguous to people or compiler.  If not, then why not have more  
compact scripts that are just as readable --just fix all the stupid  
little bugs before spending more than a day on this.

Dennis

On Jun 22, 2005, at 11:47 PM, John Vokey wrote:

> It is fascinating to note that in R (GNU's S) the operator evolved  
> from ``<-'' to ``='' despite the ambiguity of the latter (R has  
> both assignment operators (<- and ->), but still simple ``='' won  
> out.  Why?  Well, as with the letter ``e'' in English, nobody wants  
> to type 2 characters for the most common operation of assignment;  
> make the rarer cases clumsy, not the most common; hence ``=='' for  
> ``is equal to (logical)''.  I (tried to, anyway) taught Pascal for  
> years; the two most common complaints were, in order, the  
> assignment operator (i.e., ``:= is just stupid''), and ``that  
> stupid semi-colon''.  Often pristine syntax has to take a back-seat  
> to expedience.
>
> OTH, allowing ``a=4'' as a shorthand for ``put 4 into a'' harms  
> nobody, and meets with the expediency criterion; just don't require  
> it.  Similarly, no Basic compiler or interpreter ever had any  
> problem discriminating logical statements from assignments, nor did  
> programmers; it was a false purity that Pascal was promoting.   
> Indeed, we exploited it: a=b*(c=2)+d*(c<>2), which to any Basic  
> programmer (except those in which false meant -1, but simple  
> accommodations in code fixed that), transparently means: a is  
> assigned the value of b given c has the value of 2, otherwise, a is  
> assigned the value of d.
>
> On 22-Jun-05, at 4:51 PM, use-revolution-request at lists.runrev.com  
> wrote:
>
>
>> Yep
>>
>> On Jun 22, 2005, at 8:01 AM, Jon wrote:
>>
>>
>>
>>>
>>>
>>> Dan Shafer wrote:
>>>
>>>
>>>
>>>
>>>> (I always found the whole ==, +=, :=, == syntax mess pretty ugly.
>>>> I  love the elegance of put 32 into x.)
>>>>
>>>>
>>>>
>>>
>>>
>>> Elegance, verbosity.  Poe-tay-toe, poe-tah-toe...
>>>
>>
>>
>
> - JRV
> --
> There are 10 kinds of people:  those who understand binary, and  
> those who don't
>
> _______________________________________________
> 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