in reply to Re^3: How will you use state declared variables in Perl6?
in thread How will you use state declared variables in Perl6?

That's currently specced as "is cached" though I don't believe it's implemented yet. However, even after it's implemented, it's not going to be smart enough from the type signature to know whether an incoming parameter is sparse or dense, and for something like fibonacci an array is going to provide a faster memo cache than a hash is. Maybe the memoizing code can be smart enough to figure that out heuristically, but that's not a sure thing at this point.
  • Comment on Re^4: How will you use state declared variables in Perl6?

Replies are listed 'Best First'.
Re^5: How will you use state declared variables in Perl6?
by Juerd (Abbot) on Nov 06, 2006 at 09:32 UTC

    I have to admit that I'm dreaming of a code profiler that also tries some optimization strategies, and picks the best for your program. Memoization is already heavily parametrized, and I expect the same things to be possible with "is cached". Perhaps "use a dense array" can be communicated in an argument passed to "is cached"?

    Juerd # { site => 'juerd.nl', do_not_use => 'spamtrap', perl6_server => 'feather' }