Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-24 Thread Jonathan Lang

Perhaps it's better to think of '@' and '@@' as working with different
contexts.  S02 says that there are three main contexts (void, scalar,
and list); that scalar context has a number of "sub-contexts"
(boolean, integer, number, and string), and that list context has a
number of sub-contexts based on the container type.  The difference
between '@' and '@@' seems to be 'list context' vs. 'lisp context', as
it were - i.e., whether or not nested lists should be flattened.  How
this maps to required roles, I'm still not sure.

--
Jonathan "Dataweaver" Lang


Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-24 Thread Jonathan Lang

Darren Duncan wrote:

Jonathan Lang wrote:
>I see no mention of C<@@x> in this section.  I would assume that
>C<@@x> may be bound to any object that does the C
>role, with a note to the effect that the C role does
>the C role (and thus anything that C<@x> may be bound to,
>C<@@x> may also be bound to).

I would argue that "multi-dimensional" is too generic a name for what
you describe.  In particular, I wouldn't say that something with that
name "does positional", at least in a conventional sense.


...another reason to consider my more recent suggestion of replacing
'Positional', 'Associative', etc. with 'sigil:<@>', 'sigil:<%>', and
so on.  '@@x' would then bind to any object that does 'sigil:<@@>'.


If we have a multidim role, don't make it do positional.  Those can
only be combined on a case by case basis.  If you do make multidim
positional, then you might as well say that every type does ordered,
because that makes as much sense.


I suggested this because anything that can be bound to '@@' can also
be bound to '@'; this implies to me that 'sigil:<@@>' does
'sigil:<@>'.  That said, you have a point, in that '@@' vs. '@' is a
strange dog; an object that is bound to '@@' behaves differently than
one that's bound to '@', which would not be the case if we relied
solely on something to the effect of 'sigil:<@@> does sigil:<@>' to
handle matters.

--
Jonathan "Dataweaver" Lang


Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-24 Thread Darren Duncan

At 4:00 PM -0700 5/23/07, Jonathan Lang wrote:

I see no mention of C<@@x> in this section.  I would assume that
C<@@x> may be bound to any object that does the C
role, with a note to the effect that the C role does
the C role (and thus anything that C<@x> may be bound to,
C<@@x> may also be bound to).


I would argue that "multi-dimensional" is too generic a name for what 
you describe.  In particular, I wouldn't say that something with that 
name "does positional", at least in a conventional sense.


For example, take a list of vectors, which is a multi-dimensional 
structure.  Does it make sense to say that a bunch of vectors can be 
ordered in a simple deterministic sense?  It doesn't make sense 
without context or parameters for the ordering.


If we have a multidim role, don't make it do positional.  Those can 
only be combined on a case by case basis.  If you do make multidim 
positional, then you might as well say that every type does ordered, 
because that makes as much sense.


And the latter is okay per se as long as we just know the purpose of 
such is to make a deterministic way to arrange a group of things into 
an array, but if it doesn't have meaning besides this, in the general 
case.  Same as all does Str or all does Bool et al.


-- Darren Duncan


Re: [svn:perl6-synopsis] r14401 - doc/trunk/design/syn

2007-05-23 Thread Jonathan Lang

[EMAIL PROTECTED] wrote:

 Sigils indicate overall interface, not the exact type of the bound
+object.  Different sigils imply different minimal abilities.


I see no mention of C<@@x> in this section.  I would assume that
C<@@x> may be bound to any object that does the C
role, with a note to the effect that the C role does
the C role (and thus anything that C<@x> may be bound to,
C<@@x> may also be bound to).

--
Jonathan "Dataweaver" Lang