via arguments.caller. These allow anonymous recursion, such as in this implementation of the factorial: [1, 2, 3, 4, 5].map(function(n) { return (!(n > 1)) ? 1 : arguments.callee(n - 1) * n; }); Perl Starting with Perl 5.16, the current subroutine is accessible via the token, which returns a reference to the current subroutine, or undef outside a subroutine. This allows anonymous recursion, such as in the following implementation of the factorial: #!/usr/bin/perl use feature ":5.16"; print sub { my $x = shift; $x > 0 ? $x * ->( $x - 1 ) : 1; }->(5), "\n"; R In R, the current function can be called using Recall. For example, sapply(0:5, function(n) { if (n == 0) return(1) n * Recall(n - 1) }) It will not work, however, if passed as an argument to another function, e.g. lapply, inside the anonymous function definition. In this case, sys.function(0) can be used. For example, the code below squares a list recursively: (function(x) { if (is.list(x)) { lapply(x, sys.function(0)) } else { x^2 } })(list(list(1, 2, 3), list(4, 5))) References Recursion Articles with example R code