2011-12-31

syntax for readonly, const, out, inout, persistent

12.2: adda/type/syntax for readonly, const, out, inout, persistent:
todo:
. need to review or finish the type syntax .
.#./.txt
.#./!.txt! -- array of const pointer to const text,
A ^#.txt -- persistent array of text,
[12.3:
. this would be a lot more readable if the (!) was simply replacing the (.)
#!/!txt -- the (!) would then be translated as "(return const ...)
-- that says type is array return const pointer to return constant text .
...
however, it doesn't address all needs:
for operations over self ( declared as x`f().t )
how do you say `f is readonly? ]
12.5: read-only operations:
. in places where !`f might say
(operation over obj is readonly)
[1039: adde's english mode should apply to commands too;
it would display footnotes of what a command does
in a twitter sized message . the footnotes would be at each step;
so also below any complete algebraic expression .]
the problem with consistency is that you're not using the same syntax
where dot is showing the obj type being returned .
. there were 2 situations for rom or const:
# rom for params ie sharing ,
# const for your own obj's .
. in the case of x`f(), you're looking to express rom on a param
but the param is implicit, so then you need to make it explicit:
(o!T)`f -- a read-only operation;
(o.T)`f, `g -- mutating operations .

No comments:

Post a Comment