var s : string = "How" ~ " are " ~ "you"This would make an interesting syntax possible for output, like C++ has the << operator. You could have an output stream that has the operators ~ and ~=. This can make the following possible:
# s = "How are you"
s ~= " today?"
# s = "How are you today?"
procedure writePoint(inout s : FileOutputStream, x & y & z : real)It's not ideal because s is still used twice. But maybe it's a start :-)
s ~= s ~ '(' ~ x ~ ", " ~ y ~ ", " ~ z ~ ')'
end
I am also thinking about pass by value or by reference for 'in' parameters. As I wrote previously, 'in' parameters cannot be changed at all by the callee. So in my opinion it would be a nice idea to use pass by reference for this. It would make 'in' parameters fit in more, because 'inout' parameters are also passed by reference and 'out' parameters use a reference to write the result directly to the location of the caller.
No comments:
Post a Comment