Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Luke Palmer
David Green writes: On 8/19/04, [EMAIL PROTECTED] (David Green) wrote: On Aug 14, 2004, at 5:52 PM, Larry Wall wrote: for all $*IN # all() is junction for each $*IN # each method wants closure if we follow Ruby for next $*IN # next $foo is a loop exit [...] Each and every

Re: Return with no expression

2004-08-19 Thread Luke Palmer
Matt Diephouse writes: use CGI qw(:standard); my $foo = Bar-new( name = Baz, value = param('baz'), something = 'else' ); See the problem? Yikes, yeah, that seems so innocent. Cparam uses Creturn;. In this example, it's called in list context.

Re: Return with no expression

2004-08-19 Thread Luke Palmer
Matt Diephouse writes: The point that it's documented for Cparam and for Creturn doesn't remove the fact that while this DWIM the majority of the time, it can be the cause of a subtle bug. I'm sure many people don't know about the DWIM behavior. Or aren't actively aware of it. As is the case

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Luke Palmer
Larry Wall writes: next D next N all D all N == == = = $iter $iter.read ?1 $iter.read ?2 @array @array.shift@array.for

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: 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: 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: 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: 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: regexp abbreviations matching

2004-07-13 Thread Luke Palmer
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 efficient pattern (but I'm

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: enhanced open-funktion

2004-07-13 Thread Luke Palmer
Michele Dondi writes: On Tue, 13 Jul 2004, Michele Dondi wrote: I rather have a much bigger wish for an open-like operator that to be Of course that should be function. I'm thinking of an operator that returns a magical FH

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

2004-06-24 Thread Luke Palmer
Rod Adams writes: Come the glorious age of Perl6, will hash slices be enhanced to allow things like the following? [EMAIL PROTECTED]'expected'} = [EMAIL PROTECTED]; Well, you can always do this: [EMAIL PROTECTED] = [EMAIL PROTECTED]; But I definitely look forward to the definitions of

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

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

Re: Array/Hash Slices, multidimensional

2004-04-15 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Abhijit A. Mahabal [mailto:[EMAIL PROTECTED] Sent: Thursday, 15 April, 2004 05:13 PM To: [EMAIL PROTECTED] Subject: Array/Hash Slices, multidimensional As the hash syntax is being worked out, I thought it'd be a good time

Re: backticks

2004-04-15 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Juerd [mailto:[EMAIL PROTECTED] Austin Hastings skribis 2004-04-15 18:38 (-0400): $foo % bar % is 4 keys: space, shift, 5, space. Too much, IMHO. Typability and readability are both VERY important. In that case, why

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-14 Thread Luke Palmer
Scott Walters writes: Juerd, You'd do well to not remove the conclusion of my post when the conclusion is that the I strongly support you. Otherwise, your reply, read out of context, sounds like you're fending off an attacker ;) People would do well to seperate the merits of the idea from

Re: Compatibility with perl 5

2004-04-13 Thread Luke Palmer
David Cantrell writes: A few days ago I briefly discussed with Nicholas Clark (current perl 5.8 pumpking) about making perl5 code forward-compatible with perl6. A quick look through the mailing list archives didn't turn up anything obvious, and I don't recall any mechanism being presented in

Re: Dereferencing Syntax (Was: Outer product considered useful)

2004-03-26 Thread Luke Palmer
Larry Wall writes: : Also, how does the use of *$foo differ from @$foo here? Is the later : going away? (I'd think that horrible, for the same reason as above: C : is confusing because it's not always clear what you get when you *.) No, @$foo is not going away. You can write it that way

Re: Dereferencing Syntax (Was: Outer product considered useful)

2004-03-26 Thread Luke Palmer
Juerd writes: Larry Wall skribis 2004-03-25 12:33 (-0800): On Thu, Mar 25, 2004 at 11:35:46AM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall wrote: : say @bar.elems;# prints 1 : Csay? Not Cprint? It's just a println spelled Huffmanly. Can't we instead just have a

Re: Dereferencing Syntax (Was: Outer product considered useful)

2004-03-26 Thread Luke Palmer
Larry Wall writes: On Fri, Mar 26, 2004 at 09:41:23AM -0700, Luke Palmer wrote: : Is @{$foo} going away? More specifically, how do I write that map if : $baz is some more complex expression, and I don't want to use * (say I : want to adhere if map decides to change its signature to take

Re: Dereferencing Syntax (Was: Outer product considered useful)

2004-03-25 Thread Luke Palmer
Aaron Sherman writes: I would expect [] to force itself into scalar context anyway. Is there ever a reason to want otherwise? Clearly the entire point of [] is to create a scalar array ref from a list of arguments. More to the point is there ever a reason to want any array ref in list

Outer product considered useful

2004-03-22 Thread Luke Palmer
I found myself writing a perl script today in which I did (I'll perl6-ize it for sake of discussion): for 98,99 - $i { for 0..255 - $j { # testing IP addresses with $i.$j } } I was thinking about what would happen if I allowed the user to input those ranges,

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Luke Palmer writes: I believe it could be programmed lazily. Like this: sub _outer_coro(*$first is context(Scalar), [EMAIL PROTECTED] is context(Scalar)) is coroutine { if @rest { _outer_coro [EMAIL PROTECTED

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Luke Palmer writes: Which is of course wrong. sub _outer_coro(@prev, @data) is coroutine { if (@data) { _outer_coro([ @prev, @data[0] ], @data[1...]) } else { yield [EMAIL PROTECTED]; } } sub outer([EMAIL

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Austin Hastings writes: Before this gets simonized, let me add that this seems genuinely useful: It provides a way of constructing a loop in a dimension that is not really accessible, except via recursion. Luke: Would that have to be for outer([EMAIL PROTECTED]) - @cp {...} ? -

Re: Outer product considered useful

2004-03-22 Thread Luke Palmer
Austin Hastings writes: - @cp makes about as much sense as sub(@cp). Couter returns a list of array references, right? So it binds each one to @cp (the right of - is a subroutine parameter list, remember?). Are you saying that sub(@cp) is not, in fact, an alias for Cmap sub, @cp ?

Re: Some questions about operators.

2004-03-19 Thread Luke Palmer
Joe Gottman writes: 2) Do all of the xor variants have the property that chained calls return true if exactly one input parameter is true? I would imagine not. Cxor is spelled out, and by definition XOR returns parity. On the other hand, the junctive ^ (one()) is exactly one. 3)

Re: Some questions about operators.

2004-03-19 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Luke Palmer [mailto:[EMAIL PROTECTED] Sent: Friday, 19 March, 2004 10:06 PM To: Joe Gottman Cc: Perl6 Subject: Re: Some questions about operators. Joe Gottman writes: 2) Do all of the xor variants have the property

Re: Mutating methods

2004-03-15 Thread Luke Palmer
Deborah Pickett writes: Someone Damian-shaped will probably come in and point out how to prettify that using given, but it still wouldn't be as short as last week's $coderef.(argument).{hashelem}.self:sort(); But that still has problems. What's the important thing in this sentence? The

Re: hash subscriptor

2004-03-15 Thread Luke Palmer
Larry Wall writes: On Mon, Mar 15, 2004 at 11:56:26AM -0700, John Williams wrote: : On Wed, 10 Mar 2004, Larry Wall wrote: : You subscript hashes with {...} historically, or these days, ..., : when you want constant subscripts. So what you're looking for is : something like: : :

Re: Operators that keep going and going...

2004-03-14 Thread Luke Palmer
Carissa writes: The other thought that grew from these random neurons firing was whether or not it would be possible to have operators that don't actually do anything until the data they're dependent upon changes. I should hope that would be possible, since it's possible in Perl 5! See

Re: Mutating methods

2004-03-12 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Larry Wall [mailto:[EMAIL PROTECTED] On Thu, Mar 11, 2004 at 06:49:44AM -0800, Gregor N. Purdy wrote: : So, will mutatingness be a context we'll be able to inquire on : in the implementation of a called routine? Probably

Re: Mutating methods

2004-03-10 Thread Luke Palmer
Juerd writes: Perlists, In Perl 5, lc, lcfirst, quotemeta, uc and ucfirst don't mutate. chomp and chop do mutate. I imagine these will all be methods in Perl 6: $foo.lc $foo.quotemeta $foo.chomp I'd like a mutating version of lc, and a non-mutating version of chomp.

Re: Mutating methods

2004-03-10 Thread Luke Palmer
Larry Wall writes: On Wed, Mar 10, 2004 at 11:19:52AM -0800, Brent Dax Royal-Gordon wrote: : Luke Palmer wrote: : The reason we couldn't just decalre it with Cinfix:.= is because its : right hand side is not a usual expression. : : Isn't that what macros are for? : : macro infix

Re: Mutating methods

2004-03-10 Thread Luke Palmer
Larry Wall writes: On Wed, Mar 10, 2004 at 12:42:00PM -0700, Luke Palmer wrote: : I can think of a couple that I like better: : : ^foo : *foo : : ^foo is my favorite at the moment (even though *foo is more : visually pleasing), because it looks like it's transferring

Re: Compile-time undefined sub detection

2004-03-06 Thread Luke Palmer
Austin Hastings writes: Perhaps this is one of those places where properties can help. Instead of having BEFORE, REALLY_BEFORE, NO_I_MEAN_REALLY_BEFORE, DONE, MOSTLY_DONE, PARTIALLY_DONE, WELL_DONE, DONE_AND_PROCESS_SPACE_ALMOST_RECLAIMED, etc., we could simply use some ordering properties:

<    1   2   3   4   5   6   7   8   9   10   >