【发布时间】:2017-12-12 17:47:42
【问题描述】:
在 Parrot 时代有几个 Perl 6 的答案,但它们目前似乎不起作用:
这是基于 MoarVM 版本 2017.04-53-g66c6dda 构建的 Rakudo 版本 2017.04.3 实现 Perl 6.c.
Does perl6 enable “autoflush” by default? 的答案是默认启用(但那是 2011 年)。
这是我正在玩的一个程序:
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";
及其输出,这是一个不幸的命令:
2. This is standard out
1. This is an error
所以也许我需要打开它。 How could I disable autoflush? 提到了 autoflush 方法:
$*ERR.autoflush = True;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";
但这不起作用:
对于“IO::Handle”类型的调用者没有这种方法“autoflush”
我想我可以通过让我的 IO 类在每次输出后刷新来自己伪造这个。就其价值而言,正是缺少此功能使我无法将 Perl 6 用于今天的特定任务。
作为第二个问题,为什么 Perl 6 现在没有这个,尤其是当它看起来像以前有的时候?你如何说服 Perl 5 的人这不是问题?
【问题讨论】: