Re: In defense of zero-indexed arrays.

2002-12-06 Thread Brian Ingerson
On 05/12/02 02:45 -0800, Michael G Schwern wrote: > I'm going to ask something that's probably going to launch off into a long, > silly thread. But I'm really curious what the results will be so I'll ask > it anyway. Think of it as an experiment. > > So here's your essay topic: > > Explain how

RE: Stringification of references and objects.

2002-12-06 Thread Brent Dax
Joseph F. Ryan: # >Why? Isn't the pretty form more generally useful? # > # # I don't think so; I'd think it to be annoying to have type # more code in order to specify a more cocise form; if I need # to dump a structure, I'd prefer to do it manually. I think it's useful to be able to say @arra

Re: Stringification of references and objects.

2002-12-06 Thread Joseph F. Ryan
Brent Dax wrote To tell you the truth, I don't consider arrayrefs references anymore. They're just Array objects that don't happen to be in @whatever symbols. I don't know if this is the official view, but that fits my brain better. So you're saying that classes should stringify to a pretty-pr

Re: Usage of \[oxdb] (was Re: String Literals, take 2)

2002-12-06 Thread James Mastros
On 12/05/2002 12:18 PM, Michael Lazzaro wrote: On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote: On 12/04/2002 3:21 PM, Larry Wall wrote: \x and \o are then just shortcuts. Can we please also have \0 as a shortcut for \0x0? \0 in addition to \x, meaning the same thing? I

Re: purge: opposite of grep

2002-12-06 Thread Miko O'Sullivan
On Fri, 6 Dec 2002, Damian Conway wrote: > The selector block/closure would, naturally, be called in C context > each time, so (again, as Larry pointed out) a boolean function would > naturally classify into two arrays. Though it might at first be a little > counterintuitive to have to write: OK,

Quick translation wanted

2002-12-06 Thread Simon Cozens
Is it clear how attributes accessors on objects are going to work yet? I need to say something along the lines of: sub new { my $class = shift; my ($name, $age) = @_; bless { name => $name, age => $age }, $class; } sub age { my $self=shift; $self->

Re: Quick translation wanted

2002-12-06 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Sender: [EMAIL PROTECTED] > From: Simon Cozens <[EMAIL PROTECTED]> > Date: 06 Dec 2002 14:54:43 + > Organization: Bethnal Green is PEOPLE! > X-Posted-By: 217.204.174.162 > > > Is it clear how attributes accessors on objects are going t

Re: purge: opposite of grep

2002-12-06 Thread Graham Barr
On Fri, Dec 06, 2002 at 09:33:14AM -0500, Miko O'Sullivan wrote: > For example, suppose I want to separate a list of people into people who > have never donated money and those who have. Assuming that each person > object has a donations property which is an array reference, I would want > to clas

Re: String Literals, take 3

2002-12-06 Thread John Williams
On Fri, 6 Dec 2002, Joseph F. Ryan wrote: > > What's wrong with single quoted here-docs? What's wrong is that the documentation team is trying to allow \qq[] there too, contradicting their own assertion that backslashes are not special in that context. > Don't forget that the backslash is already

Re: Stringification of references and objects.

2002-12-06 Thread Chris Dutton
On Friday, December 6, 2002, at 04:28 AM, Joseph F. Ryan wrote: Brent Dax wrote To tell you the truth, I don't consider arrayrefs references anymore. They're just Array objects that don't happen to be in @whatever symbols. I don't know if this is the official view, but that fits my brain bette

RE: Stringification of references and objects.

2002-12-06 Thread Brent Dax
Joseph F. Ryan: # Brent Dax wrote # # >To tell you the truth, I don't consider arrayrefs references # anymore. # >They're just Array objects that don't happen to be in @whatever # >symbols. I don't know if this is the official view, but that fits my # >brain better. # > # # So you're saying t

Re: purge: opposite of grep

2002-12-06 Thread Michael Lazzaro
On Thursday, December 5, 2002, at 07:55 PM, Damian Conway wrote: equally. The built-in would actually be doing classification of the elements of the list, so it ought to be called C. I worry that C sounds too much like something class-related, and would confuse people. What about C or someth

Re: Stringification of references and objects.

2002-12-06 Thread Michael Lazzaro
On Friday, December 6, 2002, at 01:28 AM, Joseph F. Ryan wrote: Array(0x1245AB) Personally, I like this format. It's succinct, informative, and tells you enough to do identity testing. I like it too, but I thought everyone else hated it :) I think people like it fine, but many people don't

Re: String Literals, take 3

2002-12-06 Thread Michael Lazzaro
On Friday, December 6, 2002, at 09:46 AM, Luke Palmer wrote: 3) allowing \qq[] in single-quoted here-docs. PRO: it's consistent with single-quotes CON: it contradicts the assertion that backslashes are not special in single quoted here-docs The problem is, as Larry said, that heredocs ar

Re: purge: opposite of grep

2002-12-06 Thread Dave Whipp
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > > Some of those might be appropriate (or just amusing). :-) I still like partition (or simply C). Segregate (c) might also work I notice everyone still want Int context for eval of the block: Pease don't forget about hashes. Is there such a thing as

Re: purge: opposite of grep

2002-12-06 Thread Tim Conrow
Michael Lazzaro wrote: I worry that C sounds too much like something class-related, and would confuse people. What about C or something? Decent thesaurus entries for include: assign, classify, comb, compartmentalize, discriminate, distribute, group, order, segregate, sift, winnow, amputate, c

Re: Quick translation wanted

2002-12-06 Thread Larry Wall
On Fri, Dec 06, 2002 at 08:44:23AM -0700, Luke Palmer wrote: : > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm : > Sender: [EMAIL PROTECTED] : > From: Simon Cozens <[EMAIL PROTECTED]> : > Date: 06 Dec 2002 14:54:43 + : > Organization: Bethnal Green is PEOPLE! : > X-Posted-By: 217.204.17

Re: purge: opposite of grep

2002-12-06 Thread Me
Michael said: > I worry that C sounds too much like > something class-related 'Classify' also seems wrong if some items are thrown away. I like 'part': (@foo,@bar) := part { ... } @source; Headed off in another direction, having a sub distribute its results like this reminds me of: ... -> .

Re: Quick translation wanted

2002-12-06 Thread Luke Palmer
> Date: Fri, 06 Dec 2002 11:15:20 -0800 > From: Larry Wall <[EMAIL PROTECTED]> > > As for constructor syntax, I suppose we might make use of the $. notation > like this: > > method new($.name, $.age) { > return $class.bless; > } Come to think of it, new is a class method, not an ob

Re: Quick translation wanted

2002-12-06 Thread Larry Wall
On Fri, Dec 06, 2002 at 12:27:31PM -0700, Luke Palmer wrote: : > Date: Fri, 06 Dec 2002 11:15:20 -0800 : > From: Larry Wall <[EMAIL PROTECTED]> : > : > As for constructor syntax, I suppose we might make use of the $. notation : > like this: : > : > method new($.name, $.age) { : > return $

Re: String Literals, take 3

2002-12-06 Thread Luke Palmer
> Date: Fri, 6 Dec 2002 10:16:20 -0700 (MST) > From: John Williams <[EMAIL PROTECTED]> > > 2) requiring balanced delimiters to be escaped, >PRO: it's consistent with non-balanced delimiter requirements >CON: you already can; don't force it those who don't want it I'll say no, agreeing with

Re: Stringification of references and objects.

2002-12-06 Thread Dan Sugalski
At 6:36 PM -0500 12/5/02, Joseph F. Ryan wrote: By default, references should not stringify to anything "pretty", they should stringifiy to something useful for debugging. Heck, even perl5 style should be fine. Not only is this handy, but also prevents problems with circular referencing data str

Re: Stringification of references and objects.

2002-12-06 Thread Larry Wall
On Fri, Dec 06, 2002 at 10:40:18AM -0500, Dan Sugalski wrote: : If an aggregate and a reference to an aggregate are going to behave : the same, which is what Larry's indicated in the past, then : stringifying a reference should be the same as stringifying its : referent. This is a bit of an ove

Re: String Literals, take 3

2002-12-06 Thread Larry Wall
On Fri, Dec 06, 2002 at 10:16:20AM -0700, John Williams wrote: : On Fri, 6 Dec 2002, Joseph F. Ryan wrote: : > : > What's wrong with single quoted here-docs? : : What's wrong is that the documentation team is trying to allow \qq[] : there too, contradicting their own assertion that backslashes are

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Damien Neil
On Thu, Dec 05, 2002 at 02:45:39AM -0800, Michael G Schwern wrote: > Explain how having indexes (arrays, substr, etc...) in Perl 6 start at 0 > will benefit most users. Do not invoke legacy. [1] Answer 1: Ignoring legacy, it won't. Answer 2: Because C uses 0-based indexes, Parrot is written in C

Re: In defense of zero-indexed arrays.

2002-12-06 Thread agent . secret
> 2002-12-05 10:45:39, Michael G Schwern <[EMAIL PROTECTED]> wrote: > I'm going to ask something that's probably going to launch off into a > long, silly thread. But I'm really curious what the results will be so > I'll ask it anyway. Think of it as an experiment. > > So here's your essay topic:

Re: purge: opposite of grep

2002-12-06 Thread Sean O'Rourke
On 5 Dec 2002, Rafael Garcia-Suarez wrote: > John Williams wrote in perl.perl6.language : > If you want good'ol Unix flavor, call it "vrep". Compare the ed(1) / > ex(1) / vi(1) commands (where 're' stands for regular expression, of > course) : > :g/re/p > :v/re/p Or, to follow the spirit r

Perl 6 and Set Theory

2002-12-06 Thread Luke Palmer
=head1 Perl 6 and Set Theory This document will introduce a new way of thinking about some Perl 6 constructs. In addition, it proposes some minor changes that would help this way of thinking be more consistent. These changes may make Perl 6 a better language in general, as a side effect. Even i

Re: Stringification of references and objects.

2002-12-06 Thread Piers Cawley
Michael Lazzaro <[EMAIL PROTECTED]> writes: > On Friday, December 6, 2002, at 01:28 AM, Joseph F. Ryan wrote: >>> Array(0x1245AB) >>> >>> Personally, I like this format. It's succinct, informative, and tells >>> you enough to do identity testing. >> >> I like it too, but I thought everyone el

Re: Stringification of references and objects.

2002-12-06 Thread Mr. Nobody
> This is a bit of an oversimplification. $foo and @foo do not always > behave the same, even if $foo and @foo refer to the same array object. > In particular, $foo doesn't behave like @foo in a list context. > Scalars must continue to behave like scalars in list context, even > if they're interna

Re: Stringification of references and objects.

2002-12-06 Thread Michael Lazzaro
On Friday, December 6, 2002, at 01:08 PM, Piers Cawley wrote: He notes that VisualWorks Smalltalk makes the distinction between 'displayString', for the user oriented stringification and 'printString', for the programmer oriented. One could imagine a scenario in which a user could accomplish an

Re: Usage of \[oxdb]

2002-12-06 Thread Nicholas Clark
On Fri, Dec 06, 2002 at 03:24:44PM +1100, Damian Conway wrote: > Larry was certainly in favour of it when he wrote A5 > (see under http://search.cpan.org/perl6/apo/A05.pod#Backslash_Reform). > Except the separators he suggests are semicolons: > > Perl 5 Perl 6 > \x0a\x0d

Re: Stringification of references and objects.

2002-12-06 Thread John Siracusa
On 12/6/02 4:41 PM, Michael Lazzaro wrote: > my PersonName $name = .new(...); > my FormalStr $s = $name;# "Dr. William P. Smith" > my InformalStr $s = $name;# "Bill" > > Whether that is good, bad, or indifferent I leave to the OO Police. I'm not even deputized, but I call foul: exces

Re: purge: opposite of grep

2002-12-06 Thread Sean O'Rourke
On Thu, 5 Dec 2002, Sean O'Rourke wrote: > On 5 Dec 2002, Rafael Garcia-Suarez wrote: > > John Williams wrote in perl.perl6.language : > > If you want good'ol Unix flavor, call it "vrep". Compare the ed(1) / > > ex(1) / vi(1) commands (where 're' stands for regular expression, of > > course) : > >

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Brad Hughes
Damien Neil wrote: On Thu, Dec 05, 2002 at 02:45:39AM -0800, Michael G Schwern wrote: Explain how having indexes (arrays, substr, etc...) in Perl 6 start at 0 will benefit most users. Do not invoke legacy. [1] Answer 1: Ignoring legacy, it won't. Bingo. Answer 2: Because C uses 0-based i

Re: purge: opposite of grep

2002-12-06 Thread Aaron Crane
Sean O'Rourke writes: > On Thu, 5 Dec 2002, Sean O'Rourke wrote: > > how 'bout "tang" for "Tog's A Negated Grep"? > > Gah. s/Tog/Tang/. Wouldn't that mean we had to rename grep to 'gnat'? ("Gnat's Not A Tang", presumably, never mind rot13 and reversal...) -- Aaron Crane * GBdirect Ltd. http:/

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Larry Wall
On Thu, Dec 05, 2002 at 02:45:39AM -0800, Michael G Schwern wrote: : I'm going to ask something that's probably going to launch off into a long, : silly thread. But I'm really curious what the results will be so I'll ask : it anyway. Think of it as an experiment. : : So here's your essay topic:

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Damian Conway
Larry wrote: : Explain how having indexes (arrays, substr, etc...) in Perl 6 start at 0 : will benefit most users. Do not invoke legacy. [1] How about, because I like it? You may, of course, see that as a legacy argument, depending on our relative ages... :-) A practical argument in its fav

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
ralph wrote: I worry that C sounds too much like something class-related 'Classify' also seems wrong if some items are thrown away. I like 'part': (@foo,@bar) := part { ... } @source; ralph and I don't often agree, but I certainly do in this case. I like C very much as a name for this buil

Re: Usage of \[oxdb]

2002-12-06 Thread Damian Conway
Nicholas Clark mused: I just had this thought - can I interpolate in there? Something like "\c[$(call_a_func())]" Why not just: "$(chr call_a_func()]" ??? Damian

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
Dave Whipp wrote: I notice everyone still want Int context for eval of the block: Pease don't forget about hashes. Is there such a thing as 'hashkey context'? I doubt it. Unless you count Str context. Perl6 is much better than Perl5 for naming parameters. Could we make the following work?

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
Michael Lazzaro wrote: How would you do something like: (@foo,@bar,@zap) := classify { /foo/ ;; /bar/ ;; /zap/ } @source; Since I don't understand what that's supposed to do, I probably *wouldn't* do something like it. What effect are you trying to achieve? Damian

RE: purge: opposite of grep

2002-12-06 Thread Brent Dax
Damian Conway: # > Also, can I return superpositions (sorry, junctions), to provide # > multiple classifications? Or would I return an array for that? # # A (dis)junction ought to work there. That sounds horribly scary... --Brent Dax <[EMAIL PROTECTED]> @roles=map {"Parrot $_"} qw(embedding reg

Re: In defense of zero-indexed arrays.

2002-12-06 Thread Uri Guttman
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> A practical argument in its favour is that it makes DC> circular-lists-via-modulo: DC> @list[++nextidx%7] = $nextval; DC> $day_name = <>[$day%7]; DC> both work correctly. not to defend 1 based arrays but all you have to