Dave Rolsky wrote:
On Thu, 19 Feb 2009, Darren Duncan wrote:
So something like that. So Date and Time mean all Date|Time details,
and DateTime means all details of both. And Instant means any
combination of defined or not of said member attributes. And that's
actually why I advocated Instant as a name for that
more-broad-than-DateTime thing.
Is there a way in which a class which does the Date role could change
the type $.year so it was "Int|Undef"?
I'd prefer to leave the notion of an incomplete Date(|Time|DateTime) out
of the core, because it makes everything more complicated.
If, OTOH, I couldn't make OnCPAN6::DateTime::Incomplete do the DateTime
interface, that'd be a good argument for changing the core interface.
I was under the impression that Perl typed containers are allowed to hold Undef
by default, eg when you say "has Int $foo" that allows an Undef $foo by default.
So in that case I'm already getting what flexibility I want by default if that
is how the roles are declared. Correct me if I'm wrong. -- Darren Duncan