Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PERL6

Name: Anonymous 2007-09-26 6:20 ID:tc4AU1yb

pugs> my ($car, @cdr) = (1..10);
pugs> say "my other $car is a {@cdr}";
my other 1 is a 2 3 4 5 6 7 8 9 10

Name: Anonymous 2007-09-26 6:23 ID:oGfXeZQX

car = lambda x: x[0]
cdr = lambda x: x[1:]
cdr.__doc__ = 'Cudder'

Name: Anonymous 2007-09-26 6:24 ID:Heaven

Perl 6, now there's a useless toy language

Name: Anonymous 2007-09-26 7:11 ID:mPiS8Dqr

Perl 6, now there's a [strike]useless toy[/strike]AWESOME language

Name: Anonymous 2007-09-26 7:16 ID:URqDsZ6f

>>4
hah, faggot

Name: Anonymous 2007-09-26 7:19 ID:th4c5bIu

>>4

Way to fail, perlfag

Name: Anonymous 2007-09-26 7:48 ID:Heaven

Putting the braces outside the data type indicator is braindead and reeks of PHP. There's a good reason shells use ${var}; it makes the interpolation simpler to understand because there's only one character that delimits interpolated values. (Or in Perl's case, three, but that's another gripe for another thread.)

Name: Anonymous 2007-09-26 7:56 ID:4cq+PLq6

>>4
looooooooooooool

Name: Anonymous 2007-09-26 8:42 ID:oGfXeZQX

>>7
Not to mention I usually want to print a variable between braces. Another option would be to ONLY accept braces for interoplation, then support any expression inside, kind of like Ruby and unlike Python 3000's format which fails.

Name: Anonymous 2007-09-26 9:20 ID:Heaven

>>9

"{".{$VAR}."}"

?
yes, it's a mess.

Name: Anonymous 2007-09-26 10:35 ID:1v9vGsZn

sub car(@){return$_[0]}
sub cdr(@){shift;return\@_}
my @list=1..10;
say "my other ${\(car @list)} is a @{\@{(cdr @list)}}";

Name: Anonymous 2007-09-26 10:42 ID:oGfXeZQX

>>11
It looks like shit
It's still Perl
And Perl 6 is not getting released before Duke Nukem Forever
But at least it's better than a 15 years old C faggot writing his OMG OPTIMIZED library for games using inline assembly and low-level API calls he'll never finish.

Name: Anonymous 2007-09-26 11:17 ID:sKKRBU2+

>>12
I think that's Perl5. Perl6 gets real parameter passing (haha, wtf? now?)

Name: Anonymous 2007-09-26 12:21 ID:mPiS8Dqr

(haha, wtf? now?)
Needed because

my $self = shift;


sounds to much like myself = shit

Name: Anonymous 2007-09-26 12:34 ID:Heaven

>>14
anyone with more than one brain cell doesn't use shift like that.
my($self)=@_;

Name: Anonymous 2007-09-26 12:39 ID:th4c5bIu

>>15
Anyone with more than one brain cell doesn't use Perl.

Name: Anonymous 2007-09-26 12:59 ID:mPiS8Dqr

>>15
my $self = shift

* looks nicer
* more explicit on what you want

It's also often useful:

sub add {
    my $self = shift;
    $self->validate(@_);
}


Rather than:

sub add {
    my ($self, $name, $address, $country, $phone, $email) = @_;
    $self->validate($name, $address, $country, $phone, $email);
}


Besides:
http://google.com/codesearch?q=%22my+%24self+%3D+shift%22 -  103,000 results
http://google.com/codesearch?q=%22my+%28%24self%29+%3D+%40_%22 - 400 results.

Name: Anonymous 2007-09-26 13:05 ID:th4c5bIu

http://google.com/codesearch?q=my%5Cs%2B%5C%24self%5Cs*%3D%5Cs*shift&btnG=Search&hl=en&lr= 11600
http://google.com/codesearch?hl=en&lr=&;q=my%5Cs*%5C%28%5C%24self%5C%29%5Cs*%3D%5Cs*%40_&btnG=Search 23500

Name: Anonymous 2007-09-26 14:00 ID:PcOVmpCH

Name: Anonymous 2007-09-26 14:04 ID:4lGyzJix

>>18
http://google.com/codesearch?hl=en&lr=&;q=my%5Cs%2B%5C%24self%5Cs*%3D%5Cs*shit

Name: Anonymous 2007-09-26 14:17 ID:Heaven

Name: Anonymous 2007-09-26 14:18 ID:aR0DHbMD

Name: Anonymous 2007-09-26 14:45 ID:Heaven

>>18
my $self = shift is often written as my ($self) = shift

Name: Anonymous 2007-09-26 14:50 ID:mPiS8Dqr

http://google.com/codesearch?q=%28NULL%2C%5Cs*%29%7B5%7DNULL%5C%29

Name: Anonymous 2007-09-26 14:53 ID:th4c5bIu

>>23

That's great.

Name: Anonymous 2007-09-26 17:54 ID:URqDsZ6f

Name: Anonymous 2012-06-25 23:37

卩咐ĥĖ陦呦酙剓ă疄ᥳ銉鍣瞉鞂螀ፁ搣➈㢓䥵ᜓ⠠ቕᑖ唙木舳࠶䥁Ԑ颁坃鐙䆘✄䢐≕甓蠵焘钔鍲ᢇ儉襔熙ᐣ虅㠅夑ᚇ率ℑ猵々嘤䘆坣ई霳蕂垙䥐䔑茘ı睓眅栥唢焒㡉☔剔䘗ᘂ皂め椨⑘㘑灂䑐唥虔酅⚙ܸᜧ茤ݔ楱ڐ祃⠧䉗㥣㡥ض䍇莀唢腳砹ʒ戙呀耠Ԩ㍵䡰ᠥ楖ᘕ❂Ր፤❶⥐㚘爙爵匠᎐ᡢ虂鐂鄐➔፦杣㤇儒煣熇␷سԂ青琱蕤䥖垇荴㖑煉ᙀ䍅舰ㄆ䈣鉔⒇ـ閙襧䝈兓剤桖甕唶ᑓ䌅昶ₕ椅兢㐖㍨⌆茗⥹愶鉷㑇硂䡒▂慖莂喇ᕅ䐁㔑瞓ㄦ靈⍑㐡′饓萸瘘ᅹ锵㊐ቅ灘ᅄ✕癷䢉爂⍕䞒瀦虸坰Ŧ㍳鍆ሒ㜡ℓဖ逅䥅蝹㉓♰Ȧ☣㖅疓吨吀ⅆ≄霰㌆牸ㄶ撓✔榁啲晳䐣⤰瑰㚀搉❱ᝑ‣玀–榀覄晱鈀鉣蠰硨䄖膄䔗偒္ባ✨☔✔瀈ᡙ當≔逑祁ㄔ≴ऄ␳䄉ᐓ⥆䍕ㅩ鑡ا㔢ख़㖃ၠ疗┴†吤枆䜧䍱ᙀࡖ⊗ᔨ袓䥩

Don't change these.
Name: Email:
Entire Thread Thread List