Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Operators and context

12 views
Skip to first unread message

Deborah Ariel Pickett

unread,
Mar 12, 2003, 8:03:14 PM3/12/03
to perl6-l...@perl.org
Sort of a rehash on an old topic, but there's new stuff now with A6.

Mike Lazarro had been making a list of all the operators that Perl6 has.
The latest version I could find was Take 6 (at
http://archive.develooper.com/perl6-l...@perl.org/msg12130.html).

So, my questions:

1. Is there a more recent version of this list?

2. Perhaps this list ought to be expanded to specify how the operators
relate to context (e.g., C<+> applies numeric context to LHS and RHS).
I'm happy to give this a go, but I'd prefer the most recent operator
list first.

3. Speaking of context, what's the complete tree of contexts now?
Am I missing anything from this? Are ArrayRef and HashRef et al still
needed, or are we going away from the %{...} notation for dereferencing
a hash?


Type context
|
+--- Scalar
| |
| +--- Bool
| |
| +--- Num
| | |
| | +--- Int
| |
| +--- Str
| |
| +--- Ref
| |
| +--- HashRef
| |
| +--- ArrayRef
| |
| +--- CodeRef
| |
| +--- ScalarRef
|
+--- List
| |
| +--- (lazy and eager?)
|
+--- Void

(Is there a Pair context? PairRef? My guess is no.)


What about other, orthogonal, context-like things?
Lvalue/Rvalue (i.e., do to with C<=>)?
Binding/Nonbinding (i.e., to do with C<:=>)?


--
Debbie Pickett http://www.csse.monash.edu.au/~debbiep deb...@csse.monash.edu.au
"Have you ever seen anything so wonderful in your entire life?" "Wow, cool!
But, err, what is it?" "I don't know, but I bet Scuttle will." - _The Little
Mermaid_

Michael Lazzaro

unread,
Mar 12, 2003, 8:44:04 PM3/12/03
to Deborah Ariel Pickett, perl6-l...@perl.org
On Wednesday, March 12, 2003, at 05:03 PM, Deborah Ariel Pickett wrote:
> Sort of a rehash on an old topic, but there's new stuff now with A6.
>
> Mike Lazarro had been making a list of all the operators that Perl6
> has.
> The latest version I could find was Take 6 (at
> http://archive.develooper.com/perl6-l...@perl.org/msg12130.html
>
> So, my questions:
>
> 1. Is there a more recent version of this list?

Nope, I think that version is still good. There will be the addition
of the piping ops <== and ==>, and I'm not sure if (a) the Unicodeness
of >>op<< was ever decided upon, and (b) whether there's still an
>>op<< vs. <<op>> issue.

Note also that some of the things may or may not be "real" operators,
but those should all be clearly marked in that version.

> 2. Perhaps this list ought to be expanded to specify how the operators
> relate to context (e.g., C<+> applies numeric context to LHS and RHS).
> I'm happy to give this a go, but I'd prefer the most recent operator
> list first.

It'll be huge, but needs to be done, that's for sure. I'd certainly be
happy if you gave it a shot!

> 3. Speaking of context, what's the complete tree of contexts now?
> Am I missing anything from this? Are ArrayRef and HashRef et al still
> needed, or are we going away from the %{...} notation for dereferencing
> a hash?

A6 implies that there will be a knowable context for every type, so
your type-context tree probably looks nearly identical to the P6 type
hierarchy. But what that full type tree is, I dunno. :-) We left it
hanging...

-- Is a C<num> a C<Num>, or is a C<Num> a C<num>?
-- Is an C<int> a C<num>, or are they both subclasses of C<numeric>?
-- Are things like C<HashRef> actually called C<Ref::Hash> or similar?
-- Is there a difference between C<Array> and C<List> context?
-- etc.

We also talked on-list about whether 'void' could be considered a type,
but nothing came out of it. So this is definitely an area that needs
some serious help...

> Type context
> |
> +--- Scalar
> | +--- Bool
> | +--- Num
> | | +--- Int
> | +--- Str
> | +--- Ref
> | +--- HashRef
> | +--- ArrayRef
> | +--- CodeRef
> | +--- ScalarRef
> +--- List
> | +--- (lazy and eager?)
> |
> +--- Void
>
> (Is there a Pair context? PairRef? My guess is no.)

(There's also Object, Code, and all the others in A6, approx. page 8.)

MikeL

0 new messages