David Green wrote:
> It is kind of comfortable. Which is why I think I'd like to keep the
> redundant nth (if we have "first" and "last"), aka 'th (where nth($i)
> and $i'th are just pre- and postfixed versions of each other).
Especially important since there's a potential ambiguity problem bet
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Luke Palmer) wrote:
>sub wn($n) { $n ?? wn($n-1)+1 :: $w }
>$w2 = 0... + wn«0...;
>assert($w2 == $w*2);
>Just think of the possibilities! :-)
Hm. Needs more Unicode. =)
>Seriously though, putting 1st, 2nd, nth, etc. in the langua
On 2004/9/04, [EMAIL PROTECTED] (Larry Wall) wrote:
>Yow. Presumably "nth" without an argument would mean the last. So
>@ints[1st..nth]
>means
>@ints[*]
Yeah, I was thinking something like that. And if the arg is an actual
array, maybe it returns the max dimension(s)? I think you'd ge
David Green writes:
> The actual issue is how to distinguish cardinal numbers from ordinals,
> right? So if we want ordinal numbers, why not use ordinals?
While we're here, I think perl should understand ordinals
(http://mathworld.wolfram.com/OrdinalNumber.html), too. The syntax is
quite ready
On Sat, 4 Sep 2004, Juerd wrote:
> John Williams skribis 2004-09-03 23:06 (-0600):
> > > (A and Z)
> > I think I'd prefer alpha and omega.
>
> Why not use Cyrillic or Korean or the secret code alphabet we used in
> school?
I meant the actual words "alpha" and "omega", because they're like A and Z
On Sat, 4 Sep 2004, David Green wrote:
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Larry Wall) wrote:
> >I'm still thinking A is the first one and Z is the last one. Someone
> >talk me out of it quick.
>
> The actual issue is how to distinguish cardinal numbers from ordinals,
> right?
On Sat, Sep 04, 2004 at 08:30:27AM -0600, David Green wrote:
: I actually found things I liked in pretty much all the suggested
: alternatives, but none of them reached out and grabbed me by the throat
: the way "nth" did. It just seems more Perlish.
Yow. Presumably "nth" without an argument w
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Larry Wall) wrote:
>I'm still thinking A is the first one and Z is the last one. Someone
>talk me out of it quick.
Just think of all the trouble it would cause in the summaries:
'Meanwhile, in perl6-language, there was much discussion about Z.
John Williams skribis 2004-09-03 23:06 (-0600):
> > (A and Z)
> I think I'd prefer alpha and omega.
Why not use Cyrillic or Korean or the secret code alphabet we used in
school?
I don't like using letters for array indexes, but if they're used,
please keep it ascii :)
Juerd
On Fri, Sep 03, 2004 at 11:03:03PM -0500, Rod Adams wrote:
> If you insist on using A and Z, at least make them \A and \Z, to give a
> stronger visual cue that something different is happening.
Some other ideas ...
^A..^Z Too confusing with $^A and $^Z ?
^A..^? Well, if control
> If you insist on using A and Z, at least make them \A and \Z, to give a
> stronger visual cue that something different is happening.
I think I'd prefer alpha and omega.
Or maybe turn my previous suggestion around and make first and last
special constants. Then say:
@a[ first .. last but 1 ]
Larry Wall wrote:
I'm still thinking A is the first one and Z is the last one. Someone
talk me out of it quick.
I had thought about A and Z before my previous post. I dismissed it for
two reasons:
1) Using Alphas as an index for something that should be numeric can be
very confusing. Especially
Larry Wall wrote:
> On Fri, Sep 03, 2004 at 06:31:49PM -0700, Jonathan Lang wrote:
> : I wonder if this notion of contextualizing a method's signature could
> : be generalized... I could see a case for treating most methods as if
> : the expressions in each parameter were being evaluated within th
On Fri, Sep 03, 2004 at 08:19:11PM -0600, John Williams wrote:
: > I think we just need something really short and unconfusing for the
: > commonest cases,
:
:@a[ 42 ; -1 but last ]
:
: That reads pretty well, no?
:
: Maybe the other end isn't quite as good:
:
: @a[ 1 but first .. -2 but
> I think we just need something really short and unconfusing for the
> commonest cases,
@a[ 42 ; -1 but last ]
That reads pretty well, no?
Maybe the other end isn't quite as good:
@a[ 1 but first .. -2 but last ]
Hmm. Should "-1 but last" or "0 but last" be the last element?
~ John Wil
On Fri, Sep 03, 2004 at 06:31:49PM -0700, Jonathan Lang wrote:
: I wonder if this notion of contextualizing a method's signature could be
: generalized... I could see a case for treating most methods as if the
: expressions in each parameter were being evaluated within the caller's
: class:
:
:
Larry Wall wrote:
> Arrays with explicit ranges don't use the minus notation to count from
> the end. We probably need to come up with some other notation for the
> beginning and end indexes. But it'd be nice if that were a little
> shorter than:
>
> @ints.shape[0].beg
> @ints.shape[0
17 matches
Mail list logo