App::Ack と IO::Interactive
いや、これ ack のバグじゃないかな。Mac とか関係ないっぽい。
ack-1.58 まで出力が端末かどうかの判定は
my $is_tty = -t STDOUT;
だったのが、ack-1.60 で突然 IO::Interactive のコードを引っ張ってきたようで、その該当コードが以下。
@ARGV を参照して入力が端末かどうか調べている訳で、この判定コード自体が ack に適してないんじゃないかな。ack の場合、@ARGV には検索パターンが入っている訳だし。
というわけで、作者にメールするのがベストなのではないかと*1。
=head2 C<is_interactive()> This is taken directly from Damian Conway's IO::Interactive. Thanks, Damian! This subroutine returns true if C<*ARGV> and C<*STDOUT> are connected to the terminal. The test is considerably more sophisticated than: -t *ARGV && -t *STDOUT as it takes into account the magic behaviour of C<*ARGV>. You can also pass C<is_interactive> a writable filehandle, in which case it requires that filehandle be connected to a terminal (instead of C<*STDOUT>). The usual suspect here is C<*STDERR>: if ( is_interactive(*STDERR) ) { carp $warning; } =cut sub is_interactive { my ($out_handle) = (@_, select); # Default to default output handle # Not interactive if output is not to terminal... return 0 if not -t $out_handle; # If *ARGV is opened, we're interactive if... if ( Scalar::Util::openhandle( *ARGV ) ) { # ...it's currently opened to the magic '-' file return -t *STDIN if defined $ARGV && $ARGV eq '-'; # ...it's at end-of-file and the next file is the magic '-' file return @ARGV>0 && $ARGV[0] eq '-' && -t *STDIN if eof *ARGV; # ...it's directly attached to the terminal return -t *ARGV; } # If *ARGV isn't opened, it will be interactive if *STDIN is attached # to a terminal and either there are no files specified on the command line # or if there are files and the first is the magic '-' file else { return -t *STDIN && (@ARGV==0 || $ARGV[0] eq '-'); } }
*1:自分でメールするのが筋な気もするけど
プレゼン
キミならどう書く ?プレゼンソフトを作る?
LLイベントではすっかり恒例になりました「キミならどう書く」、今年はプレゼンテーションソフトウェアを作ります。いくつかの言語で実装していただき、もちろんそのソフトウェアを使ってプレゼンをしていただきます。これを機会に、皆さんも自分の好きな言語でプレゼンテーションができるようになるかも?
ちょうど、輪講資料作成用に reStructued Text => LaTeX Beamerなコード という変換を行う Python のコードを書いたところだったりする。
いや、というか目的次第では rst2s5 で終了だったりもするな。
ラージ
以前から不思議から思っていたんだけど、なんで数式などで大文字アルファベットを口頭で伝えるときに large を付けるんだろう。普通は大文字って capital letter か uppercase letter ではないのかな。
で、検索してみたらこんなのがでてきた。
ふーむ。でも数量的な large / small とややこしくないのかな。