This Week in Perl 6, Through August 14, 2005
by Piers Cawley
|
Pages: 1, 2
Perl 6
Meta Object Protocols and $object.meta.isa(?)
Stevan Little is busy documenting the Perl 6 metamodel that he's implemented in Perl 5 and that Autrijus is busy porting to Haskell. He posted an overview to the list and asked for comment. There then followed lots of discussion. I think I understood some of it.
$object.meta.isa(?)
Redux
Stevan split the discussion of $object.meta.isa(?) off from the
earlier metamodel thread into a thread of its own and asked for comments once
more. Larry commented that "the Apocalypses are primarily intended to be
entertaining rather than factual." Also in this thread, Luke let slip that
there's now a Set role in Perl 6, which has the enormous advantage
of letting us specify argument types in a sensible way without having to
overload the junctions.
$obj.meta.add_method('foo'
=> ???)>
Stevan continued discussing the metamodel with a thread about the
add_method method. Autrijus was the only person with comments.
Proposed New Traits
Autrijus said that he'd started to write the inferencer and had immediately
run into the problem that every type can potentially contain
undef. He proposed adding an is defined trait, which
would cause a variable to immediately throw an exception if anyone attempted to
assign it an undefined value. He also proposed a typed trait, but
I was a little less clear on why this would be a good idea. I have to confess that I
didn't understand what Larry's reply was driving at, but that's okay, because
Autrijus did seem to understand it.
my
$pi is constant = 3
Autrijus wondered if an example of the is constant trait shown
in Synopsis 6 was a special form or a typo. At least, I think that's what he
was asking; I may be wearing my stupid head today, though. Larry thought it was
neither. I think. It seems there's more to constancy than meets the eye. (Just
ask any married couple.)
Typed
Type Variables (my Foo ::x)
Stuart Cook asked about the meaning of type annotations on type variables. Autrijus answered and Thomas Sandlaß agreed with him.
BEGIN
{...} and IO
Nicholas Clark commented on an earlier discussion of using IO in
BEGIN blocks, pointing out that this was just a specific case of
the more general problem of attempting to serialize things to bytecodes that
were simply unserializable. I reckon the trick of it will be to do such things
in INIT or possibly CHECK blocks (I can never
remember which way round those two go).
Generic Classes
Autrijus asked about generic classes, but nobody answered before the end of the summary week. Expect Matt to address this one in the next summary.
Acknowledgements, Adverts, Apologies, and Alliteration
I'm sorry to have to say this, but I don't think I have to apologize for anything this week. WorldCon was fun.
Everything Else
If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl.
Or, you can check out my website. Maybe now I'm back writing stuff I'll start updating it. There are also vaguely pretty photos by me.

