develooper Front page | perl.perl6.language | Postings from March 2005

Re: How are types related to classes and roles?

Thread Previous | Thread Next
Thomas Sandlaß
March 7, 2005 09:16
Re: How are types related to classes and roles?
Message ID:

another self-reply :)

I've added a little hack that classifies strings
into these areas 0 to 3 to illustrate my idea of
a type lattice on which composes the background
of the Perl 6 Type System. Pattern matching and
type systems are related but the question for
Perl 6 is: how exactly?

The topmost type Any has a very nice mnemonic: it's
the any-junction of all types that have no direct
supertype---their lub. Likewise there could be a None
that is the none-junction of all types that have no
subtype---their glb.

This means the Any actually depends on the loaded
program. If it only uses e.g. the unrelated types
A, B and C then Any is A|B|C. Likewise for programs
that implicitly handle strings and do numerics one
gets Any = Str|Num.

BTW, are Num and Int distinct or is there a
relation: Int is/does Num?

TSa (Thomas Sandlaß)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About