Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Aren't you are describing an inheritance tree for variables? So you can map this onto Perl semantics by assuming each thing seen as a variable is really a pair of setter/getters. The current buffer's variable container then simply inherits from the global variable container. I can already half-imagine ways to do this with AUTOLOAD magic as I'm typing so as to automagically provide the setter/getter pairs you need. If you need arbitrarily nested buffers, it gets difficult in Perl5 as you'll have create packages on the fly and I'd generally stay away from that, but it shouldn't be hard in Perl6 if I'm not mistaken. If you don't, esp if you only need two levels, then it's fairly straightforward to implement even in Perl 5. I can elaborate further if desired. Makeshifts last the longest. In reply to Re: Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?
by Aristotle
|
|