in reply to Re: Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?
in thread Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?

That all sounds great. So what's stopping you from building a module to implement buffers and putting it on CPAN right now? Surely it's possible to implement an elisp-style buffer system in Perl and/or C.

Update: I just reread your post and I see now that you're worried about localising global variables within buffers. Why? You don't mention anything about global variables in your explanation of why buffers would be great to have in Perl.

Perl 5 exposes its symbol tables and typeglobs to whatever manipulation your twisted mind can imagine. I'd be surprised if there was anything you really couldn't do with them!

-sam

  • Comment on Re: Re: Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?

Replies are listed 'Best First'.
Re: Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?
by jonadab (Parson) on Mar 29, 2003 at 10:43 UTC
    That all sounds great. So what's stopping you from building a module to implement buffers and putting it on CPAN right now? Surely it's possible to implement an elisp-style buffer system in Perl and/or C.

    The Perl5 object model isn't up to it. Yes, in theory it maybe could be done, but it's beyond my powers to do it. As far as doing it in C... I'll have to leave that to someone who can stand working in low-level languages.

    The Perl6 object model will bring it within reach, however. It was reading the Apocalypse articles that got me to thinking about doing it in Perl. I'm pretty sure I can put the basic pieces together in just a few weeks in Perl6, once Perl6 comes out.


    for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}
      Frankly, I doubt it. The Perl 5 object system is among the most flexible in the programming world. What exactly are you missing that you think you'd need to implement buffers?

      -sam

        The Perl 5 object system is among the most flexible in the programming world.

        Maybe if you compare it to C++ and Java. Sure, it's Turing-complete, so theoretically anything could be implemented in it. But I prefer to keep my sanity. The Perl6 object model will have a number of substantial improvements, and I'll be looking forward to that. Yes, I know it will be a while yet, but as the Apocalypsen roll in, more and more of the design (at least) will be clear. It may even be possible to start before Perl6 is released as such.


        for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}
Re: Re: Re: Implementing (elisp-like) buffers in Perl 6: how to do buffer-localisation of arbitrary package variables?
by jdporter (Paladin) on Mar 31, 2003 at 16:43 UTC
    ...you're worried about localising global variables within buffers. Why? You don't mention anything about global variables in your explanation of why buffers would be great to have in Perl.
    Yeah. And furthermore, is the concern about the truly-globals, like $_, $\, etc.? Or about package variables? If the latter, then putting each buffer in its own namespace might be the 90% solution, wrt the "global variable localization" problem.

    (I still think putting each buffer in its own thread might be the 100% solution, btw.)

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.