Re: RFC 319 (v1) Transparently integrate C<tie>
[email protected] (Alan Gutierrez) Fri, 29 Sep 2000 23:34:11 -0400 (EDT)
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Message-ID | <[email protected]> |
On 26 Sep 2000, Perl6 RFC Librarian wrote: > So, for example: > > package var; # main variable class > > # all the main Perl internal methods are defined, such > # as TIESCALAR, TIEARRAY, STORE, FETCH, etc > > package int; > use base 'var'; > > # ideas for RFC 303 > use optimize storage => 16, # how much space > growable => 1, # can we grow? > growsize => 8, # how much to grow by > integer => 1, # support ints > string => undef, # but not strings > float => undef, # or floats > promote => 'bigint'; # promote to class > # when outgrow > > # TIESCALAR, STORE, etc need not be redefined, since > # they could simply inherit from var's, but perhaps > # we could define special math ops per RFC 159. > > In this example, we've used the C<int> class to define several key > optimizations for Perl to use. Since C<var> is the grandfather class of > all variables, its C<STORE> and C<FETCH> methods can be used, which > actually do the internals of storing values and using the hints set by > the C<use optimize> pragma. The suggested C< use optimize > pragma is starting to grow many heads. C< use less > was such a simple little pragma, a general direction for the interpreter to take. Here it seems that the optimizations apply to the C< package int; > only. Are we suggesting that optimizations should be localized? Can I C< use optimize 'memory' > in one package and C< use optimize 'CPU' > in another? Do optimizations have block scope? I like C< use less >. I trust that perl6 will DWIM. Alan Gutierrez