Re: Re: print ambiguity

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Joe Mason wrote:

> Laurent just said that one "exciting" use of this syntax was to make
> userdefined keywords.  I don't see how this helps: if you want a
> keyword like "object" or "with", you'd have to pass an entire block
> to it - does this syntax allow that?

No, but it is a baby-step towards code-blocks.  All we'd have to do is add a
new flag word.  Maybe have "codeBlock_" allow code blocks and "command_"
would still only allow argument lists.  Then we'd need to figure out how to
call them from within a function.  A simple callCodeBlock() would suffice.

> If it's just for things that
> can only take simple expressions as arguments, why not just make a
> function?

It IS just a function.  You don't have to type the parens though.  I like to
think of it as just another way of starting execution with arguments.  There
are commands, function calls, and operators.  In Prothon you can use any of
the three now.  If you are going to argue that is has to be pure and always
use parens, then would you say we have to get rid of "a + b" also?

Who am I kidding.  It's mainly of way of keeping the old print statement
while also being able to use it as a function.  Being able to write your own
command is a fringe benefit.

You do have to admit the stderr example is kind of useful.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.