On Thu, May 12, 2005 at 11:52:38PM +0200, James Mastros wrote:
: Larry Wall wrote:
: > : If yes, then (1)[0] means the same as 1.[0] and 1.[0][0][0]. If no,
: > : (1)[0] is a runtime error just like 1.[0] -- i.e. unable to find the
: > : matching .[] multisub under Int or its superclasses.
: >
:
Larry Wall wrote:
> : If yes, then (1)[0] means the same as 1.[0] and 1.[0][0][0]. If no,
> : (1)[0] is a runtime error just like 1.[0] -- i.e. unable to find the
> : matching .[] multisub under Int or its superclasses.
>
> Maybe we should just let someone poke a Subscriptable role into some
> cl
On Wed, May 11, 2005 at 11:45:12AM -0500, Jonathan Scott Duff wrote:
> We're discussing the proper semantics of (1)[0] on #perl6. Here's
> where we're at so far:
>
> 1. specialise ()[] to parse as (,)[]
> 2. scalars are singleton lists, so ()[] naturally
> 3. make (1)[0] die horribly.
(1)[0] mean
On Thu, May 12, 2005 at 05:19:11AM +0800, Autrijus Tang wrote:
: Sure (and done). Now that #1 is eliminated, the question is now
: whether a simple scalar can be treated as a small (one-element) array
: reference, much like a simple pair can be treated as a small
: (one-element) hash reference.
:
On Wed, May 11, 2005 at 02:12:41PM -0700, Larry Wall wrote:
> On Thu, May 12, 2005 at 04:19:02AM +0800, Autrijus Tang wrote:
> : Hm? Under #2, no matter whether @foo is (1) or (1,2), the construct
> : (@foo)[0] would always means @foo.[0]. Not sure how the length of @foo
> : matters here.
>
> Te
On Thu, May 12, 2005 at 04:19:02AM +0800, Autrijus Tang wrote:
: Hm? Under #2, no matter whether @foo is (1) or (1,2), the construct
: (@foo)[0] would always means @foo.[0]. Not sure how the length of @foo
: matters here.
Tell you what, let's require P5's (...)[] to be translated to [...][],
so
On Wed, May 11, 2005 at 01:11:45PM -0700, Larry Wall wrote:
> On Wed, May 11, 2005 at 11:45:12AM -0500, Jonathan Scott Duff wrote:
> :
> : We're discussing the proper semantics of (1)[0] on #perl6. Here's
> : where we're at so far:
> :
> : 1. specialise ()[] to parse as (,)[]
> : 2. scalars are s
On Wed, May 11, 2005 at 11:45:12AM -0500, Jonathan Scott Duff wrote:
:
: We're discussing the proper semantics of (1)[0] on #perl6. Here's
: where we're at so far:
:
: 1. specialise ()[] to parse as (,)[]
: 2. scalars are singleton lists, so ()[] naturally
: 3. make (1)[0] die horribly.
:
: We a
On Wed, 2005-05-11 at 12:45, Jonathan Scott Duff wrote:
> We're discussing the proper semantics of (1)[0] on #perl6. Here's
> where we're at so far:
>
> 1. specialise ()[] to parse as (,)[]
> 2. scalars are singleton lists, so ()[] naturally
> 3. make (1)[0] die horribly.
It may or may not help,
My perspective from PDL is that "(1)[0][0][0]"..."[0]" should evaluate
to 1. The artificial distinction between a scalar and an array of
length 1 (in each dimension) is the source of endless hassles, and it's
a pretty simple DWIM to allow indexing of element 0 of any unused
dimension. That ma
On 5/11/05, Juerd <[EMAIL PROTECTED]> wrote:
> Jonathan Scott Duff skribis 2005-05-11 11:45 (-0500):
> > 1. specialise ()[] to parse as (,)[]
> > 2. scalars are singleton lists, so ()[] naturally
> > 3. make (1)[0] die horribly.
> > #2 implies that (1)[0][0][0][0] == 1
> > #1 means that (1)[0] == 1
Jonathan Scott Duff skribis 2005-05-11 11:45 (-0500):
> 1. specialise ()[] to parse as (,)[]
> 2. scalars are singleton lists, so ()[] naturally
> 3. make (1)[0] die horribly.
> #2 implies that (1)[0][0][0][0] == 1
> #1 means that (1)[0] == 1 and (1)[0][0] is an error
#1 also means that ($aref)[0]
Jonathan Scott Duff wrote:
What does p6l think? (What does @Larry think?)
I favor #3 as syntax error.
But note $TSa == all( none(@Larry), one($p6l) ) or so :)
--
TSa (Thomas Sandlaß)
13 matches
Mail list logo