Re: "Disappearing" code

2003-01-10 Thread Michael G Schwern
On Thu, Jan 09, 2003 at 07:55:20PM -0500, John Siracusa wrote: > 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 attem

Re: "Disappearing" code

2003-01-10 Thread Michael G Schwern
On Thu, Jan 09, 2003 at 11:15:49PM -0500, John Siracusa wrote: > 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

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

2003-01-10 Thread attriel
> print sort { ... } <~ mymethod(42) <~ @b; > > call sort on what comezouta calling mymethod(42) on what comezouta @b. > I think. Indirect objects are still somewhat confusing. :) > > If I'm reading the info right on <~, then we want to make it clear > that you _don't_ put it between print and stu

Re: "Disappearing" code

2003-01-10 Thread John Siracusa
On 1/9/03 11:27 PM, Michael G Schwern wrote: > On Thu, Jan 09, 2003 at 11:15:49PM -0500, John Siracusa wrote: >> 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; >>> }

Re: "Disappearing" code

2003-01-10 Thread Rafael Garcia-Suarez
John Siracusa <[EMAIL PROTECTED]> wrote: > > Well, er, don't we need to decide what the subroutine attribute is, so that > the compiler will know to honor it and make the code "disappear"? It > doesn't seem like a feature that can be added from "userland" after the fact > (but maybe I'm wrong...)

Re: Variable Types Vs Value Types

2003-01-10 Thread Damian Conway
attriel wrote: AssignmentOK?Because... ======== my Basket $c = $a no $c's type: Basket (of Object) X ^

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

2003-01-10 Thread Damian Conway
Andy Wardley wrote: s/~=/=~/ Indeed. And that's precisely why we're changing it to ~~ in Perl 6. ;-) The first 3 all relate to the familiar concept of 'minus', or more precisely a delta between two values. The last uses '-' as 'dash', another familiar concept which doesn't grate against th

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

2003-01-10 Thread Damian Conway
Mr. Nobody wrote: I find the normal function call and assignment far more readable than using some weird ugly operator. and later: 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? That's making them

Re: Variable Types Vs Value Types

2003-01-10 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > attriel wrote: > >> AssignmentOK?Because... >> ======== >> my Basket $c = $a no $c's type: Basket (of Object) >>

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

2003-01-10 Thread Austin Hastings
--- attriel <[EMAIL PROTECTED]> wrote: > Could someone explain how to know what's the indirect object? (who > knew > the "sentence diagramming" would be USEFUL!!) Short version: If there's two people in the sentence, the verb-ee is either the direct or indirect object. If there's two people and

Re: "Disappearing" code

2003-01-10 Thread Dan Brook
On Thu, 09 Jan 2003 19:55:20 -0500 John Siracusa <[EMAIL PROTECTED]> wrote: > 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. If the perl6 command-l

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

2003-01-10 Thread Paul Johnson
Damian Conway said: > Andy Wardley wrote: >> The arrow is a special case. I don't read that first character >> as '-', I think of the operator as one. I guess the visual cue forces >> me to see it like that. > > I'm suggesting that ~> and <~ will be the same. I think that in part this may depe

Re: "Disappearing" code

2003-01-10 Thread John Siracusa
On 1/10/03 11:11 AM, Dan Brook wrote: > On Thu, 09 Jan 2003 19:55:20 -0500 > John Siracusa <[EMAIL PROTECTED]> wrote: >> 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 #

Re: "Disappearing" code

2003-01-10 Thread Damian Conway
John Siracusa asked: 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 assert

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

2003-01-10 Thread Damian Conway
Trey Harris raised the spectre of: shades of C++, how about just $*STDERR <~ $foo; Yes. Assuming C were suitably overloaded. or $foo ~> $*STDERR; Yes. Assuming C were suitably overloaded. Not sure whether that would come "standard", but if not, here's a first cut of the necessary mod

~> and <~ become |> and <| (was L2R/R2L syntax )

2003-01-10 Thread Jim Cromie
Damian Conway wrote: Can I suggest that an alternative solution might be the following: So an L2R array-processing chain is: @out = @a ~> grep {...} ~> map {...} ~> sort; There might also be a be special rule that, if the RHS is a variable, the LHS is simply assigned to it.

Re: "Disappearing" code

2003-01-10 Thread John Siracusa
On 1/10/03 12:24 PM, Damian Conway wrote: > "Immediate" subroutines are executed as soon as they are parsed (i.e. they're > like named BEGIN blocks). > > Returning a closure/block from an immediate sub called in a void context > (as C is in the example above) causes the immediate sub call to be >

Re: Array Questions

2003-01-10 Thread Michael Lazzaro
On Thursday, January 9, 2003, at 03:24 AM, Damian Conway wrote: Michael Lazzaro asked: class FileBasedHash is Hash { ...stuff... }; my %data is FileBasedHash('/tmp/foo.txt'); Yes. my $path = '/tmp/foo.txt'; my %data is FileBasedHash($path); Indeed Great -- then I have only one

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

2003-01-10 Thread Austin Hastings
--- attriel <[EMAIL PROTECTED]> wrote: > Ah. OK, thanks :) I had the basic idea, but I wasn't sure how to > tell in perl which parameter was the indirect object :o Right, "o" in your sentence above is the object. > if I'm following this right, it's the inferred object such that (in > p5) if I

Re: Array Questions

2003-01-10 Thread Jonathan Scott Duff
On Fri, Jan 10, 2003 at 10:28:49AM -0800, Michael Lazzaro wrote: > Great -- then I have only one more question, I think. In the words of > a certain cartoon character, what's *this* button do? > >my $b is $a; And no matter what that button does, will this: my $a $b; be illegal? -

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

2003-01-10 Thread Andrew Rodland
On Friday 10 January 2003 11:42 am, Paul Johnson wrote: > Damian Conway said: > > Andy Wardley wrote: > >> The arrow is a special case. I don't read that first character > >> as '-', I think of the operator as one. I guess the visual cue forces > >> me to see it like that. > > > > I'm suggesting

RE: Array Questions

2003-01-10 Thread Thom Boyer
From: Michael Lazzaro [mailto:[EMAIL PROTECTED]] > But I don't know if these two > lines would really have the same result, ... > > $a = MyScalar; > $a = 'MyScalar'; Hrmm. Didn't Larry decree that there are no bare words, but that a class name will evaluate to the string representing th

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

2003-01-10 Thread Thom Boyer
Paul Johnson <[EMAIL PROTECTED]> wrote: > When I later saw it using mutt in an xterm, the tilde was at the top of > the character, where I was more used to seeing it and it didn't look like > an arrow any more, nor did it look very good to me. Well, at least now I understand why some people didn't

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

2003-01-10 Thread Thom Boyer
Andrew Rodland <[EMAIL PROTECTED]> wrote: > But you're missing the most important part! > I propose that these operators should be named "gozinta" ( ~>) > and "comezouta" ( <~ ), just so that we can say that perl has them. Not to > mention that the names work pretty well, for me. Here, here! Al

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

2003-01-10 Thread Luke Palmer
> Date: Fri, 10 Jan 2003 08:12:48 -0800 (PST) > From: Austin Hastings <[EMAIL PROTECTED]> > > --- attriel <[EMAIL PROTECTED]> wrote: > > Could someone explain how to know what's the indirect object? (who > > knew > > the "sentence diagramming" would be USEFUL!!) > > Short version: > > If there'

Re: Array Questions

2003-01-10 Thread Luke Palmer
> From: Thom Boyer <[EMAIL PROTECTED]> > Date: Fri, 10 Jan 2003 13:57:26 -0700 > > From: Michael Lazzaro [mailto:[EMAIL PROTECTED]] > > But I don't know if these two > > lines would really have the same result, ... > > > > $a = MyScalar; > > $a = 'MyScalar'; > > Hrmm. Didn't Larry decr

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

2003-01-10 Thread Andy Wardley
Paul Johnson wrote: > When I later saw it using mutt in an xterm, the tilde was at the top of > the character, where I was more used to seeing it and it didn't look like > an arrow any more, nor did it look very good to me. Ah yes, that's the problem. On all my fonts, the tilde appears at the top

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

2003-01-10 Thread Paul Johnson
On Fri, Jan 10, 2003 at 03:55:30PM -0500, Andrew Rodland wrote: > On Friday 10 January 2003 11:42 am, Paul Johnson wrote: > > Damian Conway said: > > > Andy Wardley wrote: > > >> The arrow is a special case. I don't read that first character > > >> as '-', I think of the operator as one. I guess

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

2003-01-10 Thread Mark J. Reed
Let me just chime in here that I have been reading all the messages via mutt in an xterm font in which the tilde is at the top of the space, and this has in no way affected my appreciation of the new operators. I don't want them to look like arrows, because that's reminiscent of ->, which is misle

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

2003-01-10 Thread Damian Conway
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? ;-) Well, obviously, I used the Symbol::Readability module: module Symbol::Readability; sub delta_r(Str $a, Str $a) retur