in reply to Re: Re: evolving an OO solution for a bitstream
in thread evolving an OO solution for a bitstream

Well, for me shoving procedures into special blocks just for the sake of static variables seems a bit cumbersome.

As compared to what? And does whatever you would compare against allow for statics to be shared amongst a variety of subs? Using the nesting feature of blocks you can set up all kinds of data relationships between subs. (However I admit that I have a Pascal background and nesting subroutines comes naturally.)

Why isn't Bitstream::new a good way of constructing an object ?

Because the implementor of Bitsteam might just go and reorganize eveything so that Bitstream doesnt have its own new, but rather inherits it from some other class, perhaps a File::Stream or more realistically IO::File. And then all of a sudden your code breaks. The point is that

Package::subroutine("is a procedure call which doesn't search \@ISA"); Package->method("is a method call which does search \@ISA");

I mean, you never know what your other personality is going to do when you aren't looking.
:-)


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi