On Mon, Nov 25, 2002 at 07:46:57PM -0500, Bryan C. Warnock wrote:
: Should an explicit bool type be part of the language? If so, how should
: it work?  C<my bool $y = (0 but true)> storing only a truth property but
: no value makes little sense in the context of the larger language.  So
: does handling truth as something other than a property.  

Don't think of truth as a property--it's a predicate that can pay
attention to the property if it's defined.  But if there's no property,
truth is defined by the C<true> method on the class of the object.
Again, a property is just a singleton method override.

: > (3) Context.  How to determine it, how to force it.  Hypothesis: There 
: > is a one-to-one relationship between Type and Context, such that there 
: > is a context that matches every type, and a type that matches every 
: > context (except void).
: 
: Again...

Well, it is a good question.  We don't have a type for every context in
Perl 5, particularly for boolean and list context.  They just get mapped
onto existing scalar and array types.

: > (4) Typecasting.  How int <--> num, num <--> str, str <--> bool, etc.  
: > Generic typecasting rules: how to define user classes that can typecast 
: > to/from str, int, bool, etc.  This gets into Perl6 OO, but we may need 
: > to request some preliminary decisions before then, because the 
: > implications are substantial.
: 
: ....and again...

Typecasting may be a bad word.  We're not trying fib to ourselves about the
type of an object.  That's done with:

    $object.PRETEND_CLASS::method()

What we're really talking about is coercions or conversions.  Coercions
are multimethods if you count the return type as part of the signature.
But we certainly can specify that the syntax will involve the type
name functioning as a subroutine name.  int() makes an int, num()
makes a num, etc.  Provided we can solve the syntactic ambiguity I
mentioned in my other message.

: > Let's open these for discussion.  Questions/proposals/issues, anyone?
: 
: and again... what's the scope of p6d, and how does it differ from p6l?  

As far as I'm concerned, p6d and p6l just have different deliverables.
p6l is looking at the elephant from above, while p6d is looking at the
elephant from below.  But it's the same elephant.  (Unless it's a camel.)
Whatever the animal, figuring out the underside of it is, by definition,
not going to be a clean process.

Larry

Reply via email to