Re: The last shall be last

2004-09-04 Thread Jonathan Lang
John Williams wrote: > Jonathan Lang wrote: > > The only place where it makes > > sense to wrap is when you define 0th as the final element, making it > > logical that 0th+1 == 1st and 1st-1 == 0th. > > I don't think 0th is a good name for the final element. I've never seen > it used for that. I

Re: The last shall be last (was: The first shall be first)

2004-09-04 Thread John Williams
On Sat, 4 Sep 2004, Jonathan Lang wrote: > The only place where it makes > sense to wrap is when you define 0th as the final element, making it > logical that 0th+1 == 1st and 1st-1 == 0th. I don't think 0th is a good name for the final element. I've never seen it used for that. I've only seen i

What Requires Core Support

2004-09-04 Thread chromatic
On Sat, 2004-09-04 at 18:44, John Siracusa wrote: Without commenting on the issue of single-file bundling... > To bring it home, I think packaging and distribution is important enough to > warrant a standard, core-supported implementation. > I think the "specially structured dir of files" and it

Re: The last shall be last (was: The first shall be first)

2004-09-04 Thread Jonathan Lang
David Green wrote: > Jonathan Lang wrote: > > If C<@foo[last+1]=$bar> is equivalent to C, what > > happens if you say C<@foo[last+2]=$bar>? While I like the notion that > > subtracting from first or adding to last takes you beyond the bounds > > of the list, you generally can't go more than one b

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread John Siracusa
On 9/4/04 7:31 PM, Simon Cozens wrote: > [EMAIL PROTECTED] (John Siracusa) writes: >> Anyway, what it'll give me is "official" support for this type of thing. > > Call me a crazy man, but I *like* the lack of official support. > > I actually count it as a Good Thing that perl can be made to do co

Re: The last shall be last (was: The first shall be first)

2004-09-04 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jonathan Lang) wrote: >No problem here, especially if C<0th> and C are synonyms - that is, >make "..., -4th, -3rd, -2nd, -1st, 0th, 1st, 2nd, 3rd, 4th, ..." be the >underlying mechanism, and define C and C as synonyms for >C<0th> and C<1st>. Ye

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread Jonathan Lang
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

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread David Green
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

Re: The last shall be last (was: The first shall be first)

2004-09-04 Thread Jonathan Lang
David Green wrote: > Anyway, if we can have "last", we should also have "first" (just for > people who don't mind all the extra typing). No problem here, especially if C<0th> and C are synonyms - that is, make "..., -4th, -3rd, -2nd, -1st, 0th, 1st, 2nd, 3rd, 4th, ..." be the underlying mechanism

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Luke Palmer
John Siracusa wrote: > Anyway, what it'll give me is "official" support for this type of thing. In > particular, the Perl 6 executable itself should know what to make of such a > specially formed dir tree" how to adjust @INC automatically for me, what to > run, etc.--in the same way that Perl 5 kn

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Simon Cozens
[EMAIL PROTECTED] (John Siracusa) writes: > Anyway, what it'll give me is "official" support for this type of thing. Call me a crazy man, but I *like* the lack of official support. I actually count it as a Good Thing that perl can be made to do cool stuff without Larry having to explicitly declar

Re: The last shall be last (was: The first shall be first)

2004-09-04 Thread David Green
On 2004/9/04, [EMAIL PROTECTED] (Jonathan Lang) wrote: (Nice Subject change, I almost missed it!) >Larry Wall wrote: > > Yow. Presumably "nth" without an argument would mean the last. > >If it means the last, why not just use C? Conflict with "last LOOP"? Hm, the context should be enough to d

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread John Siracusa
On 9/4/04 6:58 PM, Nicholas Clark wrote: > On Sat, Sep 04, 2004 at 05:59:18PM -0400, John Siracusa wrote: >> Anyway, it'd be nice if Perl 6 supported some sort of equivalent to Mac OS >> X's application wrappers: a dir tree containing all the files needed to run >> Your Wonderful Perl Program. To

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread David Green
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

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Nicholas Clark
On Sat, Sep 04, 2004 at 05:59:18PM -0400, John Siracusa wrote: > Anyway, it'd be nice if Perl 6 supported some sort of equivalent to Mac OS > X's application wrappers: a dir tree containing all the files needed to run > Your Wonderful Perl Program. To execute it, either run "YourApp.pmx/run" or >

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread John Siracusa
On 9/4/04 5:38 PM, Larry Wall wrote: > On Sat, Sep 04, 2004 at 08:17:36PM +0100, Piers Cawley wrote: > : John Siracusa <[EMAIL PROTECTED]> writes: > : > Ah ha, I didn't realize macros could override/replace existing control > : > structures. Okay, ship it! :) > : > : They'd be no fun if they coul

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Larry Wall
On Sat, Sep 04, 2004 at 08:17:36PM +0100, Piers Cawley wrote: : John Siracusa <[EMAIL PROTECTED]> writes: : > Ah ha, I didn't realize macros could override/replace existing control : > structures. Okay, ship it! :) : : They'd be no fun if they couldn't. There is one caveat, of course. Precompil

The last shall be last (was: The first shall be first)

2004-09-04 Thread Jonathan Lang
Larry Wall wrote: > 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 would mean the

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Piers Cawley
John Siracusa <[EMAIL PROTECTED]> writes: > On 9/3/04 6:45 PM, Damian Conway wrote: >> John Siracusa wrote: I don't see how we could prevent someone from clobbering the global definitions of PRE and POST to be no-ops if they wanted to. Seems to me that the whole point of putting th

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread Luke Palmer
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

Re: parameter contexts (was: Synopsis 9 draft 1)

2004-09-04 Thread John Williams
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

Re: Synopsis 9 draft 1

2004-09-04 Thread Larry Wall
: On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote: : : Honestly I don't see the point why all "normal" array usage should be : : slowed down just for the sake of some rare usage patterns. On Sat, Sep 04, 2004 at 08:48:54AM -0700, Larry Wall wrote: : Does it have to? Couldn't it ha

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread Adam D. Lopresto
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?

Re: Synopsis 9 draft 1

2004-09-04 Thread Nigel Sandever
On Fri, 3 Sep 2004 17:08:00 -0700, [EMAIL PROTECTED] (Larry Wall) wrote: > On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote: > : On Thu, 2 Sep 2004, Larry Wall wrote: > : > : > The argument to a shape specification is a semicolon list, just like > : > the inside of a multidimensional

Re: The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread Larry Wall
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

Re: Synopsis 9 draft 1

2004-09-04 Thread Larry Wall
On Sat, Sep 04, 2004 at 09:47:29AM +0200, Leopold Toetsch wrote: : John Williams <[EMAIL PROTECTED]> wrote: : : > What happens when the Pascal programmer declares : : > my int @ints is shape(-10..10); : : Should that really all be in core? Why not let the user create his own : derived array

Re: sub signatures without parens?

2004-09-04 Thread Larry Wall
On Sat, Sep 04, 2004 at 03:34:21PM +0200, Juerd wrote: : for, while, given, loop, etcetera can all be used without parens. Are : the parens around the parameter specification still required? If so, : why? In other languages it may make sense because parens are required : when calling functions too,

The first shall be first (was "Re: parameter contexts (was: Synopsis 9 draft 1)")

2004-09-04 Thread David Green
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.

sub signatures without parens?

2004-09-04 Thread Juerd
for, while, given, loop, etcetera can all be used without parens. Are the parens around the parameter specification still required? If so, why? In other languages it may make sense because parens are required when calling functions too, but in Perl, they're not. sub foo $foo, [EMAIL PROTECTED] {

Re: Synopsis 9 draft 1

2004-09-04 Thread Sean O'Rourke
At Fri, 3 Sep 2004 17:08:00 -0700, [EMAIL PROTECTED] (Larry Wall) wrote: > > On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote: > : If not, does @ints[-1] mean the element with index -1 or the last element? > > The element with index -1. Arrays with explicit ranges don't use the >

Re: Synopsis 9 draft 1

2004-09-04 Thread Eirik Berg Hanssen
Larry Wall <[EMAIL PROTECTED]> writes: > On Fri, Sep 03, 2004 at 05:45:12PM -0600, John Williams wrote: > : What happens when the Pascal programmer declares > : > : my int @ints is shape(-10..10); > : > : Does it blow up? > > No. > > : If not, does @ints[-1] mean the element with index -1

Re: Synopsis 9 draft 1

2004-09-04 Thread Leopold Toetsch
Larry Wall <[EMAIL PROTECTED]> wrote: > On Fri, Sep 03, 2004 at 11:41:05AM +0100, Tim Bunce wrote: >: (I'm not (yet) familiar with Parrot's ManagedStruct and UnManagedStruct >: types but there's probably valuable experience there.) > Quite likely. Well, *ManagedStruct is already working pretty w

Re: Synopsis 9 draft 1

2004-09-04 Thread Leopold Toetsch
John Williams <[EMAIL PROTECTED]> wrote: > What happens when the Pascal programmer declares > my int @ints is shape(-10..10); Should that really all be in core? Why not let the user create his own derived array that does what she wants? Honestly I don't see the point why all "normal" array

Re: parameter contexts (was: Synopsis 9 draft 1)

2004-09-04 Thread Juerd
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

Re: Synopsis 9 draft 1

2004-09-04 Thread Juerd
Larry Wall skribis 2004-09-03 17:08 (-0700): > The element with index -1. 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. @array.abs[0]; @array.abs[-1]; .abs woul