On Jul 2, 2009, at 4:12 PM, Chris Prather wrote:

On Thu, Jul 2, 2009 at 3:59 PM, Hans Dieter Pearcey<h...@pobox.com> wrote:
On Thu, Jul 02, 2009 at 03:32:54PM -0400, Stevan Little wrote:
The result is that we would have something like this:

has foo => (traits => [ 'Basic::ArrayRef' ], isa => ArrayRef, ...);

  has web_hits => (traits => [ 'Pattern::Counter' ], ...);

As long as the traits are below the right Moose::*::*:: namespace we
should be good.

Do not forget to distinguish between full names
(Moose::Meta::Attribute::Trait::whatever) and short names
(register_implementation).

It may be reasonable for 'ArrayRef' to be the shortname but 'DataType::ArrayRef'
to be the namespace under Moose::Meta::Attribute::Trait.

DataStructure:: is fine if the registerd version doesn't require
typing DataStructure:: every time ... that said Structure:: is I think
enough for Structural things.

Queue / Stack are stuck into DataStructures in CS classes but I don't
see them as being any more or less structural than a Counter which is
really a monotonic variable ... or a snapshot of a vector ... or ....
the fact is that a Queue or a Stack is a List with pre-defined
operations you can perform upon it (push/pop and enqueue/dequeue) this
is why I put them into the pattern category rather than the Data
Structure one ... despite what my CS text books might have claimed.

Very good point actually.

I think we should split the categories by their intentions ...

  Structural - ArrayRef, HashRef, Number, etc ...

  Behavioral - Counter, Queue, Stack, Buffer, etc ...

Now, you could easily argue all around this and blah blah blah (I WANT TO PAINT THE BIKESHED RED!). But what I am proposing is that we draw *our own* distinctions, complete with reasoning to support. And let me start the first wave of bullshit here ...

Structural items are ones for whom the underlying value type is the key focus. ArrayRef describes the actual data structure used and Number the actual value type used. The operations supplied for these Structural items are basically the core operations that perl supports out of the box (with maybe a few additions for convenience).

Behavioral items are one for whom the behavior of the item is the key focus. Counter is obvious. The Stack item is less obvious unless you look at it as an ADT (Abstract Data Type) and realize that it really describes a data structure whose internal implementation is irrelevant as long as it provides an expected set of behaviors.

Yes, these lines are blurry. Yes, you could easily argue that ArrayRef fits the Behavioral definition and Stack fits the Structural. But who cares, I think we can make our own distinctions and as long as we remain consistent then all the haters can just f*ck off ;)

/me throws the mic down and walks off stage ...

- Stevan






















Reply via email to