Aside from C/C++, what other languages have pointers to functions (preferably web programming languages like Perl, PHP, Java/Script, etc...)? If they don't, is there any other way I can easily store a reference to them in something like an array?
Printable View
Aside from C/C++, what other languages have pointers to functions (preferably web programming languages like Perl, PHP, Java/Script, etc...)? If they don't, is there any other way I can easily store a reference to them in something like an array?
Don't think many languages support pointers the way C++ does. You can have references to subroutines in Perl though:
Code:sub f
{
...
}
$ref = *f{CODE};
&$ref; # calls f
# or anonymous subroutines
$ref = sub { ... };
&$ref;