- 65 名前:_gunzip@書けるの? mailto:sage [01/12/30 06:30 ID:???]
- >>60
Perl6では可能ですよ。詳しくは RFC025 dev.perl.org/rfc/25.html と、 Apocalypse 3<Operators> の "multiway comparisons" の項を見てね。 dev.perl.org/perl6/apocalypse/3 >>62 RFC26 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) { # なんやかや } と書けます。
|

|