Re: SEND + MORE = MONEY (works now in pugs with junctions!)

2005-03-11 Thread Luke Palmer
Larry Wall writes: There's no doubt that the QM view of extended entanglement is very useful. After all, that's what the whole universe runs on. But most mortals will want the classical view to be the default, so we'll require some kind of explicit markup or pragma if you want to extend

Re: Junctions - feedback and desires

2005-03-10 Thread Luke Palmer
Rod Adams writes: Dave Whipp wrote: Rod Adams wrote: I do not believe that you can create a 'lazy junction'. But I don't recall the topic coming up before, so we'll have to wait for Damian to come back unless someone else knows for certain. My understanding is that all lists are

Re: Argument Patterns

2005-03-09 Thread Luke Palmer
Leopold Toetsch writes: Luke Palmer [EMAIL PROTECTED] wrote: I think we should replace our multimethod system with a more general pattern matcher, a variadic multimethod system of sorts. Multimethods need to be variadic anyway, because we want pugs's quicksort example to work. I'd

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Luke Palmer
Rod Adams writes: Indeed, a great deal of logical testing can be performed with the current P6RE definition. For instance: rule Equal ($x, $y) {{ $x ~~ $y or fail }}; rule Substr (Str $str, Str $in) {{ $in ~~ /$str/ or fail }}; rule IsAbsValue (Num $x, Num $y) { {$x ==

Re: Argument Patterns

2005-03-09 Thread Luke Palmer
Thomas Sandla writes: Luke Palmer wrote: But we always have enough knowledge to optimize the hell out of this, and they're not not handwavy we can probably optimizations. They're real, and they're pretty darn easy. I fully agree. But I like to add that a single 'where' on general types

Re: splat operator and context

2005-03-09 Thread Luke Palmer
Aldo Calpini writes: my @a = [1,2,3]; # or does it make @a[0] = (1,2,3)? Yes, @a[0] = [1,2,3]; and I have absolutely no clue about the following: my *$a = @a; my *$a = [EMAIL PROTECTED]; my *$a = (1,2,3); my *$a = [1,2,3]; Those are all illegal. You need to use binding for

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Luke Palmer
Rod Adams writes: You could do all of this with a library of rules. / $x:=generate(@values) test($x) / I don't think this does what I want. In this, generate returns a rule or string of some kind, matches the string being tested, captures what matches, and then binds the

Re: MMD as an object.

2005-03-09 Thread Luke Palmer
Rod Adams writes: I wasn't intending it to be junctive. I was just noting that you needed separate holders for subs and methods, since you shouldn't be able to stuff a method into a multi sub. Keep in mind that the two following definitions are equivalent: class A { method foo () {...}

Argument Patterns

2005-03-08 Thread Luke Palmer
All this Haskell programming has opened my eyes to what our multimethod dispatch could be. As we have seen with Csort, the dispatch system is a pattern matcher. But it's a pretty terrible one. I think we should replace our multimethod system with a more general pattern matcher, a variadic

Re: Adding linear interpolation to an array

2005-03-08 Thread Luke Palmer
Thomas Sandla writes: Larry Wall wrote: One can always mixin a does LinearInterpolation at run time in the body of the sub to get the effect of a directive, so I think the most useful thing is to treat roles in signatures as constraints where they can be used to select for MMD. Further

Optional binding

2005-03-06 Thread Luke Palmer
What is output: sub foo($x, ?$y, [EMAIL PROTECTED]) { say x = $x; y = $y; z = @z[]; } my @a = (1,2,3); foo($x, @a); Thanks, Luke

Re: [pugs] array interpolation question

2005-03-05 Thread Luke Palmer
Garrett Rooney writes: Garrett Rooney wrote: Assuming the spec is correct, here's a patch to add some more tests to t/op/string_interpolation.t. Of course, those should have been todo_is tests... Here's the right patch. Thanks, applied. Luke

Re: Valid hash keys?

2005-03-01 Thread Luke Palmer
Alex Burr writes: On Sun, Feb 27, 2005 at 03:36:42PM -0700, Luke Palmer wrote: But the biggest problem is that if the user overloads 'equal' on two objects, the hash should consider them equal. We could require that to overload 'equal', you also have to overload .hash so that you've given

Re: Rule Parameters

2005-03-01 Thread Luke Palmer
Rod Adams writes: Since the line between rules and subs is already blurring significantly, I want to blur it a little more. I want to write rules which can take parameters. No no no! That's too powerful. Wow, skimming through both S5 and A5 and I see no mention of such a thing. I know

Re: Valid hash keys?

2005-02-27 Thread Luke Palmer
Autrijus Tang writes: Just a quick question: Is Hash keys still Strings, or can they be arbitary values? They can be declared to be arbitrary: my %hash is shape(Any); If the latter, can Int 2, Num 2.0 and Str 2 point to different values? That's an interesting question. Some people

Re: Valid hash keys?

2005-02-27 Thread Luke Palmer
Luke Palmer writes: Autrijus Tang writes: Just a quick question: Is Hash keys still Strings, or can they be arbitary values? They can be declared to be arbitrary: my %hash is shape(Any); If the latter, can Int 2, Num 2.0 and Str 2 point to different values? That's

Re: Valid hash keys?

2005-02-27 Thread Luke Palmer
Nigel Sandever writes: On Sun, 27 Feb 2005 02:20:59 -0700, [EMAIL PROTECTED] (Luke Palmer) wrote: I forgot an important concretity. Hashes should compare based on the generic equal operator, which knows how to compare apples and apples, and oranges and oranges, and occasionally a red

Re: Valid hash keys?

2005-02-27 Thread Luke Palmer
Nigel Sandever writes: On Sun, 27 Feb 2005 15:36:42 -0700, [EMAIL PROTECTED] (Luke Palmer) wrote: As far as getting 2, 2.0, and 2 to hash to the same object, well, we know they're 'equal', so we just need to know how to hash them the same way. In fact, I don't believe 2.0 can

Re: S06: Pairs as lvalues

2005-02-26 Thread Luke Palmer
Ingo Blechschmidt writes: that's really convenient, but what will the following code do? my $x = (a = 42); # $x is a Pair. $x = 13; # Is $x now the Pair (a = 13) or # the Int 13? It's the Int 13. Your example looks a lot like this one: my $x

Re: scoping functions as list operators?

2005-02-24 Thread Luke Palmer
Stphane Payrard writes: Giving scoping functions the status of list operators would allow to drop parentheses when not used in conjunction with initializer so one could write: my $a, $b, $c; instead of my ($a, $b, $c); Hmm, but that kills the Perl 5 ability to do concise inline

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Luke Palmer
Juerd writes: Damian Conway skribis 2005-02-22 22:13 (+1100): @x = func($a, [EMAIL PROTECTED]); That's: @x = func($a, @y); But, y'know, this one almost convinces me. Especially when you consider: sub func ($i, $j, $k) {...} @x = func($a, [EMAIL PROTECTED], @z);

Re: Junction Values

2005-02-18 Thread Luke Palmer
Rod Adams writes: Junctions are intended to be used mainly within conditionals and other statements; If the set of these other statements is limited, consider creating a Junction class (which needs a use Junction; to activate), which overloads the various comparison operators for when a

Re: Containers vs Objects.

2005-02-15 Thread Luke Palmer
Rod Adams writes: So I'm interested in hearing what pushes Arrays and Hashes over the edge for needing their own container and sigil, whereas Junctions/Sets do not. Nothing. In fact, arrays and hashes aren't atomic or fundamental in any respect, and the main thing that keeps them there is

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Luke Palmer
David Storrs writes: On Tue, Feb 15, 2005 at 11:06:51AM -0800, Larry Wall wrote: But what y'all are talking about above is the other end--the return type. And maybe we need to enforce a newbie-friendly invariant on that end as well. I suppose we could default to not accepting

Re: proposal: use \ as none junction delimeter

2005-02-15 Thread Luke Palmer
Thomas Sandla writes: Luke Palmer wrote: But I counter that arguability by saying that you really shouldn't be putting one() in type signatures. If you want something to be an A or a B, and you're not doing any checking later on in the code, then it's fine if it's both A and B. If you

Re: proposal: use \ as none junction delimeter

2005-02-14 Thread Luke Palmer
Thomas Sandla writes: HaloO Luke, you wrote: if $a \ $b == 3 {...} *If A nor B is 3 ... What does the * in front of the if mean? Not? Ungrammatical With grammar reason I meant the formal grammar of Perl6 not the one of natural english. Are you aware of such reasons? Ahh.

Re: proposal: use \ as none junction delimeter

2005-02-11 Thread Luke Palmer
Thomas Sandla writes: This gives: my @x = (1,2,3); my $x = [1,2,3]; my $x = ref (1,2,3); # also without ()? my $x = \* (1,2,3); # also without ()? Accepting the above completes the junction constructing operators: my $x = 1|2|3; # any my $x = 1^2^3; # one my $x

Re: S04

2005-02-10 Thread Luke Palmer
David Storrs writes: Given that Perl 6 won't support an actual do-while loop a la C++ (and yes, I know that Perl5 didn't either), how would you accomplish that? That is, I'd like to have a loop that runs once, then checks its condition to see if it should repeat and continues to repeat as long

Re: Junctive puzzles.

2005-02-08 Thread Luke Palmer
Miroslav Silovic writes: [EMAIL PROTECTED] wrote: So Pugs will evaluate that to (#f|#f), by lifting all junctions out of a multiway comparison, and treat the comparison itself as a single variadic operator that is evaluated as a chain individually. I think this is correct, however... this is

Re: Junctive puzzles.

2005-02-08 Thread Luke Palmer
Luke Palmer writes: Miroslav Silovic writes: [EMAIL PROTECTED] wrote: So Pugs will evaluate that to (#f|#f), by lifting all junctions out of a multiway comparison, and treat the comparison itself as a single variadic operator that is evaluated as a chain individually. I think

Re: Retry: ITypes and VTypes.

2005-02-06 Thread Luke Palmer
Brent 'Dax' Royal-Gordon writes: Alexey Trofimenko [EMAIL PROTECTED] wrote: my $var = test; my @arr := $var; error? or maybe it would be the same weirdness, like in former example? or maybe it's a [test]? The := operator uses the same rules as parameter passing. So, what do you

Re: Featherweight Perl6.

2005-02-02 Thread Luke Palmer
Autrijus Tang writes: Hi. Today I have started working on specifying and implementing Featherweight Perl6 (FP6), a side-effect-free subset of Perl6: http://autrijus.org/pugs/fp6/ # FP6, the language http://autrijus.org/pugs/ # Pugs, the implementation Awesome. This should be

Autothreading generalization

2005-01-31 Thread Luke Palmer
S09 states (in Parallelized parameters and autothreading) that if you use a parameter as an array subscript in a closure, the closure is a candidate for autothreading. - $x, $y { @foo[$x;$y] } Means: - ?$x = @foo.shape[0].range, ?$y = @foo.shape[1].range { @foo[$x;$y] } And each

Re: Autothreading generalization

2005-01-31 Thread Luke Palmer
Luke Palmer writes: Or to write another typical tensor product: a^j = L_i^j b^i You write either of: @a[$^j] = @L[$^i; $^j] * @b[$^i] @a = @L * @b; Or not. There's that implicit Einstein summation involved, and a general purpose programming language isn't about to give

Re: Autothreading generalization

2005-01-31 Thread Luke Palmer
Craig DeForest writes: Quoth Luke Palmer on Monday 31 January 2005 03:46 pm, C_{ijkl} = A_{ij} * B_{kl} You write either of: @C[$^i; $^j; $^k; $^l] = @A[$^i; $^j] * @B[$^k; $^l] @C = @A[$^i; $^j] * @B[$^k; $^l] Hmm... This is both insanely great and also greatly

Re: where without type?

2005-01-29 Thread Luke Palmer
Carl Msak writes: On Fri, 28 Jan 2005 11:38:51 -0700, Luke Palmer [EMAIL PROTECTED] wrote: I don't think it's the cleanest solution, but it works. Just out of curiosity, what do you think would be a cleaner solution? And why would one not want to implement such a solution instead? I

Re: where without type?

2005-01-28 Thread Luke Palmer
Juerd writes: Consider: my $foo of Num where { 0 = $^n 10 }; Is the following also valid? my $foo where { 0 = $^n 10 }; I don't see why not. The main place Cwhere will be useful is in multimethods, and I see that as a reasonable shorthand: multi sub foo(Bar $x, $y where

Re: where without type?

2005-01-28 Thread Luke Palmer
Juerd writes: Luke Palmer skribis 2005-01-28 9:31 (-0700): And can $_ be used instead of $^n? Of course it can. You know that. I do? Can't say I understand well when a topic is implicitly defined and when not. It's obvious for for-loops and given, but everything else is blurry

Re: Perl 6 How Do I? (Was: Perl 6 Summary for 2005-01-11 through 2005-01-18)

2005-01-19 Thread Luke Palmer
Austin Hastings writes: Luke Palmer wrote: Austin Hasting writes: How do I concisely code a loop that reads in lines of a file, then calls mysub() on each letter in each line? Or each xml tag on the line? And I guess the answer is the same as in Perl 5. I don't understand

Re: Perl 6 How Do I?

2005-01-19 Thread Luke Palmer
Uri Guttman writes: LP == Luke Palmer [EMAIL PROTECTED] writes: LP use Rule::XML; LP for { LP mysub($_) for m:g/(Rule::XML::tag)/; LP } shouldn't that be in the Grammar namespace? not that we have finalized namespaces but i was under the impression

Re: Making control variables local in a loop statement

2005-01-13 Thread Luke Palmer
Joe Gottman writes: It would be nice if there were some easy way to mimic the Perl5 behavior in Perl6. In Perl6, the canonical way to make a variable local to a block is by making it a parameter. I therefore suggest allowing the following syntax: loop 0 - $n; $n 10; ++$n {...}

Re: Possible syntax for code as comment

2005-01-07 Thread Luke Palmer
Stphane Payrard writes: canon( subjet = $mysub, complement = $mycomp ); canon( :subjet($mysub) :complement($mycomp) ); I suppose you meant canon( :subjet($mysub), :complement($mycomp) ); The comma is optional between those kinds of pairs. btw, are the parentheses

Re: Auto My?

2004-12-18 Thread Luke Palmer
Rod Adams writes: Considering that proper and common usage, not to mention strictures, dictates a heavy insistence on 'my'. I will thus assume that creation of lexical variables with 'my' far out numbers the creation of package space globals. Should we not then have it where it's the default

Re: Auto My?

2004-12-18 Thread Luke Palmer
JOSEPH RYAN writes: As bad of an idea that I think this is, I wonder if Perl6's reflection capabilities will be powerful enough to where a module/pragma could be written that would be able to do this? For instance, one idea was: lexically change the current grammar to a subclass of the

Re: Classes with several, mostly unused, attributes

2004-12-15 Thread Luke Palmer
Paul Hodges writes: That said, it's the strange and usually VERY old script that doesn't start with use strict; use warnings; Moreover, it should be a clue to us that there's a shirt stating: #!/usr/bin/perl -w use strict; Hinting that this is the way you start a perl program.

Re: iterators and functions (and lists)

2004-12-10 Thread Luke Palmer
Michele Dondi writes: On Mon, 6 Dec 2004, Larry Wall wrote: to return an infinite list, or even return 0..., 0...; to return a surreal list. Either of those may be bound to an array Hope not to bark something utterly stupid, but... if one iterates over such a list, may it be

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Luke Palmer
[ From p6i ] Patrick R. Michaud writes: On Fri, Dec 10, 2004 at 08:50:46PM +0100, Leopold Toetsch wrote: Not quite. It gives one value if one is true or 0 (false). This is more information then the perl5 implementation returns. The returned value (if any) is still true but usable, if I

Re: S05 question

2004-12-08 Thread Luke Palmer
Larry Wall writes: If we're going to stick with the notion that foo captures and something else doesn't, I'm beginning to think that the other thing isn't foo for a couple of reasons. I just sat down to say the exact same thing. I'm glad you beat me to it. And people would have to get used

Re: S05 question

2004-12-08 Thread Luke Palmer
Ashley Winters writes: I'm thinking capturing rules should be default in rules, where they're downright useful. Your hour/minute/second comment brings up parsing ISO time: grammar ISO8601::DateTime { rule year { \d4 } rule month { \d2 } rule day { \d2 } rule hour { \d2 }

Re: Lexical scope of parametric declaration blocks

2004-12-07 Thread Luke Palmer
Ashley Winters writes: In S12, I see examples like: role Pet[Type $petfood = TableScraps] { method feed (::($petfood) $food) {...} } I assume that means lexicals declared as part of a parametric specialization declaration block thingy are only visible within that scope, like a

Re: specifying the key Type for a Hash

2004-12-06 Thread Luke Palmer
David Green writes: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Larry Wall) wrote: Maybe type parameters are just subscripts? [...] my Fight %fight does key{Dog;Cat}; I like that. Yeah, me too. Except I'm having trouble seeing how key is a role. It's not adding anything into a

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

2004-12-06 Thread Luke Palmer
Larry Wall writes: Currently it does. There have been some rumblings in the design team that maybe it shouldn't. But it occurs to me that this might be another spot to have our cake and eat it to. We could say that for @foo - $input { ... $input ... } doesn't set the topic in the

Re: while Idiom (Was: Arglist I/O)

2004-12-06 Thread Luke Palmer
Smylers writes: To me Cfor makes sense when you've got a pile of stuff you're intending to process (such as array items or lines in a file), and Cwhile makes sense when you're waiting for a condition (such as the user correctly entering her/his password) and you couldn't possibly know in

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

2004-12-06 Thread Luke Palmer
Matthew Walton writes: Luke Palmer wrote: The remaining problem is what to do about unary dot. Repeated here for the, er, benefit? of p6l: class Duple { has $.left; has $.right; method perform (oper) { oper($.left); oper($.right

Re: iterators and functions (and lists)

2004-12-06 Thread Luke Palmer
Larry Wall writes: Any foo() can return a list. That list can be a Lazy list. So the ordinary return can say: return 0...; to return an infinite list, or even return 0..., 0...; Is it just me, or did you just return *2?

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

2004-12-05 Thread Luke Palmer
Dan Brian writes: 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 to pull, and use something like put/take for

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: flip flop xx Inf

2004-12-03 Thread Luke Palmer
Juerd writes: What happens to the flip flop operator? Will .. in scalar context remain the same? What comes in place of ...? (An adverb?) The scalar range operator was always a weird one for me, but that isn't to say that it hasn't been put to good use by wizards. I wouldn't be surprised if it

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Luke Palmer
John Siracusa writes: I guess I wasn't asking if it would be possible (I think that's been established), but if it would be easy, reasonable, or clean (as it appears to be in Python, although I'm just going by what the quoted web page says). I recall some discussions about the best way to

Re: Angle quotes and pointy brackets

2004-12-02 Thread Luke Palmer
John Williams writes: Is all the Extensible metasyntax (...) being changed to ... ? Or is the new rule that ... is capturing metasyntax, and ... is non-capturing metasyntax? That's the one. You can't really capture anything on an assertion, so /^foo .* ( do { say Got here! } or 1 ) .*

Re: qq:i

2004-12-01 Thread Luke Palmer
Larry Wall writes: Or maybe we just stick with what we already allow: my $name = 'add'; my $code = q[ sub \qq[$name] ($left, $right) { return $left + $right; } ]; After all, that's why we put \q interpolation into '' in the first place. Ahh yes.

Re: Angle quotes and pointy brackets

2004-11-30 Thread Luke Palmer
James Mastros writes: The problem with {} for a hash dereference operator is not it's typeablility, but rather it's autoquoting behavior from perl5. In perl5, the contents of {foo} are a string -- except when they aren't. Quick: $wheel-{roll} = 3; $wheel-{shift} = 4; In perl5,

Re: qq:i

2004-11-30 Thread Luke Palmer
Jim Cromie writes: since the qq:X family has recently come up, Id like to suggest another. qq:i {} is just like qq{} except that when it interpolates variables, those which are undefined are preserved literally. Eeeew. Probably going to shoot this down. But let's see where you're going

Re: Hyper Here-Docs?

2004-11-30 Thread Luke Palmer
Abhijit Mahabal writes: On Wed, 1 Dec 2004, Damian Conway wrote: Abhijit Mahabal wrote: I am a little confused if the following is valid perl6: our xsub = { $x }; No. Illegal attempt to assign to a reference. You want aliasing/binding instead: our xsub := { $x };

Re: Angle quotes and pointy brackets

2004-11-30 Thread Luke Palmer
All the cool kids are thinking aloud these days. Why not jump on the bandwagon? Larry Wall writes: * We get the cute, clean and rather more typeable $varkey1key2[3]key3 It looks like if you shook that up and down a bit, it would break in half. I wonder what would happen if we

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

2004-11-29 Thread Luke Palmer
Jon Ericson writes: Matthew Walton [EMAIL PROTECTED] writes: James Mastros wrote: Larry Wall wrote: Well, yes, but sometimes the weights change over time, so it doesn't hurt (much) to reevaluate occasionally. But in this case, I think I still prefer to attach the exotic characters to

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

2004-11-29 Thread Luke Palmer
Juerd writes: Luke Palmer skribis 2004-11-29 16:10 (-0700): http://groups.google.com/groups?selm=20040420175551.GA16162%40wall.orgrnum=1clarify It says that backticks won't be used at all in Perl 6. That's (the) one key of the keyboard that we're leaving to user-definition

Re: Will _anything_ be able to truly parse and understand perl?

2004-11-25 Thread Luke Palmer
Adam Kennedy writes: Herbert Snorrason wrote: On Thu, 25 Nov 2004 22:00:03 +1100, Adam Kennedy [EMAIL PROTECTED] wrote: And just after the snip you will see I qualify parse in this context as loading the perl in some form of DOM-type tree. And yet you disqualify the Perl6 rule system,

Re: S13: Deep operators

2004-11-24 Thread Luke Palmer
David Ross writes: How much of the overhead for method dispatch/return is or can be incurred at compile time? If call and return signatures are defined at compile time is it possible to eliminate switch code and/or jump tables as an optimumization? We hope so, in the absence of a pragma

Re: Will _anything_ be able to truly parse and understand perl?

2004-11-24 Thread Luke Palmer
Adam Kennedy writes: Getting (finally) to perl6, I could have sworn I saw an RFC early on which said Make perl6 easier to parse. But it would appear the opposite is occurring. Source filters have become grammars and will now be officially approved and acceptable (yes?) while so far as I

Re: S13: Deep operators

2004-11-23 Thread Luke Palmer
Matthew Walton writes: However, if I alter my operator overload to be multi sub *infix:+ (EvilNumber $lhs, EvilNumber $rhs) is deep { ... } I get *infix:+= defined as { $lhs = $lhs + $rhs; } for free. Is that right? Yep. Also, would things blow up if I specified the return types for

Ignore this message

2004-11-23 Thread Luke Palmer
Mail test. Sorry. Luke

Re: Perl6/Parrot and Backwards Compatability

2004-11-01 Thread Luke Palmer
Milscvaer writes: Running the old Perl5 interpretor and the Parrot in the same process is not a great solution, since this would mean that there would be two completely seperate interpretor codebases to support. A big part of Parrot is to allow several languages to use the same interpretor,

Re: Regular expressions and closures (was: Perl 6 Summary for 2004-10-01 through 2004-10-17)

2004-10-28 Thread Luke Palmer
Aaron Sherman writes: The current syntax for what you're trying to write is: /ab(c|b) ($1 eq 'c')/ which is equivalent to /ab(c|b) {fail unless $1 eq 'c'}/ Now, what does fail mean? I can think of two definitions: 1. proceed to trap state (backtracking then

Re: assorted questions

2004-10-25 Thread Luke Palmer
Rich Morin writes: In any case, one way of doing something like this in Perl might be to have the ability to register exceptions for a range of quite ordinary behavior, such as entering or leaving a statement, setting or even accessing a variable, etc. Or passing a variable to a function.

Re: S5 updated

2004-09-25 Thread Luke Palmer
Edward Peschko writes: I'd say that that's a caveat of implementation, sort of a side effect of handling an error condition. By your criteria there are very few inverses - you could say that multiplication isn't an inverse of division because of zero, for example. Err, that's funny, because

Re: S5 updated

2004-09-22 Thread Luke Palmer
First off, I'll point out that this belongs on p6l and nowhere else. Edward Peschko writes: It all comes down to what you think is a 'low level' op.. Some languages think that regular expressions themselves aren't low level enough to be included in the language, perl thinks that it is

Re: S5 updated

2004-09-21 Thread Luke Palmer
Edward Peschko writes: Ok, fair enough.. although I'm not sure that I'm all that sure I'm completely happy-with/understand the syntax described in that article. It works for the trivial cases, but what about complex grammars? It works for anything. It gets pretty inefficient in the case of

Unary dot and custom control

2004-09-20 Thread Luke Palmer
I came across this slight annoyance working in Perl 5 today: sub preserve() {...} sub foo { preserve { $_[0]-bar; } } That didn't call bar on the invocant of foo, but rather on undef, because preserve's block was a hiding sub. Perl 6 is making it easier

Re: S5: range quantifier woes

2004-09-18 Thread Luke Palmer
Dan Hursh writes: Second, if it is a problem that '?' is too far away, how about this? [foo]**{5..3} # greedy [foo]**{3..5} # lazy Because 5..3 is the empty list. This wasn't a mistake in Perl 5, so it's staying in Perl 6. Oh, is there a way to trick this closure syntax into being the

Re: S5: range quantifier woes

2004-09-18 Thread Luke Palmer
Kurt Hutchinson writes: For specifying in-rule repetitions, why not use the rule modifer we already have for specifying whole-rule repetitions; namely, C:x. Allow :x inside rules like :i and :w, and we get something like this: rx :w/ three m's\: [:3xm] / rx :w/ three

Re: Pipeline Performance

2004-09-18 Thread Luke Palmer
Rod Adams writes: Better documentation on gather/take is merited. Without a doubt. I would question the need for Cgather, however. Could not a lone Ctake/Cemit force the return value of the enclosing routine/closure to be a lazy list, and here's a few values to get things started? Cgather

Re: S5: grammar compositions

2004-09-15 Thread Luke Palmer
Dave Whipp writes: grammar Letter { rule greet :w { greet_word $to:=(\S+?) , $$} rule greet_word { [Hi|Hey|Yo] } ... } grammar FormalLetter is Letter { rule greet_word{ Dear } ... } Will the :w do the right thing here? In the new S5 revision, :w changed from

Re: [S3, S4, S5]: =~ becomes ~~

2004-09-15 Thread Luke Palmer
Herbert Snorrason writes: I know that, you know that ... but the synopses never actually say it. It's evident from context, but it's never said explicitly. I would *think* that should be in the Operator renaming section of S3, and presume this is an oversight? Okay, it ought to be there soon.

Re: But is it intuitive?

2004-09-14 Thread Luke Palmer
Abhijit Mahabal writes: On Tue, 14 Sep 2004, Austin Hastings wrote: I was thinking about removing files this morning, and realized that I wish rm supported inclusion/exclusion. In particular, I wanted to remove * but not Makefile (since my Makefile uses lwp-download to re-fetch the

Re: Synopsis 9 draft 1

2004-09-09 Thread Luke Palmer
John Macdonald writes: As an array index -1 and 0 give you the 2 ends. The perl5 code to alternately extract elements from the two eds of an array can be something like: my $end = 0; # -1 to start with right end while( @array ) { my $next = splice( @array, $end, 1 );

Re: What Requires Core Support (app packaging)

2004-09-05 Thread Luke Palmer
John Siracusa writes: I think the most important question was at the end of my last message: is something even *possible* without core support? Taking a set of scripts and libs and making single-file, compiled (or precompiled bytecode or whatever) executable that will run on all platforms

Re: The first shall be first (was Re: parameter contexts (was: Synopsis 9 draft 1))

2004-09-04 Thread Luke Palmer
David Green writes: The actual issue is how to distinguish cardinal numbers from ordinals, right? So if we want ordinal numbers, why not use ordinals? While we're here, I think perl should understand ordinals (http://mathworld.wolfram.com/OrdinalNumber.html), too. The syntax is quite ready

Re: S4: Can PRE and POST be removed from program flow?

2004-09-04 Thread Luke Palmer
John Siracusa wrote: Anyway, what it'll give me is official support for this type of thing. In particular, the Perl 6 executable itself should know what to make of such a specially formed dir tree how to adjust @INC automatically for me, what to run, etc.--in the same way that Perl 5 knows to

Re: Synopsis 9 draft 1

2004-09-03 Thread Luke Palmer
John Williams writes: On Thu, 2 Sep 2004, Larry Wall wrote: A multidimensional array is indexed by a semicolon list, which is really a list of lists in disguise. Each sublist is a slice of one particular dimension. So @array[0..10; 42; @x] is really short for

Re: Roles trying to be nice

2004-08-29 Thread Luke Palmer
Abhijit Mahabal writes: Traits can be mean, but roles are guarenteed(=forced?) to play nice. But suppose I have a role that wants to play nicer, by ensuring that incorporating it in some class actually makes sense. For example, it may want to ensure that the class has $.foo. (*) Let me

Re: S5 tr concern

2004-08-27 Thread Luke Palmer
Aaron Sherman writes: Specifically, hashes do not maintain ordering, so a program like this: $downcaserule = 'A-Z' = 'a-z'; $l33trule = 'EISTA' = '31574'; $str =~ tr( { $l33trule, $downcaserule } ); may or may not do what the naive reader expects, and randomly so!

Re: Return with no expression

2004-08-23 Thread Luke Palmer
Juerd writes: Where :: (in a module name) can be used, an operator could have been used. How is $foo??Bar::Baz::Quux parsed? $foo ?? Bar::Baz::Quux; # error, :: expected Indeed, this is illegal: Bar::Baz :: Quux.new; No whitespace allowed. I hope it's an error, although some

Re: Return with no expression

2004-08-23 Thread Luke Palmer
Aaron Sherman writes: Luke Palmer wrote: $foo??split()::0; Ought to be fine Imagine the shock of the first guy who rezlizes he got the logic backwards and bug-fixes it to: $foo??0::split() ouch! Yeah, seriously. I mean, what a subtle bug! It would take him hours

Re: A thought for later -- POD tables

2004-08-21 Thread Luke Palmer
Aaron Sherman writes: Larry Wall wrote: $_ $xType of Match ImpliedMatching Code == = == Any Code$ scalar sub truth match if $x($_) This bit of POD made me think about POD's lack of tabular formatting,

Re: Synopsis 2 draft 1 -- each and every

2004-08-21 Thread Luke Palmer
David Green writes: On 8/20/04, [EMAIL PROTECTED] (Luke Palmer) wrote: So all the laziness goes into the array implementation. But you don't even need to write your iterator fancily. If you just write your scalar version of postcircumfix:, Perl will do the rest. So if you use an iterator

Re: Synopsis 4 draft 1

2004-08-20 Thread Luke Palmer
Aaron Sherman writes: Larry Wall wrote: leave :from(Loop) :labelLINE == 1,2,3; [...] leave == :foo:bar:baz(1) if $leaving; I know it's probably just me, but This section seems to suddenly rely on a lot more knowledge of the current state of Perl 6 syntax than I have. Can someone

Re: Synopsis 2 draft 1 -- each and every

2004-08-20 Thread Luke Palmer
David Green writes: Then I thought that maybe for doesn't need to work lazily (except that the conveniently just-posted Synopsis 4 confirms that it is supposed to be lazy). Or maybe for is only as lazy as is reasonable, meaning if it knows how (e.g. if you're using an array or filehandle,

Re: Synopsis 2 draft 1 -- each and every

2004-08-20 Thread Luke Palmer
Austin Hastings writes: Larry Wall wrote: Hmm. Gotta decided if S$foo.bar() is too ugly to live though... It is. Agreed. I still kinda like underscore. How about scalar? The fact that one person, one time, came up with a need to invoke it doesn't mean we have to race it up the

Re: adverbs

2004-08-20 Thread Luke Palmer
Larry Wall writes: On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote: : :say .meth :foo;# say( .meth( foo=1 ) ) That one works. But that's because :foo is an adverb to .meth, not because .meth is taking an argument 'foo' = 1, right? Likewise sqrt($x):both

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