Stupid, syntactic question:
If the assignment operator is really a function, for example
def value=(x) @value = x end
without a space between the left operand and "=", then why the assignment can be performed as test.value = x (with a space), but the method definition cannot be written as:
def value = (x) @value = x end
with space. Is this just the syntax dictated by the parser?
syntax ruby language-design
inyourcorner
source share