NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
free memoize, perhaps (Score:2)
What happens if you write name(5) and there is a name array that only has 4 elements but there is also a name function?
If it automatically switches to using the function if there is no element at the requested index then you get memoize for free!
fibonacci(n) {
if( n < 2 ) {
fibonacci(n) = 1
else {
fibonacci(n) = fibonacci(n-1) + fibonacci(
Would be nice (Score:1)
Unfortunately, that's not how it works (or at least, I've never seen that effect). It binds to the function earlier then that, so you would probably get an error about the index being out of bounds or something.
My guess is that the name(5) will autovivify and return a value of 0. I need to test this though.
Andrew Whitworth