Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: How will you use state declared variables in Perl6?

by TimToady (Parson)
on Nov 06, 2006 at 06:07 UTC ( #582381=note: print w/ replies, xml ) Need Help??


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?
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' }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-10-22 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls