新しくperlで標準で欲しい関数は?
■ このスレッドは過去ログ倉庫に格納されています
0065_gunzip@書けるの?
01/12/30 06:30ID:???Perl6では可能ですよ。詳しくは
RFC025 http://dev.perl.org/rfc/25.html と、
Apocalypse 3<Operators> の "multiway comparisons" の項を見てね。
http://dev.perl.org/perl6/apocalypse/3
>>62
RFC26 http://dev.perl.org/rfc/26.html で提案され、Perl6で
取り入れられる予定です。Damian Conway氏のExegesis 2
"Take that! And that!" に実例が出てきます。
また、省略時パラメータは //= で行います。
ですから、例えばC++で(今書いてたコードから拝借)
void
QMenu::insert(const QString& text, int index = -1)
{
// なんやかや
}
をPerl6では、
sub
QMenu::insert(string $name is constant, int $index //= -1)
{
# なんやかや
}
と書けます。
■ このスレッドは過去ログ倉庫に格納されています