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

But, if hashes could perform actions (ala %hash->keys vs. keys %hash), you would consider them objects, right?

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re4: evolving an OO solution for a bitstream

Replies are listed 'Best First'.
Re: evolving an OO solution for a bitstream
by Abigail-II (Bishop) on Oct 21, 2003 at 14:23 UTC
    It depends on your definition of objects whether you call something an object due to the syntactic sugar of how to place a method call. Personally, I don't care about the syntactic sugar of whether the method call goes before the object or after.

    For me, objects are instances of classes. A %hash isn't an instance of a class. I can't subclass it. There's no "HASH" class to play around with.

    Now, granted, OO is more a state of mind than syntax. But when acting on data, some object must be present somewhere. And one must stretch the definition of OO to utter uselessness to consider

    my $bitstr = BitStream::get_bits(128);
    to be anywhere near OO. There's no object in sight here, no matter how hard you look. Let alone there's any of Perl's OO machinery getting involved here (there won't be a lookup for a 'get_bits' method in @BitStream::ISA classes, if 'get_bits' wouldn't be defined in the BitStream package for instance).

    Abigail