Re: Pike 7.4

2003-01-09 Thread Simon Cozens
[EMAIL PROTECTED] (Mr. Nobody) writes: > We can't use « or ». Not only are they impossible to type on some editors, > but they're different in CP437 (the DOS charset), Latin1, and UTF8. We've done this. -- I've looked at the listing, and it's right! -- Joel Halpern

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Damian Conway
Philip Hellyer wrote: Damian's proposal didn't say anything about array params. If I understood him correctly, then this should print "FOO" on standard out: my $foo = "FOO"; $foo ~> print; Correct. The opposite 'squiggly arrow' fiddles the indirect object, so perhaps this would pri

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Damian Conway
Jonathan Scott Duff suggested: > Oh, then we just need a syntax to split the streams. ... I know! > > @list ~| grep /bad!/ ~> @throw ~| grep /good/ ~> @keep; Unfortunately, that's already taken (it's the bitwise-OR-on-a-string operator). Fortunately that doesn't matter, since no extra bina

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Damian Conway
frederic fabbro wrote: I'm not even sure how that would parse, though that: > @keep <~ grep /good/ <~ @list ~> grep /bad!/ ~> @throw; > would go like: > ( @keep <~ grep /good/ <~ @list ) ~> grep /bad!/ ~> @throw; Correct, if <~ is indeed slightly higher precedence than ~> which is pro

Re: Variable Types Vs Value Types

2003-01-09 Thread Damian Conway
Rafael Garcia-Suarez asked: > Damian Conway <[EMAIL PROTECTED]> wrote: > >>There are in fact *two* types associated with any Perl variable > > How does it work regarding inheritance and polymorphism ? > E.g. consider > my @a is Set of Apple; > my @b is Basket of Fruit; > with Apple isa Fruit,

Re: Pike 7.4

2003-01-09 Thread Damian Conway
Chris Dutton wrote: For example, I'm struggling to see how one could use the [*] to do this: @names = «Gödel Escher Bach»; @ages = $today »-« %date_of_birth{@names} While I agree that hyper-operators are the better way to go(though I can see advantages either way), I was bored, s

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Damian Conway
Andy Wardley wrote: I also think this is semantically fabulous but syntactically slightly dubious. '~' reads 'match' in my book, Really? We don't have any trouble in Perl 5 with an = character being used in various unrelated operators: == comparison =assignment ~= match

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Trey Harris
In a message dated Thu, 9 Jan 2003, Damian Conway writes: > One *might* argue that <~ ought to be of higher precedence than ~> > (i.e. that invocants ought to be bound ahead of other arguments). > > If so, then: > >$foo ~> print <~ $*STDERR > > is really: > >$foo ~> print $*STDERR:

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Andy Wardley
Damian Conway wrote: > Really? We don't have any trouble in Perl 5 with an = character > being used in various unrelated operators: > > == comparison > =assignment > ~= match s/~=/=~/ > => comma > <= less than or equal to But these are all roughly related to the

Re: Array Questions

2003-01-09 Thread Damian Conway
Michael Lazzaro asked: OK, next question. Is _THIS_ possible? class FileBasedHash is Hash { ...stuff... }; my %data is FileBasedHash('/tmp/foo.txt'); Yes. Though we would need a syntax for specifying that string parameter for the generic C class. And, of course, a mechanism for constru

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Damian Conway
Mr. Nobody wrote: I don't like either of these operators. What's wrong with > > @out = sort map {...} grep {...} @a > > ? For a start, if these functions were to become (only) methods in Perl 6, it would have to be: @out = sort map grep @a: {...} : {...} :; And even if we do have

Re: Variable Types Vs Value Types

2003-01-09 Thread Peter Haworth
On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote: > At 7:29 PM -0700 1/7/03, John Williams wrote: > >Perhaps you could explain how the $0 object will work in your mind. > >A5 assert that $0 is a object, and it behaves as an array and a hash, > >depending on how you subscript it. Typeglobs are

Re: Variable Types Vs Value Types

2003-01-09 Thread John Williams
On Thu, 9 Jan 2003, Peter Haworth wrote: > On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote: > > At 7:29 PM -0700 1/7/03, John Williams wrote: > > >Perhaps you could explain how the $0 object will work in your mind. > > >A5 assert that $0 is a object, and it behaves as an array and a hash, >

Re: Pike 7.4

2003-01-09 Thread Chris Dutton
On Thursday, January 9, 2003, at 05:36 AM, Damian Conway wrote: Chris Dutton wrote: @ages[*] = $today - %date_of_birth{@names}.values[*] Well done. Thanks for working that out, Chris. And, in the process, confirming my sense that vector ops are a better solution here. ;-) Glad I could cont

Re: Variable Types Vs Value Types

2003-01-09 Thread attriel
> my Set of Apple $a; > my Basket of Fruit $b; > > and a generic assignment: > > $c = $a; > $c = $b; > > Now we can fill in your list (which is somewhat expanded): > AssignmentOK?Because... =======

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread attriel
>> I'm just suggesting the same for the ~ character: >> >> ~~ smart-match >> ~concatenate >> ~| stringy bitwise OR >> ~> append args >> <~ invocate > > This is where I get lost. I see 4 different concepts being overloaded > onto '~'. > > In the first it indicates 'm

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread arcadi shehter
Damian Conway writes: > Unary ~> would (by analogy to unary dot) append the current topic to the > argument list of its operand. > > Thus, your examples become simply: > > given @list { > ~> grep /bad!/ ~> @throw; > ~> grep /good/ ~> @keep; >

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Mr. Nobody
--- Damian Conway <[EMAIL PROTECTED]> wrote: > Mr. Nobody wrote: > > > I don't like either of these operators. What's wrong with > > > > @out = sort map {...} grep {...} @a > > > > ? > > For a start, if these functions were to become (only) methods in Perl 6, > it would have to be: > >

Re: Variable Types Vs Value Types

2003-01-09 Thread Dan Sugalski
At 2:08 PM + 1/9/03, Peter Haworth wrote: On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote: At 7:29 PM -0700 1/7/03, John Williams wrote: >Perhaps you could explain how the $0 object will work in your mind. >A5 assert that $0 is a object, and it behaves as an array and a hash, >depen

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread David Storrs
(/dks attempts to pour water.) Damian Conway <[EMAIL PROTECTED]> wrote: > > And even if we do have both functional and methodical versions, this: > > > > @out <~ sort <~ map {...} <~ grep {...} <~ @a; > > > > is still clearer in its intent than: > > > > @out = sort map {...} gre

RE: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Thom Boyer
Mr. Nobody <[EMAIL PROTECTED]> wrote: > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > @a ~> grep {...} ~> map {...} ~> sort ~> @out; > > That's going to be just plain confusing. Arguments to functions are supposed > to be on the right. And what's up with using them for assignment? Th

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Jonathan Scott Duff
On Thu, Jan 09, 2003 at 11:01:51AM -0700, Thom Boyer wrote: > Mr. Nobody <[EMAIL PROTECTED]> wrote: > 3) "Do you care about readability at all? It seems to me that ~> and <~ > have no use except making perl 6 uglier and more complicated than it already > is." > > I think ~> and <~ look pretty nic

RE: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Mr. Nobody
--- Thom Boyer <[EMAIL PROTECTED]> wrote: > Mr. Nobody <[EMAIL PROTECTED]> wrote: > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > > @a ~> grep {...} ~> map {...} ~> sort ~> @out; > > > > That's going to be just plain confusing. Arguments to functions are > supposed > > to be on the ri

RE: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Austin Hastings
--- "Mr. Nobody" <[EMAIL PROTECTED]> wrote: > --- Thom Boyer <[EMAIL PROTECTED]> wrote: > > Mr. Nobody <[EMAIL PROTECTED]> wrote: > > > --- Damian Conway <[EMAIL PROTECTED]> wrote: > > > > @a ~> grep {...} ~> map {...} ~> sort ~> @out; > > > > > > That's going to be just plain confusing.

RE: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Brent Dax
Mr. Nobody: # It's not letting you do anything that you couldn't do before # with normal function calls and assignment. We're writing a useful language, not a Turing machine. # I see it as making a bad idea even worse. I've never liked # having one thing doing multiple completely different and

Re: Variable Types Vs Value Types

2003-01-09 Thread David Storrs
On Wed, Jan 08, 2003 at 05:59:14PM +0800, Damian Conway wrote: > > my Array @array := SpecialArray.new; > > > > Should the value in @array act like an Array or a SpecialArray? Most > > people would say SpecialArray, because a SpecialArray ISA Array. > > Weell...*I'd* say that @array shoul

"Disappearing" code

2003-01-09 Thread John Siracusa
Has there been any discussion of how to create code in Perl 6 that's there under some conditions, but not there under others? I'm thinking of the spiritual equivalent of #ifdef, only Perlish. In Perl 5, there were many attempts to use such a feature for debugging and assertions. What everyone wa

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread David Wheeler
On Thursday, January 9, 2003, at 03:05 AM, Damian Conway wrote: I don't know about *your* font, but in mine the ~> and <~ versions are at least twice as readable as the |> and <| ones. Just out of curiosity, how did you measure that? ;-) David -- David Wheeler

Re: "Disappearing" code

2003-01-09 Thread Luke Palmer
> Date: Thu, 09 Jan 2003 19:55:20 -0500 > From: John Siracusa <[EMAIL PROTECTED]> > > Has there been any discussion of how to create code in Perl 6 that's there > under some conditions, but not there under others? I'm thinking of the > spiritual equivalent of #ifdef, only Perlish. > > In Perl 5,

Re: "Disappearing" code

2003-01-09 Thread John Siracusa
On 1/9/03 9:01 PM, Luke Palmer wrote: > Well, I just do: > > sub debug { > print STDERR shift, "\n" if DEBUG; > } > > And hopefully (I don't know P5 internals so well) that optimizes to a > no-op so there's not even a function call there. I don't know P5 internals so well either, but I'm guess

Re: "Disappearing" code

2003-01-09 Thread John Siracusa
On 1/9/03 10:10 PM, Michael G Schwern wrote: > I would assume it to be a compiler hint via subroutine attribute. > > sub debug ($msg) is off { > print STDERR $msg; > } > > some "this subroutine is a no-op if a flag is set" attribute. Hm, not quite as convenient as setting a package globa

Re: L2R/R2L syntax (was Re: Everything is an object.)

2003-01-09 Thread Andrew Rodland
On Thursday 09 January 2003 01:01 pm, Thom Boyer wrote: > If you read ~> and <~ as "stuff this thingy into that doohicky", assignment > makes perfect sense. They are plumbing connectors: sometimes they connect > the water softener to the water heater (one device to another), and > sometimes they co