Why = = (and not just =)
mailund at birc.dk
Wed Oct 22 18:12:22 CEST 2003
On Mon, 20 Oct 2003 00:59:30 +0200, Carlo v. Dango wrote:
>> expression syntax to boot. The original language in the Algol family,
>> Algol 60, used ":=" as the assignment operator as I recall, a tradition
>> followed by Pascal.
>> Frankly, I'd rather have the assignment operator be something
>> like a left arrow: "<-" perhaps. I think it makes more sense,
>> and it avoids the confusion between one = and two.
> actually Algol was meant to have the <- rather than the := but due to
> problems writting the lexer/parser, it became :=
> if you want a language which uses the <- operator then have a look at the
> language "Beta" it takes a little getting used to, when used nested ;)
Actually, if I recall correctly, BETA <URL:http://www.daimi.au.dk/~beta/>
uses the "->" operator--assignment goes the other way.
In BETA there's syntactical difference between assignment and equality
tests (= for testing equality, -> for assigning), but assignment and
method calls uses the same syntax. So assigning to variable x, and
calling function f, uses the same operator:
5 -> x; 5 -> f;
More information about the Python-list