【发布时间】:2017-07-14 18:19:40
【问题描述】:
解释器中的参数语法似乎有些不一致。我正在使用最新的 Rakudo。请看以下终端输出:
$ 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
【问题讨论】:
-
我之前也犯过类似的错误(见Use of colon in method and function calls in Perl 6)