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 having

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

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

Re: Subroutine IMC example with problem

2002-12-06 Thread gregor
Leo -- OK. I'll have a look at a single outer .sub ... .end, and implementing subs with regular labels along with the .param stuff. If .sub ... .end bracket not a subroutine, but a unit of compilation (module?), then shouldn't we make the name reflect the purpose? BTW, what is the difference

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 Cint 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;

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 to work

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

Re: [CVS ci] imcc syntax change

2002-12-06 Thread Leopold Toetsch
Gopal V wrote: iANY(add, R3(r0,r1,r2)) Better use INS (the public interface of above functions) Thanks, a shared library implementation of such a thing is what I'm looking for ... I'll take a look at doing that ... WOuld it help to split imcc.y into main/parser/parser_utils or are you

Re: Subroutine IMC example with problem

2002-12-06 Thread Leopold Toetsch
[EMAIL PROTECTED] wrote: Leo -- If .sub ... .end bracket not a subroutine, but a unit of compilation (module?), then shouldn't we make the name reflect the purpose? A thing compiled in one piece ist mostly a subroutine. BTW, what is the difference between .sym and .local? UTSL ;-)

IMCC puzzle

2002-12-06 Thread gregor
Leo -- Here is a simple Jako test program, which exercises the assignment syntax: var int a, b, c; var num d, e; var str f, g; a = 5; a = b = c = 5; d = 3.14; d = e = 3.14; f = Howdy; f = g = Howdy; a = b; a = b = c; Here it is compiled to IMC: .sub __MODULE__

Re: IMCC puzzle

2002-12-06 Thread Aaron Sherman
On Fri, 2002-12-06 at 10:40, [EMAIL PROTECTED] wrote: set N0, 3.14 set N0, 3.14 set N0, 3.14 I don't understand how d and e both become N0, nor how both f and g become S0. a, b, and c all seem to get their own registers. Is there some

Re: Subroutine IMC example with problem

2002-12-06 Thread gregor
Leo -- If .sub ... .end bracket not a subroutine, but a unit of compilation (module?), then shouldn't we make the name reflect the purpose? A thing compiled in one piece ist mostly a subroutine. I disagree. A think what is most often compiled in one piece is a file, with a combination

Re: Subroutine IMC example with problem

2002-12-06 Thread Leopold Toetsch
[EMAIL PROTECTED] wrote: Leo -- If .sub ... .end bracket not a subroutine, but a unit of compilation (module?), then shouldn't we make the name reflect the purpose? A thing compiled in one piece ist mostly a subroutine. I disagree. A think what is most often compiled in one piece is a

Re: IMCC puzzle

2002-12-06 Thread Leopold Toetsch
Aaron Sherman wrote: On Fri, 2002-12-06 at 10:40, [EMAIL PROTECTED] wrote: Looks like the first stages of constant-folding to me, no? No, but constant folding is done anyway. Both 3.14 are one constant loation. The constant folding may simply not deal with integers yet No,

Re: IMCC puzzle

2002-12-06 Thread Leopold Toetsch
[EMAIL PROTECTED] wrote: Leo -- Here is a simple Jako test program, which exercises the assignment syntax: Here it is compiled to IMC: [ Q/A intersparsed in imcc code for clearness ] .sub __MODULE__ .local int a # var int a;

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

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 that

Re: [CVS ci] imcc syntax change

2002-12-06 Thread Gopal V
If memory serves me right, Leopold Toetsch wrote: WOuld it help to split imcc.y into main/parser/parser_utils or are you doing this anyway? yes pushing some code from imcc.y into a seperate file is what I had in mind ... But have not got to that yet ... Was curious about the following lines

Re: [CVS ci] imcc syntax change

2002-12-06 Thread Leopold Toetsch
Gopal V wrote: If memory serves me right, Leopold Toetsch wrote: WOuld it help to split imcc.y into main/parser/parser_utils or are you doing this anyway? yes pushing some code from imcc.y into a seperate file is what I had in mind ... But have not got to that yet ... Ok, than I'll

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 Cclassify. I worry that Cclassify sounds too much like something class-related, and would confuse people. What

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

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

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

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

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 Cpart). Segregate (cseg) 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

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: 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,

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.174.162 :

Re: purge: opposite of grep

2002-12-06 Thread Me
Michael said: I worry that Cclassify 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 object

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: 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 rather

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

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 else hated it :) I

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 internally

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

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: excessive use

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 internally

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 internally

Re: Stringification of references and objects.

2002-12-06 Thread Mr. Nobody
Sent to the wrong list. Ignore, please. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

Re: logical_not issue

2002-12-06 Thread Dan Sugalski
At 5:47 PM -0500 12/3/02, David Robins wrote: On Tue, 3 Dec 2002, Dan Sugalski wrote: At 4:29 PM -0500 12/3/02, David Robins wrote: Enlightenment appreciated as always. This is something that'll come up with perl 6 reasonably soon as well. The solution for us is to have truth and falsehood

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) : :g/re/p

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

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.

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: logical_not issue

2002-12-06 Thread Alex Gough
[Fri, Dec 06, 2002 at 05:01:21PM -0500: Dan Sugalski] At 5:47 PM -0500 12/3/02, David Robins wrote: On Tue, 3 Dec 2002, Dan Sugalski wrote: - create immutable true and false PMCs That's fine. - have not P0, P1 set P0 to $1-get_bool ? true : false Sure, that works. I can't think of

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

Re: purge: opposite of grep

2002-12-06 Thread Damian Conway
ralph wrote: I worry that Cclassify 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 Cpart very much as a name

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 regexen

IMCC and locals/lexicals

2002-12-06 Thread gregor
Leo -- Here's a Jako snippet: var int x = 5; { var int x = 3; print x; } print x A naiive translation to imcc might be: .sub _foo .local int x x = 5 .local int x x = 3 print x print x .end but (of course) that leads to an x already defined error. I was hoping

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 = Sun Mon Tue Wed Thu Fri Sat[$day%7]; DC both work correctly. not to defend 1 based arrays but all