[Vienna-pm] Für L2R-Fetischisten (was: Hausbackene Syntaxerweiterung mit Perl5?)
Wolfgang Laun
Wolfgang.Laun at thalesgroup.com
Wed May 7 00:25:21 PDT 2008
Nicht ganz die richtige Liste (Pardon!), aber zum Thema passend und
(hoffentlich) ausreichend obfuscated ;-)
main(int c,char**v){return *v?c=main(c,++v),printf(c?"%s
":"\n",(-1)[v]):0,c-1;}
-WL
Josef Schmid wrote:
>Roland Giersig schrieb:
>
>
>
>>Robert Barta wrote:
>>
>>
>[...]
>
>
>>>... die Syntax erweiteren. Ich verwende map/grep exzessiv, aber das
>>>verkehrt von hinten nach vorn lesen/schreiben ueberless ich lieber den
>>>Chinesen.
>>>
>>>
>[...]
>
>
>>Zum Thema rechts-nach-links für grep/map:
>>
>>autobox (http://search.cpan.org/~chocolate/autobox-2.23/autobox.pod)
>>erlaubt es, das andersrum zu schreiben, also
>>
>>@cleverlies = @students->
>> grep(sub {$_->{marks} > 85})->
>> map(sub {$_->{matrikelnr}});
>>
>>Vielleicht hilft dir das... :-)
>>
>>
>
>Oder alternativ:
>use English::Reference qw(deref);
>sub _asiaphop
>{ my $last=pop; my $peek=$_[$#_];
> ref $peek eq'CODE'?$last->(_asiaphop(@_)):$last->(deref $peek);
>}
>sub asiaphop (\[@$%];&&&&&&&&&&&&&&&&&&&&&&&&&&&&&) {_asiaphop(@_)}
>
># test: -> (b)(c)(d)(e)
>my @a=qw(a b c d e);
>print asiaphop @a,sub{ grep{$_ ne 'a'}@_ },sub{ map{"($_)"}@_ };
>
>obwohl ¬ so hübsch,
> Jo "von Affen gebissen" sef
>
>
>_______________________________________________
>Vienna-pm mailing list
>Vienna-pm at pm.org
>http://mail.pm.org/mailman/listinfo/vienna-pm
>
>
More information about the Vienna-pm
mailing list