解释器中的参数语法似乎有些不一致。我正在使用最新的Rakudo。请看下面的终端输出:解释器中的Perl 6函数参数语法(REPL)
$ perl6
To exit type 'exit' or '^D'
> say: "foo"
foo
> say("foo")
foo
> say "foo"
===SORRY!=== Error while compiling:
Two terms in a row
------> say⏏ "foo"
expecting any of:
infix
infix stopper
statement end
statement modifier
statement modifier loop
>
$ perl6
To exit type 'exit' or '^D'
> say "foo"
foo
> say("foo")
foo
> say: "foo"
foo
> say "foo"
===SORRY!=== Error while compiling:
Two terms in a row
------> say⏏ "foo"
expecting any of:
infix
infix stopper
statement end
statement modifier
statement modifier loop
>
$
看来你已经使用了“:
”或“()
”后提供的参数,你不能回去用“”,即空间,以供应参数。
还是我错过了什么?
谢谢!
lisprog
我之前做过类似的错误(请参阅[在Perl 6中使用方法和函数调用中的冒号](https://stackoverflow.com/questions/30982697/use-of-colon-in-method-andfunction -calls-in-perl-6)) –