Honestly it's pretty strange that assignment has a directionality.
Some languages use directional notation for assignment (see [1]):
5 -> x
is clear.[1] https://en.wikipedia.org/wiki/Assignment_(computer_science)#...
x := 5
I have heard that this was to mimic (in ASCII) the look of an arrow: x ⇐ 5 x <= 5
But of course, that means “less than or equal to”.You could do:
x <- 5
But I suppose the mere presence of the “less than” symbol is weird in context. (Although, maybe not inherently weirder than using the equals sign for something other than equality?)Perhaps we would have been better off if we’d all just agreed early on, that @, #, or ~ should represent assignment.
set x to 5X = Y; // what should change?
Doesn’t have to.
Here's a simple example (in a declarative language that allows non-terminating computation; in a total language similar examples can be given, except "impossible" means intractable rather than non-computable, which, for all intents and purposes is the same):
X = terminates?(P(1))
If X is known then finding a P is easy; if vice-versa, finding X is possibly impossible.