Re: backticks

2004-04-15 Thread Luke Palmer
Austin Hastings writes: If you think about it, what we really ought to do is train ourselves to reverse the numbers row on our keyboards. If we're doing a good job about avoiding magic numbers, then $ % ( ) are going to be much more frequently used than 2 4 5 7 9 0, so why don't we fix

Re: backticks

2004-04-16 Thread Luke Palmer
Brent 'Dax' Royal-Gordon writes: If the inside of a hash indexer consists entirely of \w characters, it will be interpreted as the name of a hash key. If you want it to call a subroutine instead, add a ~ stringifying operator to the beginning of the call, or a pair of parentheses to the

Returning from Rules

2004-04-19 Thread Luke Palmer
I notice that when I write a grammar, I end up doing this an awful lot (in P::RD notation): list: term ',' list { make_node(@item[0,1,3]) } | term { $item[1] } With attention on the actions, and assuming autotree is on. In Perl 6, aside from the fact that there's a clearly

Re: A12: Mutating Methods and hyperoperators

2004-04-19 Thread Luke Palmer
Matthew Walton writes: I know these were discussed to death not that long ago, but reading Apocalypse 12 I had a query I couldn't remember if it had been covered before or not, and I certainly don't recall seeing it in the Apocalypse, although I've not read the entire thing with as much

A12 undef method calls

2004-04-19 Thread Luke Palmer
A12 mentions that C$foo.bar should return undef if C$foo is undef. While I like the idea a lot, I don't think it should happen without distinction. In fact, that's what I would most expect C.? to do, not call a method if there is one, though that seems useful, too. I'm just shooting in the dark

Re: placeholder attachment?

2004-04-19 Thread Luke Palmer
Trey Harris writes: Can anyone explain the rules of placeholder attachment? i.e., in the example in Perl6::Placeholder's manpage, grep { $data{$^value} } 1..10; C$^value is clearly intended to attach to the outer closure C{ $data{$^value} }, not the inner closure C{$^value}. But how

Re: A12: default accessors and encapsulation

2004-04-19 Thread Luke Palmer
John Siracusa writes: On 4/19/04 3:58 PM, Austin Hastings wrote: I initially decide to accept the default accessors. $dog.name = 'Ralph'; print $dog.age; This works well for a while, but then I decide to update Dog so that setting the name also sets the gender.

Re: A12: default accessors and encapsulation

2004-04-20 Thread Luke Palmer
Mark J. Reed writes: Let me just chime in with my support for John's basic idea. I would definitely prefer that it be easy to arrange things such that $obj.foo = 'bar' winds up invoking a method on $obj with 'bar' as an argument, rather than invoking a method on $obj that returns

Re: A12: Storage class/class traits

2004-04-20 Thread Luke Palmer
Austin Hastings writes: One of the things that got a little less clear with A12 was the idea of multiple Cis clauses. Once upon a time, we talked about: my $spot is Dog is const is persistent is ...; Obviously some of those are traits, now. However, I'm wondering how to handle things

Re: backticks

2004-04-20 Thread Luke Palmer
Juerd writes: Peter Haworth skribis 2004-04-20 14:56 (+0100): I think %hashkey key key is best explained as %hash{ key key key } with implicit curlies, not as an alternative to curlies. In that case, why aren't you suggesting something more in line with that? Here's what I'd like to

Re: A12: default accessors and encapsulation

2004-04-20 Thread Luke Palmer
John Williams writes: On Tue, 20 Apr 2004, Luke Palmer wrote: There. Now here's the important part: in order to *use* all this, you import whatever module defines it, and then say: class Dog { method foo (?$arg) is accessor { # accessor code here

Hyper op summary

2004-04-21 Thread Luke Palmer
I was asked to post a small summary of hyper ops for you guys. Here it is: Of course to hyperize an operator you surround it with , or just one of them for a unary operator. @a + @b @a++ You can't necessarily override their semantics without chaning how Perl 6 interprets the syntax

Re: Adding deref op [Was: backticks]

2004-04-21 Thread Luke Palmer
Matthijs van Duin writes: On Tue, Apr 20, 2004 at 10:55:51AM -0700, Larry Wall wrote: The flip side is that, since we won't use C` as an operator in Perl 6, you're free to use it to introduce any user-defined operators you like, including a bare C`. All is fair if you predeclare. Most

Re: A12: The dynamic nature of a class

2004-04-22 Thread Luke Palmer
Aaron Sherman writes: But according to A12 as I understand it, the part BEFORE that, which looked innocently like a definition: class Joe { my $.a; method b {...} } would actually get turned into a BEGIN block that executes the body of the class definition as a closure in class

Re: A12: Delegation using arrays

2004-04-23 Thread Luke Palmer
Austin Hastings writes: A12 sez: If your delegation object happens to be an array: has @:handlers handles 'foo'; then something cool happens. cool rays In this case Perl 6 assumes that your array contains a list of potential handlers, and you just want to call the first one

Re: A12: Typed undef

2004-04-23 Thread Luke Palmer
Juerd writes: Austin Hastings skribis 2004-04-23 13:33 (-0400): I should then be able to call class methods of Dog via $spot without further initialization: print defined($spot); # FALSE $rover = $spot.new; @breeds = $spot.list_breeds; But shouldn't you then just use my Class

Re: How do I do parametered roles?

2004-04-30 Thread Luke Palmer
Austin Hastings writes: Suppose that I have, for example: class Session { has @:messages; method clear_messages() {...} method add_message($msg) {...} method have_messages() {...} method get_messages() returns Array {... font color=black ...} } And suppose I

Re: How do I do parametered roles?

2004-05-01 Thread Luke Palmer
Austin Hastings writes: So what you want is a role whose names are private to the role, not the aggreagating class. Well, I believe private (i.e. $:foo) variables do that anyway, so you can just abstract your messages out into a role and it will work fine. But if you read on, I'll offer

Re: Returning from Rules

2004-05-03 Thread Luke Palmer
Jeff Clites writes: On Apr 19, 2004, at 12:06 AM, Luke Palmer wrote: Therefore, the first syntax can be redefined to evaluate the code block and assign the result to $0. Would you ever want to leave $0 unaltered? That's the only concern which comes to mind. Absoultely: if you want side

Re: C style conditional statements

2004-05-12 Thread Luke Palmer
Pedro Larroy writes: Yes, thanks a lot for your answers. I appreciate them. I think I'm now pretty attached to perl culture and I'm just a little worried, as a humble perl programmer, about things changing too much in perl6. Specially after reading coments like getting rid of the parens

Re: C style conditional statements

2004-05-12 Thread Luke Palmer
Aaron Sherman writes: Right off the bat, let me say that I've read A1-6, E7, A12, S3, S6, E1, E6 and much of this mailing list, but I'm still not sure that all of what I'm going to say is right. Please correct me if it's not. Did you really need to ask me to? ;-) Perl 5:

Re: C style conditional statements

2004-05-12 Thread Luke Palmer
Matthew Walton writes: Juerd wrote: my $n = IO::Socket::INET.new LocalPort = 20010, Listen = 5; Or, if I'm remembering correctly: my IO::Socket::INET $n .= new LocalPort = 20010, Listen = 5; I really hope I'm remembering correctly. Is this turning into the 'look how great Perl 6

Re: $foo.s/foo/bar/

2004-05-12 Thread Luke Palmer
Aaron Sherman writes: On Wed, 2004-05-12 at 14:22, Juerd wrote: Actually, can't we just use the . for s///? Well, that brings up something that I don't think Larry has covered yet. That is, it brings into question what s/// *is* in the grammar. Well, I imagine it's just a macro called

Re: Yadda yadda yadda some more

2004-05-14 Thread Luke Palmer
Aaron Sherman writes: The question I have is: how do classes control their conversion? In C++ you can overload the casting operator for any time and/or define a constructor for the receiving type. I can imagine how you would define the constructor on the receiving type in Perl 6, but

Re: A12: Required Named Parameters Strike Back!

2004-05-04 Thread Luke Palmer
Dov Wasserman writes: Long-time lurker, first time poster. Dittos, kudos, etc. Welcome aboard. Since in the rest of Perl 6, the '~' operator involves string representation, perhaps the standard +$foo marker should really be ~$foo: i.e., $foo only has a (string) name, not a numeric position.

Re: Required Named Params and go write your own grammar

2004-05-04 Thread Luke Palmer
Abhijit A. Mahabal writes: As I try writing P6 programs I do find myself needing required named params, and I thought I'd like something like ++$named_req for myself as a shorthand for +$named_req is required or whatever is decided. Now, larry often says (only partly jokingly) go write your

Re: assertion in headers.c breaks OS X

2004-05-07 Thread Luke Palmer
Nicholas Clark writes: Thanks. Everything compiles again now, and all tests pass (after I do the little .so - .dylib dance) I'm new to OS X. Might you describe said dance? Luke

Re: Register stacks again

2004-05-08 Thread Luke Palmer
Leopold Toetsch writes: [1] yes I'm thinking of just one frame pointer :) Well, the whole scheme makes a stack machine out of Parrot: I0,...In, In+1Ik, Ik+1...Il ^ | frame pointer I0..In are the incoming function arguments In+1..Ik are the working registers of the function

Re: P6C: Parser Weirdness

2004-05-13 Thread Luke Palmer
Dan Sugalski writes: And personally I'd be happy to do violence to the dragon book. (Not that it's *entirely* horrible, as I occasionally need to prop doors open or shim a broken table leg temporarily...) But, anyway, snipping out the rest of this stuff... The big problem is that I

Re: A12: The dynamic nature of a class

2004-04-26 Thread Luke Palmer
Jeff Clites writes: I don't (right off) know of any other language which has something in between variables and objects. That is, containers. They're feeling a bit artificial. Well... Perl 5. Luke

Re: Yadda yadda yadda some more

2004-05-17 Thread Luke Palmer
Aaron Sherman writes: On Fri, 2004-05-14 at 18:53, Luke Palmer wrote: Aaron Sherman writes: or did Larry mention a way to define a converter and I missed it? Yep, that's what happened. See Apocalypse 12 under Overloading. Ok, so in the case of: my int $i = ...; we

Re: RFC eq and ==

2004-05-17 Thread Luke Palmer
Pedro Larroy writes: Would it be a good idea to make ==, and other numeric comparators polymorphic so they can be used also for string comparisons? Or the will is to keep eq, gt and the others. (not very nice emho). It was decided long ago that the distinction between == and eq is going to

Re: RFC eq and ==

2004-05-17 Thread Luke Palmer
Rod Adams writes: Luke Palmer wrote: Admittedly, if you use == for everything, you can force string or numeric comparison this way: if +$a == +$b {...} # numeric if ~$a == ~$b {...} # string Hmm. In my head, I would expect == to have implicit numification

Re: Yadda yadda yadda some more

2004-05-18 Thread Luke Palmer
James Mastros writes: In the case of ..., give it type error semantics. That is, any expression involving ... gets type Except instead of reporting at the end of the statement, just suppress the errors and move on. Huh? Um, no, your ideas as to what happens don't give the desired

Re: idiom for filling a counting hash

2004-05-18 Thread Luke Palmer
Stphane Payrard writes: I use over and over this idiom in perl5: $a{$_}++ for @a; This is nice and perlish but it gets easily pretty boring when dealing with many list/arrays and counting hashes. I thought overloading the += operator %a += @a; Though that would like to mean

Re: idiom for filling a counting hash

2004-05-18 Thread Luke Palmer
Damian Conway writes: Austin Hastings wrote: Hmm. For junctions I was thinking: ++ all([EMAIL PROTECTED]); Which is almost readable. But unfortunately not correct. Junctions are value, not lvalues. This situation is exactly what hyperoperators are for: ++ [EMAIL

Re: Non-flow-control logical tests

2004-05-20 Thread Luke Palmer
Dan Sugalski writes: Right now the only good way to find out if a value is true or not is to do something like: $I0 = 1 if $P0, done $I0 = 0 done: and look in $I0 for the result. [snip] Anyway, because of it I'm pondering non-flowcontrol logical ops. That is, something like:

Re: hyper-hyper operators?

2004-05-20 Thread Luke Palmer
Dave Whipp writes: Is it possible to hyper a hyper operator? For example, given: my @m = ( [1,2], [3,4], [5,6] ); my $a = @m + 1; my $b = @m + 1; my $c = @m + 1; Those are actually: my $b = @m + 1; my $c = [ map { +$^x } @m ]; Hyper markers go on both sides of any

Re: hyper-hyper operators?

2004-05-20 Thread Luke Palmer
Austin Hastings writes: Those are actually: my $b = @m + 1; my $c = [ map { +$^x } @m ]; Boggle! Why wouldn't that be: my $c = [ map { $^x + 1 } @m ]; for the last one? Whoops. I thought I was preserving his original semantic, but I wasn't. I had somehow forgotten

Re: Periodic Table of the Operators

2004-05-26 Thread Luke Palmer
Mark Lentczner writes: All - Awhile back, I saw Larry Wall give a short talk about the current design of Perl 6. At some point he put up a list of all the operators - well over a hundred of them! I had a sudden inspiration, but it took a few months to get around to drawing it...

Re: Periodic Table of the Operators

2004-05-26 Thread Luke Palmer
Luke Palmer writes: Mark Lentczner writes: All - Awhile back, I saw Larry Wall give a short talk about the current design of Perl 6. At some point he put up a list of all the operators - well over a hundred of them! I had a sudden inspiration, but it took a few months to get

Re: Apocalypse 6: IDs of subroutine wrappers should be objects

2004-06-08 Thread Luke Palmer
Ingo Blechschmidt writes: One should be able to unwrap $subref using $id.unwrap(); Or, given $id, it'd be cool if you could get the original $subref: my $origsubref = $id.sub(); Additionally, $id could coerce to an ID number in numeric context, so $subref.unwrap($id);

Re: simple grammar example

2004-06-09 Thread Luke Palmer
Aldo Calpini writes: I've taken this bison example (an RPN calculator, stripped down version from http://www.gnu.org/software/bison/manual/html_node/Rpcalc-Rules.html): input:/* empty */ | input line ; line: '\n' | exp '\n' ; exp: NUM |

Re: simple grammar example

2004-06-09 Thread Luke Palmer
Rafael Garcia-Suarez writes: Luke Palmer wrote: Also, if this is going to be an explanation rather than just a picture, I suggest you go with Perl's usual versatile power, and store the operators in a declarative data source. grammar RPN { my @operator

Re: The behaviour of iterators

2004-06-14 Thread Luke Palmer
Dan Sugalski writes: Once we decide how to *get* these things (see the previous e-mail) we need to decide how they should work. We can fiddle around, but honestly the scheme: 1) They act as arrays--if you want the 18th element in the iterator, access it directly 2) They have 'next',

Re: Slices and iterators

2004-06-14 Thread Luke Palmer
Dan Sugalski writes: The slice vtable entry should take as its parameter a slice pmc. This should be an array of typed from/to values, so we can do something like: @foo[0..2,4..8,12..]; with three entries in the slice array--one with a from/to of 0/2, one with 4/8, and one with

Re: Slices and iterators

2004-06-14 Thread Luke Palmer
Dan Sugalski writes: At 1:21 PM -0600 6/14/04, Luke Palmer wrote: Dan Sugalski writes: The slice vtable entry should take as its parameter a slice pmc. This should be an array of typed from/to values, so we can do something like: @foo[0..2,4..8,12..]; with three entries

Re: The behaviour of iterators

2004-06-14 Thread Luke Palmer
Dan Sugalski writes: At 1:08 PM -0600 6/14/04, Luke Palmer wrote: Dan Sugalski writes: Once we decide how to *get* these things (see the previous e-mail) we need to decide how they should work. We can fiddle around, but honestly the scheme: 1) They act as arrays--if you want the 18th

Re: cmd line like switches for functions and operators.

2004-06-22 Thread Luke Palmer
Juerd writes: Michele Dondi skribis 2004-06-22 18:24 (+0200): rename -v = 1, $orig, $new; Any specific reason for the minus there? Perl's not a shell (yet). rename.SWITCHES{-v} = sub { my ($o, $n) = @_; print renaming `$o' to `$n'\n; } I think just using named

Re: cmd line like switches for functions and operators.

2004-06-22 Thread Luke Palmer
Michele Dondi writes: On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote: rename -v = 1, $orig, $new; It's already being done: rename $orig, $new :verbose; sub rename($orig, $new, +$verbose) { say Renaming `$orig' to `$new' if $verbose; ...

Re: cmd line like switches for functions and operators.

2004-06-24 Thread Luke Palmer
' Royal-Gordon wrote: It's already being done: rename $orig, $new :verbose; sub rename($orig, $new, +$verbose) { say Renaming `$orig' to `$new' if $verbose; On Tue, 22 Jun 2004, Luke Palmer wrote: No, builtins can and will have named arguments. And you can

Re: A stack for Perl?

2004-06-24 Thread Luke Palmer
Michele Dondi writes: This is yet another proposal that is probably a few years late. I've had some (admittedly limited) experience with S-Lang in the past: the language has currently a syntax that resembles much that of C but was originally designed to be strongly stack-based and still is

Re: definitions of truth

2004-06-24 Thread Luke Palmer
Paul Hodges writes: I seemed to have opened a can of worms, lol But did anybody see the one that had something to do with my question crawling around? (I've obviously missed a couple of messages. They're probably hanging out down at the router in the cyberspace equivelent of teenagers

Re: more than one modifier

2004-06-25 Thread Luke Palmer
Juerd writes: Stphane Payrard skribis 2004-06-25 16:15 (-0400): It is unpossible to stack loop modifiers without adding conventions denoting the iterators. Is it really? I've always thought this would be useful enough: say .{foo} for @$_ for @foo; Although that can probably just

Re: user-defined operators?

2004-06-27 Thread Luke Palmer
Alexey Trofimenko writes: On Thu, 24 Jun 2004 10:55:26 -0700, Larry Wall [EMAIL PROTECTED] wrote: Well, any operator or function that knows how to call a closure can function as a short-circuit operator. The built-in short-circuit operators are a bit special insofar as they're a kind of

Re: if, loop, and lexical scope

2004-06-27 Thread Luke Palmer
Alexey Trofimenko writes: AFAIR, I've seen in some Apocalypse that lexical scope boundaries will be the same as boundaries of block, in which lexical variable was defined. Yep. Except in the case of routine parameters, but that's nothing new. so, my question is, what the scope of

Re: Perl 6 regex parser

2004-06-27 Thread Luke Palmer
Jeff 'japhy' Pinyan writes: I am currently completing work on an extensible regex-specific parsing module, Regexp::Parser. It should appear on CPAN by early July (hopefully under my *new* CPAN ID JAPHY). Once it is completed, I will be starting work on writing a subclass that matches Perl

Re: if, loop, and lexical scope

2004-06-28 Thread Luke Palmer
Alexey Trofimenko writes: of course, I just mutter.. new Cfor is very good, and in special cases, when simple incrementing-decrementing isn't what I want, I can write my own iterator (btw, in which apocalypse I can find how to write iterators in perl6?) with my own custom very special

Re: Next Apocalypse

2004-06-28 Thread Luke Palmer
Austin Hastings writes: Of course, how hard can it be to implement the .parent property? You'll want it on just about everything, though, so the change will probably be to CORE::MetaClass. It still shouldn't be that hard to do. Maybe Luke Palmer will post a solution... :-) use Class

Re: if, loop, and lexical scope

2004-06-28 Thread Luke Palmer
Luke Palmer writes: Alexey Trofimenko writes: of course, I just mutter.. new Cfor is very good, and in special cases, when simple incrementing-decrementing isn't what I want, I can write my own iterator (btw, in which apocalypse I can find how to write iterators in perl6?) with my own

Re: A stack for Perl?

2004-06-29 Thread Luke Palmer
Michele Dondi writes: On Thu, 24 Jun 2004, Luke Palmer wrote: However I wonder if an implicit stack could be provided for return()s into void context. It is well known that currently split() in void context has [snip] To be honest, I have no idea what you're asking for. Might you

Re: undo()?

2004-06-29 Thread Luke Palmer
Jonadab the Unsightly One writes: Michele Dondi [EMAIL PROTECTED] writes: I must say I've still not read all apocalypses, and OTOH I suspect that this could be done more or less easily with a custom function (provided that variables will have a method to keep track of their history, or,

Re: undo()?

2004-06-29 Thread Luke Palmer
Michele Dondi writes: On Tue, 29 Jun 2004, Rafael Garcia-Suarez wrote: Difficulties: define history of a function w.r.t. threads; closures; and system side-effects (writing to files, locking them etc.) On Tue, 29 Jun 2004, Mark A. Biggar wrote: Besides we already have MTOWTDI

Re: if not C, then what?

2004-06-30 Thread Luke Palmer
Alexey Trofimenko writes: if we really about to lose C-style comma, would we have something new instead? new C,,( as I've been told here by wise ones), doesn't guarantee order in which its operands will be evaluated, and even doesn't guarantee that they won't be optimised away before

Re: Regexp::Parser v0.02 on CPAN (and Perl 6 regex question)

2004-07-01 Thread Luke Palmer
Jeff 'japhy' Pinyan writes: It'll appear shortly at your local mirror. You can get it from my web site as well. I'll be writing an extension module tomorrow, and starting next week, I'll get started on Regexp::Perl6. Cool. Which leads me to a question about Perl 6 regexes. I'm writing

Re: if not C, then what?

2004-07-02 Thread Luke Palmer
Alexey Trofimenko writes: I remember perl5 scalar: scalar($a, $b, $c) In Perl 6, I presume that means the same as: [ $a, $b, $c ] hm.. sorry, scalar() isn't needed at all:) 2+(test,test,test) Likewise, this would be: 2+[test, test, test] Which should be: 2+3

Re: Cmap Cgrep and lazyness

2004-07-03 Thread Luke Palmer
Alexey Trofimenko writes: what I want to ask - would map and grep return an iterators too?.. if it's true, then previous construct becames very memory efficient, like if I write loop ( ... ; ... ; ... ) {...; next if ...; ...; say} Yep, they will. hm.. It could be a little too

Re: Cmap Cgrep and lazyness

2004-07-03 Thread Luke Palmer
Brent 'Dax' Royal-Gordon writes: As you mentioned below, this causes problems if the code in question has side effects. But there are other cases where it messes up: sub even($_ = $CALLER::_) { ! $_ % 2 } my @e=grep { even() } 1..1024; #Okay, we don't need even anymore...

Re: Cmap Cgrep and lazyness

2004-07-04 Thread Luke Palmer
David Storrs writes: On Sat, Jul 03, 2004 at 01:02:34AM -0600, Luke Palmer wrote: But indeed there are cases where it is a problem: my $x = 2; sub mklist () { return map { 2 * $_ } 0..10; } my @list = mklist; say @list[0..4]; # 0 2 4 6 8

Re: fast question

2004-07-06 Thread Luke Palmer
Matija Papec writes: Would there be a way to still use simple unquoted hash keys like in old days ($hash{MYKEY})? imho %hashMYKEY at first sight resembles alien ship from Independence day. :) Of course there's a way to do it. This is one of those decisions that I was against for the

Predeclaration of subs

2004-07-06 Thread Luke Palmer
Considering that: $obj.meth foo; No longer needs parentheses, and that argument processing is done on the callee rather than the caller side (well, most of the time), do I still have to predeclare Cfoo if I want to say: foo bar, baz; ? Also, how does: method evil($x is rw) Work

Re: fast question

2004-07-07 Thread Luke Palmer
David Storrs writes: On Tue, Jul 06, 2004 at 06:39:07PM -0600, Luke Palmer wrote: Matija Papec writes: Would there be a way to still use simple unquoted hash keys like in old days ($hash{MYKEY})? Of course there's a way to do it. This is one of those decisions that I

Re: fast question

2004-07-08 Thread Luke Palmer
Michele Dondi writes: On Wed, 7 Jul 2004, Luke Palmer wrote: Are there others, aside from these: ? prefix: a unary prefix operator infix: a binary infix operator postfix:a binary suffix operator circumfix: a bracketing operator Tons. From

Re: scalar subscripting

2004-07-08 Thread Luke Palmer
Gautam Gopalakrishnan writes: Hello, I've tried the archives and the 'Perl 6 essentials' book and I can't find anything about string subscripting. Since $a[0] cannot be mistaken for array subscripting anymore, could this now be used to peep into scalars? Looks easier than using substr or

Re: scalar subscripting

2004-07-08 Thread Luke Palmer
Hans Ginzel writes: On Thu, Jul 08, 2004 at 09:12:16PM +1000, Gautam Gopalakrishnan wrote: about string subscripting. Since $a[0] cannot be mistaken for array subscripting anymore, could this now be used to peep into scalars? Looks easier than using Are there plans in Perl 6 for string

Re: = brother

2004-07-09 Thread Luke Palmer
Alexey Trofimenko writes: Arguably, the :shiftvalue syntax makes it easier to quote both sides of a pair, so perhaps there's a little less need for an autoquoting =. But I think that generating non-quoted keys for subscripting happens a lot more often than non-quoted keys for pairs, so I'm

Re: The .bytes/.codepoints/.graphemes methods

2004-07-10 Thread Luke Palmer
Jonadab the Unsightly One writes: Austin Hastings [EMAIL PROTECTED] writes: I think this is something that we'll want as a mode, a la case-insensitivity. Think of it as mark insensitivity. Makes sense to me, but... Maybe it can just roll into :i? It will probably get used in

Re: scalar subscripting

2004-07-13 Thread Luke Palmer
my $newfile = $str.subst(rx|\.\w+$|, '')\.bin; But what about the value of $str after interpolation? In shall it stays it's original value! I would often need, to use a little modified value of $str for a particular expression. I like the way shell does it, to be able to write

Re: enhanced open-funktion

2004-07-13 Thread Luke Palmer
[EMAIL PROTECTED] writes: Hello, I have a wish for Perl 6. I would like if the open-funktion opens only a file if it doesn't exist. Of course, I can first test if the file exist. if (-e $filename) { print file already exists!; } else { open (FH, $filename) } My

Re: regexp abbreviations matching

2004-07-13 Thread Luke Palmer
Luke Palmer writes: Hans Ginzel writes: Hello, I am missing, in Perl5, some shortcut for matching not whole word, e.g.: /^--v(?:e(?:r(?:s(?:i(?:on?)?)?)?)?)?$/ Would there be something in Perl6? Well, I don't think there's an *exact* substitute for that maximally

Re: Cartesian products? [Especially wrt iterations]

2004-07-13 Thread Luke Palmer
Jonathan Scott Duff writes: On Tue, Jul 13, 2004 at 03:31:57PM +0200, Michele Dondi wrote: Put more clearly, it is now common to see things like: for my $x (1..10) { for my $y (5..20) { for my $text (qw/foo bar baz/) { do_stgh_with $x, $y, $text; }

Re: push with lazy lists

2004-07-13 Thread Luke Palmer
David Green writes: On 7/12/04, Austin Hastings wrote: --- Larry Wall [EMAIL PROTECTED] wrote: The hard part being to pick a random number in [0,Inf) uniformly. :-) Half of all numbers in [0, Inf) are in the range [Inf/2, Inf). Which collapses to the range [Inf, Inf). Returning Inf seems

Re: Perl script to .so file

2004-07-14 Thread Luke Palmer
RaghavendraK 70574 writes: Hi, Am a hardcore C++ guy and don;t know much abt the Perl. But one of my friend has proved that the fastest way to RAD is Perl. I need to know if we can convert a Perl script to a dynamic link library under unix only. I don't know what RAD is, but I know you're

Re: String interpolation

2004-07-20 Thread Luke Palmer
Alexey Trofimenko writes: On Tue, 20 Jul 2004 16:06:40 -0700, Larry Wall [EMAIL PROTECTED] wrote: So all of these would require curlies: {foo()} [EMAIL PROTECTED] ... ah.. how poorly.. and how sufficient!.. But it's.. it's just not quite like in perl5.. But I can adopt

Re: String interpolation

2004-07-21 Thread Luke Palmer
Brent 'Dax' Royal-Gordon writes: Luke Palmer wrote: I admit there's a certain interest to Larry's new idea. I've been looking for more distinction between $, @, and % in Perl 6, since they start to become mostly irrelavent. In the new proposal: my @a = (1,2,3,4,5); my

Re: String interpolation

2004-07-21 Thread Luke Palmer
Jonathan Scott Duff writes: On Wed, Jul 21, 2004 at 07:35:08PM +0200, Aldo Calpini wrote: Larry Wall wrote: Hmm. That makes me wonder what the slice notation for everything is. maybe @foo[..] (a short form for @foo[0..Inf]) ? Surely you mean [EMAIL PROTECTED] instead of

Re: String interpolation

2004-07-21 Thread Luke Palmer
Uri Guttman writes: LW : so method calls would need the $() or @() wrappers as do all expressions LW : beyond simple scalar value lookup. that means $foo, @foo[0], $foo[0], LW : %foo{'bar'} and $foo{'bar'} all interpolate and only their variants LW : (longer index/key expressions) do

Re: Why do users need FileHandles?

2004-07-22 Thread Luke Palmer
JOSEPH RYAN writes: - Original Message - From: David Storrs [EMAIL PROTECTED] Date: Monday, July 19, 2004 5:04 pm Subject: Re: Why do users need FileHandles? Second, I would suggest that it NOT go in a library...this is reasonably serious under-the-hood magic and should be

Re: xx and re-running

2004-07-22 Thread Luke Palmer
JOSEPH RYAN writes: When I think about your description of xxx, I summarized it in my head as Call a coderef a certain number of times, and then collect the results. That's pretty much what map is, except that xxx is infix and map is prefix. @results = { ... } xxx 100;

Re: Why do users need FileHandles?

2004-07-23 Thread Luke Palmer
David Green writes: So making it go in the core may just mean that it's on the list of recommended modules to install. Does that mean having to use Some::Module to use it? Not necessarily. Glop, on which I'm doing a presentation at OSCON (have to plug it sometime ;-), makes use of an idiom

Re: xx and re-running

2004-07-23 Thread Luke Palmer
Michele Dondi writes: Quite similarly, for example, I'd like to have a fold() function like the one that is available in many functional programming languages, a la: my $tot = fold 0, { + }, 1..10; # 55 my $fact = fold 1, { * }, 2..5; # 120 (i.e. please DO NOT point out that there

Re: Proof of concept - hack_42 (was: the whole and everything)

2004-07-27 Thread Luke Palmer
Leopold Toetsch writes: $ time parrot -j -Oc c.imc in main 20 real0m1.069s user0m0.910s sys 0m0.020s $ time parrot -C ch.imc in main 20 real0m0.356s user0m0.250s sys 0m0.000s I think that a factor 3 improvement in function call speed (and a

Re: Popping an empty stack

2004-08-17 Thread Luke Palmer
Michel Pelletier writes: We have to through an IndexError exception for Python. But that's not done yet. Okay, I'll keep depth checking. I thought about attempting a patch, but Larry says return an undef containing an unthrown exception, Dan wonders if it should be an empty undef, and

<    8   9   10   11   12   13