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?
This is a discussion on Pointers to functions in other languages within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Aside from C/C++, what other languages have pointers to functions (preferably web programming languages like Perl, PHP, Java/Script, etc...)? If ...
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;