Perl 6 Summary for 2005-08-02 through 2005-08-10
All~
Welcome to another summary, brought to you by chinese food. The
attentive among you will notice that this summary is a day late, because
I did not feel like doing it yesterday. If only I could do that at
work...
Perl 6 Co
On Wed, Aug 10, 2005 at 11:48:16PM +0200, TSa wrote:
: Only that ?$b is not marked is constant? Strange that is.
Straight out of the apocalypse--parameters default to constant.
Larry
On Wed, Aug 10, 2005 at 10:31:40PM +0200, TSa wrote:
> >my $x is typed;
> >$x = "123";
> >$x = length($x);
> >
> >Would be a type error. If it's in the dynamic world (as in Perl5),
> >that's just fine. Does that difference make sense to you?
>
> The question remains, when exactly doe
On Wed, 2005-08-10 at 21:00 -0400, Joe Gottman wrote:
>Will there be an operator for symmetric difference? I nominate (^).
That makes sense, although bear in mind that the existing Set module for
Perl 6, and the Set::Scalar and Set::Object modules for Perl 5 use % for
this (largely due to ove
> -Original Message-
> From: Luke Palmer [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 10, 2005 11:53 AM
> To: TSa
> Cc: Perl6 Language List
> Subject: Re: $object.meta.isa(?) redux
>
>
> A new development in perl 6 land that will make some folks very happy.
> There is now a Set
I wonder if infinite sets (recurrences) will be supported - then I'll
move all(ext/Recurrence, ext/Span, ext/Set-Infinite) to
Perl6::Container::Set::Ordered - cool.
- Flavio S. Glock
2005/8/10, Dave Whipp <[EMAIL PROTECTED]>:
> Luke Palmer wrote:
>
> > A new development in perl 6 land that will
HaloO,
Larry Wall wrote:
In this case it desugars to
my $pi is constant = 3;
:-)
In other words the assignment to a my turns into an ordinary assignment
that happens at runtime. Hopefully, since $pi is marked constant,
it could be optimized to a binding in many cases, but that's not the
[changing the subject line for the benefit of the summarizer ...]
On Wed, 10 Aug 2005, Larry Wall wrote:
And now some people will begin to wonder how ugly set values will look.
We should also tell them that lists (and possibly any-junctions)
promote to sets in set context, so that the usual way
On Wed, 10 Aug 2005, Luke Palmer wrote:
A new development in perl 6 land that will make some folks very happy.
There is now a Set role. Among its operations are (including
parentheses):
(+) Union
(*) Intersection
(-) Difference
(<=) Subset
(<) Proper subset
(>=) Sup
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote:
: According to S06:
:
: my $pi is constant = 3;
Perhaps the actual rewrite is
my $pi is constant({ 3 });
much like
state $where = $California;
is desugared to
state $where is first({$California});
or some such, a
HaloO Autrijus,
you wrote:
I think that's because you live in the static realm already. :)
Perhaps, but if yes it is an infinite one.
my $x is typed;
$x = "123";
$x = length($x);
Would be a type error. If it's in the dynamic world (as in Perl5),
that's just fine. Does that di
HaloO,
Larry Wall wrote:
It might be a mistake to call these isa relationships though. I really
only care about
Package does Object.
Module does Package.
Role does Module.
Class does Role.
OK, I've added that and the Set type in my little type lattice.
With your Object still
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote:
: According to S06:
:
: my $pi is constant = 3;
:
: Is this a special form?
I believe any assignment to a declarator is potentially a special form,
or we can't get assignment to "has" and "state" to work right.
: If yes, what do
On Wed, Aug 10, 2005 at 09:29:38PM +0200, TSa wrote:
> >Finally, it would get tedious to write them out by hand. So a lexical
> >"traits" pragma may help:
> >
> >{
> > # Entering the realm of referential transparency...
> > use traits < defined typed constant >;
> > my $x; # autom
HaloO,
Autrijus Tang wrote:
So I'm starting to write the inferencer. Immediately I encounter the
problem that every type can potentially contain "undef":
This is the reason why I've bounded Undef below Item disjoint with
Value in my type lattice. Of course all types are applicable as
type par
On Tue, Aug 09, 2005 at 10:55:05PM -0400, Stevan Little wrote:
: >So why not just use "describes"? Then maybe Object.isa(Foo) delegates
: >to $obj.meta.describes(Foo).
:
: I like that, but is it appropriate for subclasses as well?
Well, I suppose we could hedge it as part of a collaboration:
On Wed, Aug 10, 2005 at 11:24:05AM -0700, Larry Wall wrote:
> : My current understanding is that the typechecker considers IO to be of
> : Class type, not of IO type; the fact that IO.does(IO) is true is purely
> : an illusion created by special dispatch for .does.
>
> Well, that's what I thought
On Wed, Aug 10, 2005 at 11:24:02AM -0700, Dave Whipp wrote:
: Do Sets get a sigil?
Probably not. unicode
: I'd guess that % would be appropriate, because a
: hash is simply "Set of Pair" where the membership equivalence class is
: simply $^member.key. What syntax is used to associate the equiv
On Tue, Aug 09, 2005 at 06:32:52PM -0400, Stevan Little wrote:
> Now I realize that in perl 6 you can re-open classes and add methods to
> them. However this is not convenient for programmatic class generation.
Because of string eval, you mean? Well, some quasiquoting should
fix that, but let's
On Thu, Aug 11, 2005 at 01:24:11AM +0800, Autrijus Tang wrote:
: On Wed, Aug 10, 2005 at 10:12:45AM -0700, Larry Wall wrote:
: > We can get away with this in Perl 6 because bindings to positionals
: > happen lazily. So all we have to check for syntactically is that we
: > don't have a subsequent d
On Thu, Aug 11, 2005 at 01:34:34AM +0800, Autrijus Tang wrote:
: On Wed, Aug 10, 2005 at 10:25:05AM -0700, Larry Wall wrote:
: > I'll have to think about the rest of your proposal, but I was suddenly
: > struck with the thought that our "platonic" Class objects are really
: > forms of undef:
: >
:
Luke Palmer wrote:
A new development in perl 6 land that will make some folks very happy.
There is now a Set role. Among its operations are (including
parentheses):
(+) Union
(*) Intersection
(-) Difference
(<=) Subset
(<) Proper subset
(>=) Superset
(>)
According to S06:
my $pi is constant = 3;
Is this a special form? If yes, what does it desugar to?
my $pi is constant := 3;
my $pi is constant ::= 3;
If not a special form, should this work?
my $pi is constant;
$pi = 3;
If yes, should this pass compilation?
my $pi i
On Tue, Aug 09, 2005 at 10:54:54PM -0400, Stevan Little wrote:
: Let me make sure I understand this.
:
: Package is an Object.
: Module is a Package.
: Class is a Package.
: Role is a Package.
I think of it more like:
Package is an Object.
Module is a Package.
Class is a Module.
TSa <[EMAIL PROTECTED]> wrote:
> you wrote:
> > Perl 6 in its unannotated form is also (mostly) a typeless languages,
> > with only the five builtin types, much like Perl 5 is.
>
> Counting the sigil quadriga as 4, what is the fifth element?
> And $it.does(LookGood)?
$ @ % & ::
--
Brent 'Dax' R
On Wed, Aug 10, 2005 at 07:32:01PM +0200, TSa wrote:
> you wrote:
> >Perl 6 in its unannotated form is also (mostly) a typeless languages,
> >with only the five builtin types, much like Perl 5 is.
>
> Counting the sigil quadriga as 4, what is the fifth element?
& @ $ % ::
In Perl5, :: is replac
On Wed, Aug 10, 2005 at 10:25:05AM -0700, Larry Wall wrote:
> I'll have to think about the rest of your proposal, but I was suddenly
> struck with the thought that our "platonic" Class objects are really
> forms of undef:
>
> say defined IO; # prints 0
Hmm, bool::false stringifies to '0'?
Al
HaloO Autrijus,
you wrote:
Perl 6 in its unannotated form is also (mostly) a typeless languages,
with only the five builtin types, much like Perl 5 is.
Counting the sigil quadriga as 4, what is the fifth element?
And $it.does(LookGood)?
--
$TSa.greeting := "HaloO"; # mind the echo!
HaloO,
Luke Palmer wrote:
On 8/10/05, TSa <[EMAIL PROTECTED]> wrote:
Here is an example of a 2D distance method
role Point
{
has Num $.x;
has Num $.y;
}
method distance( Point $a, Point $b --> Num )
{
return sqrt( ($a.x - $b.x)**2 - ($a.y - $b.y)**2);
}
[..]
# This
I'll have to think about the rest of your proposal, but I was suddenly
struck with the thought that our "platonic" Class objects are really
forms of undef:
say defined IO; # prints 0
That is, we already have an object of type IO that doesn't really
have a value yet. And maybe that's the real
On Wed, Aug 10, 2005 at 10:12:45AM -0700, Larry Wall wrote:
> We can get away with this in Perl 6 because bindings to positionals
> happen lazily. So all we have to check for syntactically is that we
> don't have a subsequent declaration that changes the syntax from list
> to unary (or none-ary).
On Wed, Aug 10, 2005 at 10:47:47AM +0200, Juerd wrote:
: Larry Wall skribis 2005-08-09 16:19 (-0700):
: > So either something in the context tells us what "Foo" means, or
: > it will be taken as a list operator that hasn't been declared yet.
:
: Is there, by the way, a pragma to force predeclarati
On Wed, Aug 10, 2005 at 03:53:00PM +, Luke Palmer wrote:
: A new development in perl 6 land that will make some folks very happy.
: There is now a Set role. Among its operations are (including
: parentheses):
:
: (+) Union
: (*) Intersection
: (-) Difference
: (<=) Sub
On 8/10/05, TSa <[EMAIL PROTECTED]> wrote:
> Here is an example of a 2D distance method
>
>role Point
>{
> has Num $.x;
> has Num $.y;
>}
>method distance( Point $a, Point $b --> Num )
>{
> return sqrt( ($a.x - $b.x)**2 - ($a.y - $b.y)**2);
>}
>
> Now comes
So I'm starting to write the inferencer. Immediately I encounter the
problem that every type can potentially contain "undef":
my IO $x = open('/etc/passwd');
$x = undef;
$x.close;
This raises the runtime error:
*** Can't call method "close" on an undefined value.
The "undef" li
On 8/10/05, TSa <[EMAIL PROTECTED]> wrote:
> HaloO,
>
> Luke Palmer wrote:
> > On 8/9/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> >
> >>So why not just use "describes"? Then maybe Object.isa(Foo) delegates
> >>to $obj.meta.describes(Foo).
> >
> >
> > Hmm. We have a similar problem with the new c
HaloO Stevan,
you wrote:
I hope that .isa, .does and .meta are normal Method subtypes and *not*
slots on some implementation objects/structures.
I am not sure I understand this. Can you elaborate?
With pleasure!
OK, where do I start? ...
The origin of OO stems from the need to organize da
HaloO,
Luke Palmer wrote:
On 8/9/05, Larry Wall <[EMAIL PROTECTED]> wrote:
So why not just use "describes"? Then maybe Object.isa(Foo) delegates
to $obj.meta.describes(Foo).
Hmm. We have a similar problem with the new class-set notation.
These two things:
Did I miss something? What is
On Wed, Aug 10, 2005 at 06:03:18AM -0600, Luke Palmer wrote:
> On 8/10/05, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> > But it's an toplevel optimization, which is not applicable to
> > module authors. So I'd very much welcome a lexical pragma that
> > forces static binding of subroutine calls.
>
On 8/10/05, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> But it's an toplevel optimization, which is not applicable to
> module authors. So I'd very much welcome a lexical pragma that
> forces static binding of subroutine calls.
Yeah, but the whole point of not allowing that is so that you can
over
On Wed, Aug 10, 2005 at 10:47:47AM +0200, Juerd wrote:
> Larry Wall skribis 2005-08-09 16:19 (-0700):
> > So either something in the context tells us what "Foo" means, or
> > it will be taken as a list operator that hasn't been declared yet.
>
> Is there, by the way, a pragma to force predeclarati
On 8/9/05, Larry Wall <[EMAIL PROTECTED]> wrote:
> So why not just use "describes"? Then maybe Object.isa(Foo) delegates
> to $obj.meta.describes(Foo).
Hmm. We have a similar problem with the new class-set notation.
These two things:
$a.does(Foo);
Bar.does(Foo);
Mean two different thi
Larry Wall skribis 2005-08-09 16:19 (-0700):
> So either something in the context tells us what "Foo" means, or
> it will be taken as a list operator that hasn't been declared yet.
Is there, by the way, a pragma to force predeclaration of subs, to gain
compile time typo checking?
Juerd
--
http:
43 matches
Mail list logo