perl6/rakudo: How could I disable autoflush?

对着背影说爱祢 提交于 2020-01-03 17:15:30

问题


I tried this, but it didn't work:

$*OUT.autoflush( 0 );

回答1:


$*OUT.autoflush = False should disable it, and it runs without error, but it seems that parrot's IO still flushes automatically. So there currently doesn't seem to be an easy way.




回答2:


Rakudo doesn't support autoflush. There's a note in 5to6-perlvar under the $OUTPUT_AUTOFLUSH entry.

Some examples from a long time ago mention an autoflush method, but that has disappeared:

$*ERR.autoflush = True;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";

But that doesn't work:

No such method 'autoflush' for invocant of type 'IO::Handle'

I haven't seen any discussions about when this might show up as a feature, or a proclamation that it will never be a feature.



来源:https://stackoverflow.com/questions/5057617/perl6-rakudo-how-could-i-disable-autoflush

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!