>>1
Also, having two characters keeps it consistent with the other relational operators (>=, <= and !=).
Name:
Anonymous2009-06-07 19:12
>>4
But then you have 4 2-char operators (>=, <=, !=, ==) and only 2 1-char operators (>, <).
If equality testing were done with =, you would have the same amount of each.
>>22
But why? Knuth uses ←. APL uses ←. You should use ←.
Name:
Anonymous2009-06-07 22:59
To be truly consistent, the equality operator should really be ?=
Name:
Anonymous2009-06-07 23:11
Actually you are all wrong and the assignment operator should be [assign][var]variable-name[/var][val]value[/val][/assign], as specified in the BBCODE'98 report.
Name:
Anonymous2009-06-07 23:44
In Erlang, = performs an assignment and throws an exception if the values were not already equal. Truly the superior design.
Name:
Anonymous2009-06-07 23:46
>>21
Use of <- would introduce ambiguity in tokenizing.
>>34
That's just arbitrarily picking one meaning to resolve the ambiguousness. It doesn't change the fact that you through exceedingly poor planning of your language syntax made a<-b confusing, as the programmer could meaningfully intend either one. Or does your language do something stupid like differentiating between statements and expressions, or not allowing infix operators?
Name:
Anonymous2009-06-08 2:36
>>37
Not >>34, but my language does the sane thing and puts spaces between tokens, except for braces (when my language makes use of a lot of braces.
Name:
Anonymous2009-06-08 2:43
>>11
Did you really just close ``[sup]'' with ``[/sub]''?
Name:
Anonymous2009-06-08 2:50
>>11
Did you really just close ``[sup]'' with ``[/sub]''?
Using `=' for assignment is an abomination that should never have been allowed to happen. Only someone who would think of such a thing would ever have come up with `=='. Therefore it is no coincidence that they both exist, and that they mean what they do.
Then you have Scheme, with
=
eq?
eqv?
equal?
string=?
char=?
Java has always existed.
Name:
Anonymous2009-06-08 3:30
The correct answer is = should be used for comparison and assignment.
The function of the operator can be determined by its context, so it should be determined by its context.
Regardless of using a lagnauge that uses = and ==, good programming practice dicates the context in which these should be used anyways, so having seperate operators invites errors and is a lazy way shitheads write parsers.
>>43 all languages should have a context-sensitive grammar 1/10
Name:
Anonymous2009-06-08 4:00
>>42
Using ‘?’ to denote a predicate is an abomination that never should have been allowed to happen. ‘?’ denotes a question. That's why it's called a ‘question mark’. Consider (eq? 'a 'b). This means “Is it equal?” ‘True’ is not an acceptable answer to this question. Predicates must be assertions to make any sense at all. Please stop using question marks like small children who answer “yes” on true/false tests.
>>43
>so having seperate operators invites errors and is a lazy way shitheads write parsers. [SPOILER]Having separate operators requires the coder have a slightly more active mind to know how to not make errors.[SPOILER]
IHBT
Name:
FrozenVoid2009-06-08 14:46
The "value assignment operator" is already reserved to :=(which is unfortunately harder to type then = ) in several languages. Anything which uses Unicode is out of the question, because this substantially decreases productivity(with hundreds of == manually entered).
>>51 Anything which uses Unicode is out of the question
Why? ← is one keystroke, := is two. How is ← less productive? Truth: ← is more productive, more concise and produces more legible code. Not to mention that := looks like a penis. And I don't like penises in my code.
Name:
Anonymous2009-06-08 16:22
>>52 And I don't like penises in my code.
Try to stay away from Haskell then.
Name:
Anonymous2009-06-08 16:39
>>52
You are wrong, ← is not one keystroke, but one symbol. := is two symbols. How many keystrokes a vector of symbols is (a name), depends on various software and hardware. (strictly speaking, only on the software, the hardware can always be emulated - but it is a question: where can software run without hardware?)
For example, ← was a combination of two keystrokes for me. ^V. An extra action must be taken for the first ← used. I could set up my editor, to type 'larrow' and get that symbol instead.
You said ← is more productive. I'll say that this is a problem only to programming languages which do not have flexible grammar; semantically retarded, in practice, horribly awful. Lisp is a family of programming languages which for each it is true that they're different than the aforementioned described ones. Lisp my friend. It is lisp which will amaze you by how much you're allowed to change her, without her changing at all!
Name:
Anonymous2009-06-08 17:14
>>53
Haskell is safe from penises as long as you don't do bitwise-ORs.
>>28
Well then don't fucking do that in a C-based language.
Haskell (among other languages) treats contiguous strings of punctuation as an identifier for an operator. There is never any ambiguity between a <- b and a < - b.
Why can't a Scheme programmer write (definex5)? Is the tokenizer retarded there too?
Name:
Anonymous2009-06-08 17:58
>>54
Let's all redefine our arrow keys to produce actual arrows when pressed.
>>60
You mean you don't already? I have Emacs keybindings everywhere, so the arrow keys are redundant.
Name:
Anonymous2009-06-08 18:03
>>54
For me, ← is “Alt Gr + y”, two keystrokes, while := is “Shift + .” and “Shift + 0”, a total of 4.
← is clearly vastly superior, and it's counterpart, →, allows for the variable the expression's assigned to to be on the right, allowing you to code in whichever way's more natural to you (which is a good thing, no matter how many FIOC-enthusiasts tell you otherwise).
>>62 it's counterpart, →, allows for the variable the expression's assigned to to be on the right
variable the expression's assigned to to be on the right BRILLIANT!!
Also, it's
Name:
Anonymous2009-06-08 18:38
>>62 For me, ← is “Alt Gr + y”, two keystrokes, while := is “Shift + .” and “Shift + 0”, a total of 4.
I T T : A F T E R E V E R Y S H I F T E D K E Y S T R O K E W E T A K E O U R F I N G E R S O F F T H E S H I F T K E Y
Spaces used here to simulate the lifting of a finger.
Name:
Anonymous2009-06-08 18:47
>>65
You'll have to excuse me, English is my second language.
>>65
I have actually used a language with a → operator. It was a shitty BASIC-like language for my graphical calculator. (Unfortunately, I did not have a TI-89.)
Name:
Anonymous2009-06-08 19:21
>>68
I've got a TI-85 with a STO key that outputs →.
Name:
FrozenVoid2009-06-09 0:13
>>62
=: can be used as → without any ambiguity.
a=:b and a:=b, with boolean (a=b)