JavaScript ã§ã¯
apply ã call ã使ã£ã¦ this ãå®è¡æã«ä¸ãããã¨ãåºæ¥ã
var func = function() { return 1 + this }; alert(func.apply(1)); // 2
Perl ã§ã¯
ããããã¨ãthis ã£ã½ãæãã§ä¸ãããã
my $code = sub { 1 + shift }; print 1->$code; # 2
Algorithm::C3 ã®ã½ã¼ã¹ãèªãã§ã¦åºã¦ããã
ãããã
ã¾ã
ããã§å ¨ç¶ãããã§ããã
my $code = sub {1 + shift }; print $code->(1);
æåå or CodeRef ãæ¥ããããªå ´åã¯ä¾¿å©ããã
$obj->$code # $code is code(or simbolic) reference
ã¿ãããª
ãããã