Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Brent 'Dax' Royal-Gordon
On Sat, 4 Dec 2004 23:33:24 -0700, Dan Brian <[EMAIL PROTECTED]> wrote: > If there's a willingness to rename shift/unshift, why not consider > going a bit further (and offend shell heritage) to note that pull/put > aren't really linguistically opposed either (unlike push/pull). Why not > rename pop

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Dan Brian
C's only virtue, IMHO, is that it's clearly the inverse of C. But I think the spelling and aural relationship between C, C, C, and C is clear enough to negate that. But then, I'm a little biased. Except that push and pull are logical opposites linguistically, but not in standard CS parlance. coul

Re: state vs my

2004-12-04 Thread Larry Wall
On Sun, Dec 05, 2004 at 02:15:51AM +0300, Alexey Trofimenko wrote: : I thought, its primary use is for closures: : : sub test { : my $a=10; : return sub { $a++ } : } : : vs : sub test { : return sub {state $a=10; $a++ } : } : : $func1 = test; : $func2 = test; : : would closu

Re: Required whitespace issues.

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:55:00PM -0600, Rod Adams wrote: : Larry Wall wrote: : : >On Sat, Dec 04, 2004 at 08:14:17PM -0600, Rod Adams wrote: : >: In fact, unary = imposes whitespace requirements on all ops that end in : >=. : > : >Not true. : > : I guess not all cases. But several do in certai

Re: Container method calls

2004-12-04 Thread Luke Palmer
Larry Wall writes: > : But this convention provides much more accuracy than memorizing a list > : of methods that don't automatically thread, or memorizing a list of > : iterator methods that act on the iterator and not its current value. > > Except that you don't actually have to memorize a list.

Re: Required whitespace issues.

2004-12-04 Thread Rod Adams
Larry Wall wrote: On Sat, Dec 04, 2004 at 08:14:17PM -0600, Rod Adams wrote: : In fact, unary = imposes whitespace requirements on all ops that end in =. Not true. I guess not all cases. But several do in certain situations. $x ==<$foo>; # $x == <$foo>; $x = =<$foo>; @x <==<$foo>; # @x <= =<$

Re: state vs my

2004-12-04 Thread Andrew Rodland
On Saturday 04 December 2004 06:15 pm, Alexey Trofimenko wrote: > oh! that it. I've found example which could make it clear to me > > sub test { >return sub { > for 1..3 { > state $var = 1; > print $var++ > } >} > } > > $a = test; $a() for 1..3; print ';' > $b = te

Re: Required whitespace issues.

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:14:17PM -0600, Rod Adams wrote: : In fact, unary = imposes whitespace requirements on all ops that end in =. Not true. Larry

Required whitespace issues.

2004-12-04 Thread Rod Adams
Alexey Trofimenko wrote: On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a<$b && $c<$d ) {...} if( $a < $b && $c < $d ) {...} In line2, my

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Smylers <[EMAIL PROTECTED]> wrote: Yes. C is a terrible name; when teaching Perl I feel embarrassed on introducing it. C's only virtue, IMHO, is that it's clearly the inverse of C. But I think the spelling and aural relationship between C, C, C, and C is cl

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Brent 'Dax' Royal-Gordon
Smylers <[EMAIL PROTECTED]> wrote: > Yes. C is a terrible name; when teaching Perl I feel > embarrassed on introducing it. C's only virtue, IMHO, is that it's clearly the inverse of C. But I think the spelling and aural relationship between C, C, C, and C is clear enough to negate that. But the

Re: iteration (was Re: Angle quotes and pointy brackets)

2004-12-04 Thread Brent 'Dax' Royal-Gordon
David Green <[EMAIL PROTECTED]> wrote: > Aren't lazy lists a funny kind of iterator? Ones that memoise their > results. And supply an indexing method []. As I mentioned the other day, I fail to see any material difference between an iterator and a lazy list, except that a few operations are allo

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 01:24:41PM -0800, Larry Wall wrote: : I suppose we could also have : : for words <> {...} : for tokens <> {...} : for paragraphs <> {...} : for chunks(<>, :delim(/^^===+\h*\n/)) {...} : : etc. I see a problem with for words <> {...} since there's lik

Re: iterators and functions (and lists)

2004-12-04 Thread Matthew Walton
Larry Wall wrote: : of course, that analogy isn't going to work for "true" functions, which : returns the same all the time, for some given set of arguments. Oh, well, we pissed off the mathematicians long ago. :-) At least we had the sense to call them subroutines instead of functions. Of cour

Re: Container method calls

2004-12-04 Thread Ashley Winters
On Sat, 4 Dec 2004 11:15:14 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: > On Sat, Dec 04, 2004 at 10:25:49AM -0700, Luke Palmer wrote: > : But this convention provides much more accuracy than memorizing a list > : of methods that don't automatically thread, or memorizing a list of > : iterator met

Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Sat, 4 Dec 2004 11:33:10 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that "sigil is a part of name" idea :) : for 1..10 { : { :push @rray, \( sta

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread John Macdonald
On Sat, Dec 04, 2004 at 11:08:38PM +0300, Alexey Trofimenko wrote: > On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: > > >Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier > >to understand the grouping of line 1 than line 2 below: > > > >if( $a<$b &

Re: specifying the key Type for a Hash

2004-12-04 Thread David Wheeler
On Dec 4, 2004, at 10:57 AM, Larry Wall wrote: Well, I just put "is shape" because that's what the PDLers settled on, but as far as I'm concerned linguistically, it could just be "is dim". That would settle the "make-it-like-English" question by making it not at all like English. On the aesthetic h

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 11:02:38PM +0300, Alexey Trofimenko wrote: : hm. we have short and strange , for input.. (and for some reason, it : is bracketing! there's no sense at all in it) : ..but we have long (and even looking slightly OOish, in perl5 sense) print : FH for output, and noone compl

Re: Container method calls

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 10:25:49AM -0700, Luke Palmer wrote: : Ashley Winters writes: : > For several reasons, that doesn't work for me. The method conflict : > between container methods and value methods should be obvious. What : > should ((1|2)|(3&4)).values return? : : Well, there is an answer,

Re: specifying the key Type for a Hash

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:01:46AM -0700, David Green wrote: : In article <[EMAIL PROTECTED]>, : [EMAIL PROTECTED] (Larry Wall) wrote: : >S9 talk about it. We current have things like: : >my Cat %pet is shape(Str); : >and parameters to types are in square brackets, so it's more like: : >m

Re: iterators and functions (and lists)

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:53PM +0300, Alexey Trofimenko wrote: : hm.. consider that: : : perl5: :open $fh, 'file'; :$first_line = <$fh>; :@remaining = <$fh>; : : perl6: :$fh = open 'file'; :$first_line = $fh(); :@remaining = $fh(); : : I thought about parallels betwee

Re: state vs my

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that "sigil is a part of name" idea :) Too cute. But what about %ash and &unction? Or is it &ubroutine? &losure? : for 1..10 { : { :push @rray,

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier to understand the grouping of line 1 than line 2 below: if( $a<$b && $c<$d ) {...} if( $a < $b && $c < $d ) {...} In line2, my mind has to stop and ask

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Alexey Trofimenko
On Sat, 04 Dec 2004 11:03:03 -0600, Rod Adams <[EMAIL PROTECTED]> wrote: Larry Wall wrote: for =$*IN {...} for =$*ARGS {...} for = {...} for = {...} for =Â$foo.c $foo.h {...} for =['foo.c', 'foo.h'] {...} for =['.myrc', @*ARGS] {...} for [EMAIL PROTECTED] {...} for =<> {

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Stéphane Payrard
On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: > On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: > : This whole issue kind of makes me go 'ugh'. One of the things I like > : best about Perl is the amazing simplicity of the <> input construct. > > Hmm. > > while

Re: Container method calls

2004-12-04 Thread Luke Palmer
Ashley Winters writes: > For several reasons, that doesn't work for me. The method conflict > between container methods and value methods should be obvious. What > should ((1|2)|(3&4)).values return? Well, there is an answer, and it's one I've never been extremely happy with. That is, Junctions d

Tcl - new [commands]

2004-12-04 Thread William Coleda
Added some more list-based commands. Added upvar (alias to caller's variables), uplevel (execute code in caller's scope). (or your caller's caller, or...) Also added a non-standard "inline" command so you can do: oolong:~/research/parrot/languages/tcl/examples coke$ cat inline.tcl inline PIR { .s

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Luke Palmer
Rod Adams writes: > Okay, this rant is more about the \s<\s than \s=\s. To me, it is easier > to understand the grouping of line 1 than line 2 below: > > if( $a<$b && $c<$d ) {...} > if( $a < $b && $c < $d ) {...} > > In line2, my mind has to stop and ask: is that "($a < $b) && ($c < > $d)", or

iterators and functions (and lists)

2004-12-04 Thread Alexey Trofimenko
hm.. consider that: perl5: open $fh, 'file'; $first_line = <$fh>; @remaining = <$fh>; perl6: $fh = open 'file'; $first_line = $fh(); @remaining = $fh(); I thought about parallels between arrays and iterators, and realized that they aren't very close to each other: iterators are

Re: state vs my

2004-12-04 Thread Alexey Trofimenko
On Fri, 3 Dec 2004 21:25:39 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a,$b,$c) = ... : ... : } : : latt

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Rod Adams
Larry Wall wrote: So you can say for =$*IN {...} for =$*ARGS {...} for = {...} for = {...} for =«$foo.c $foo.h» {...} for =['foo.c', 'foo.h'] {...} for =['.myrc', @*ARGS] {...} for [EMAIL PROTECTED] {...} for =<> {...} The simplicity is nice, but the visual message is,

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Herbert Snorrason
On Sat, 4 Dec 2004 01:37:00 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: > for =$*IN {...} > for =$*ARGS {...} Yay. A generalised form of the input operator, which can create even handier idioms for simple file processing. Maybe I wasn't clear enough. My issue wasn't specifically with '.lin

Re: iteration (was Re: Angle quotes and pointy brackets)

2004-12-04 Thread Matt Diephouse
On Sat, 04 Dec 2004 08:59:24 -0700, David Green <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Matt Diephouse) wrote: > >Supposing > >class Filehandle does Iterate; # Iterate or Iterator? > >we have an easy way to create new iterators. I'm not sure how useful

Re: iteration (was Re: Angle quotes and pointy brackets)

2004-12-04 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Matt Diephouse) wrote: >What I mean is that Perl takes an array and makes an iterator out of it. >Sure, you probably don't think about it like that, but the behavior is >the same (who says arrays need to iterate starting at element zero?). I prob

Re: MMD dispatch

2004-12-04 Thread Leopold Toetsch
Leopold Toetsch <[EMAIL PROTECTED]> wrote: > ... We can deal > with performance implications later. I've googled for »MMD "polymorphic inline cache"«: 1-2 of about 3 on perl6-internals archives. You might guess the author of these mail ;) leo

Re: specifying the key Type for a Hash

2004-12-04 Thread David Green
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Larry Wall) wrote: >S9 talk about it. We current have things like: >my Cat %pet is shape(Str); >and parameters to types are in square brackets, so it's more like: >my %pet is Hash[:shape(Str) :returns(Cat)]; I still prefer "shaped", for

MMD dispatch (was: Objects, classes, metaclasses, and other things that go bump in the night)

2004-12-04 Thread Leopold Toetsch
Dan Sugalski <[EMAIL PROTECTED]> wrote: > Now, there is one big gotcha here -- multimethod dispatch. I'm not > entirely sure that we can do this properly and still give classes > full control over how methods are looked for and where they go. Thinking about MMD a bit more, I can imagine the follo

Container method calls

2004-12-04 Thread Ashley Winters
Howdy, While browsing the updated synopses, I noticed a problem with how scalar container methods are called. Currently, both value methods and container methods are shown in the synopses as being called with C<$foo.bar()>. For several reasons, that doesn't work for me. The method conflict betwee

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: : Might even just be a global multi sub that defaults to $*ARGS: : : multi sub *lines (IO ?$handle = $*ARGS) {...} : multi sub *lines (Str $filename) {...} : multi sub *lines (IO @handle) {...} : multi sub *lines (Str @fil

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
Okay, maybe I should have gone to bed, but I kept thinking about this. I'm starting to suspect it's time to haul out the operator I've been holding in reserve for lo these many years now, the unary =. Suppose we say that it iterates iterators, but also it recognizes certain things that aren't itera

Re: continuation enhanced arcs

2004-12-04 Thread Leopold Toetsch
Matt Fowles <[EMAIL PROTECTED]> wrote: > Thanks for the clear explanation. I did not realize that S registers > could switch pointers, that does make things a little harder. I have > a recommendation for a possible hybrid solution. Incur the cost of > spilling I,S,N registers heavily. Restore

Re: [PATCH]

2004-12-04 Thread Leopold Toetsch
Garrett Rooney <[EMAIL PROTECTED]> wrote: > This patch fixes some warnings in global_setup.c and embed.c. Thanks, applied. leo

Re: perlhash iter busted

2004-12-04 Thread Leopold Toetsch
Sam Ruby <[EMAIL PROTECTED]> wrote: > Test case attached. Another one of my hacks. The combination "KEY_integer_FLAG|KEY_number_FLAG" was invented to optimize the sequence d = dict.fromkeys(xrange(100)) with integer keys. > - Sam Ruby Fixed, leo

Re: state vs my

2004-12-04 Thread Larry Wall
On Fri, Dec 03, 2004 at 11:36:02PM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall <[EMAIL PROTECTED]> wrote: : > So optimizing to a state variable won't necessarily help your loop : > overhead, but it could help your subroutine overhead, at least in Perl : > 5, if Perl 5 had state variables.

Re: pull & put (Was: Angle quotes and pointy brackets)

2004-12-04 Thread Smylers
Larry Wall writes: > But then are we willing to rename shift/unshift to pull/put? Yes. C is a terrible name; when teaching Perl I feel embarrassed on introducing it. Given the nature of many of the other changes in Perl 6, completely changing regexps for example, renaming a couple of functions