Re: vote on assignments as expressions
Laurent Dube <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Organization | DEI |
| Message-ID | <[email protected]> |
Operators are given the names of
- prepositions (plus, minus, times)
- conjunctions (or, and)
- adverbs (not)
- adjectives (greater than)
- verbal adjectives (divided by)
That's why "gets" doesn't cut it as an operator name.
If we need to replace the word operator in
foo( a operator b )
to express the action of assigning, or the result of being assigned,
the picking is poor, leaving maybe only
foo( a assigned b )
You know, there is something totally amiss here. An expression evaluates
to the result of the operator:
a + b returns the sum
a > b returns the comparison
a = b returns the success of the assignment (unless one has a C mind)
I surmise that we can't correctly say "assignment as expression",
because it's "a" that gets the contents of "b", not the expression.
What we are after here is rather a way to represent a pipe. Or a sequence.
1) do the assignment of b to a
2) then use a
pipe: b -> a -> foo
r-to-l sequence: foo(a(b))
In plain language, we would say: pass the value of b to a, then pass
the value of a to foo.
What construct would convey a(b) in a sense that's similar to foo(a)?
I'm way past my bedtime...
Laurent Dube