Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
The problem with using () is that it creates ambiguities: saying (objName) can
be
interpreted as:
a) an expression referring to the value of objName (the current interpretation)
b) a cast to objName (incorrect assumnption, but the language is consistent in
that
anything bracketed is an expression, not a cast)
c) new instantiation of a type from a prototype
If the ambiguity between a) and c) can be resolved, then I think switching to
another set of glyphs would be a good idea. But the [[ ]] is necessary, because
we
need to know we're sending to a new instance of std.gen prototype, and not the
prototype itself.
The -> is not redundant: saying "1 x s" means "take 1, filter it through x,
throw
away the return value, then get the constant current value of s". If we say "1
x -
>s", that means "take 1, filter it through x, and send the result to s". These
are
two different perfectly valid semantics, each of which is useful in different
cases,
and they need to somehow be kept separate. Maybe -> isn't the best way to do
this,
but it needs to be done.
The <- operator is just syntactic sugar, and indeed, the example you gave is
almost
valid. If you wrote it this way:
10 [[std.gen]] ? { ...
Then it would be well-formed ANI code.
The reason that <- is included is that types become much more obvious if they
are
right next to the = sign in binding declarations, and having something like
x = { blah blah blah ; blah blah \ blah -->; } [[std.something\]];
completely obscures the fact that x is of type std.something\, wheras if you
wrote
it with the <- syntax, it would be obvious.
Original comment by ultimus@gmail.com
on 28 Jan 2010 at 4:32
Original comment by ultimus@gmail.com
on 10 Mar 2010 at 4:10
Original issue reported on code.google.com by
dan.from...@gmail.com
on 25 Jan 2010 at 5:12