Greetings

2002-03-11 Thread Luke Palmer
operators seem to be a contrived attempt at being revolutionary, without providing much practicality. Not to bash them or anything :-P Luke Palmer, [EMAIL PROTECTED]

Re: rethinking printf

2002-03-18 Thread Luke Palmer
On Mon, 18 Mar 2002, Jim Cromie wrote: Rich Morin wrote: At 11:24 PM -0500 3/6/02, Uri Guttman wrote: qn would be just like qq but not allow any direct hash interpolations (%foo or %foo{bar}). you can always get those with $() if needed. this solves the common case with a

Re: Perl6 Macros

2002-03-28 Thread Luke Palmer
How about we implement some way to peer into coderefs? Maybe just on the top level, with attributes, or maybe a syntax tree (probably not). Because here, what both arguments (in the discussion) are missing, is the ability to look at their arguments' (the uh, ones you pass in) internal

Re: Tree Transformations (was: Perl6 Macros)

2002-03-29 Thread Luke Palmer
Too late. I'm going there... :) Good for you. I was hoping transformations could make it :) Here's something I was wondering. Say you wanted to write a pow() macro (from a previous example) that would forward to C's pow() unless the exponent was an integer, in which case it would optimize to

Re: Regex extensions?

2002-04-01 Thread Luke Palmer
If my proposal has a hidden agenda, it's that I want to show that you can get a lot of the power we want without actually having to embed arbitrary code. In general, however, I think that embedding code in regexes is a *very* good idea. Sure you can get a lot of power without it, but it is

Re: $^a, $^b, and friends

2002-04-03 Thread Luke Palmer
On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote: Reading EX4 and seeing those place-holder variables made me wonder what Where is EX4? It's not at perl.org... so... ??

Re: Exegesis 4

2002-04-03 Thread Luke Palmer
Larry has said very clearly that in Perl 6 there are no magical lexical scopes. That is, variables declared in a Cloop control aren't magically in the following block. However, I don't agree with him. It may be more intuitive to newcomers, but it is a common programming idiom that is used a

Re: Exegesis 4

2002-04-03 Thread Luke Palmer
{ my subs; loop (my $x = 0; $x 10; $x++) { push subs, { $^a + $x }; } $x--; # ... } This certainly does *not* DWIM in the current thought. And the silence would be much more confusing than a simple syntax error the traditional way with

The new =~, and chaining statement modifiers

2002-04-03 Thread Luke Palmer
So, does the new =~ commute now, except for regexps; i.e. $a =~ $b is the same as $b =~ $a unless one or both are regexps? Additionally, can you chain statement modifiers? do_this() if $a unless $b; print for mylist if $debug; or less efficiently, print if $debug for mylist; print $x,

Re: http://archive.develooper.com/perl6-announce-rfc@perl.org/msg00318.html

2002-04-04 Thread Luke Palmer
On Thu, 4 Apr 2002, James Ryley wrote: Hi, I was wondering if anything ever became of the comments at http:[EMAIL PROTECTED]/msg00318.html? I have an application that would benefit from double interpolation. Of course I can work around it, but double interpolation would be so much

Re: http://archive.develooper.com/perl6-announce-rfc@perl.org/msg00318.html

2002-04-05 Thread Luke Palmer
On 4 Apr 2002, Aaron Sherman wrote: On Thu, 2002-04-04 at 11:09, Luke Palmer wrote: On Thu, 4 Apr 2002, James Ryley wrote: How 'bout: $foo = 'def'; $bar = 'ghi'; $y = 'abc$foo$bar'; $z = eval qq{$y}; Of course, for security and correctness reasons, you'd probably want

Re: $^a, $^b, and friends

2002-04-05 Thread Luke Palmer
Just some thoughts in case you assumed people would only us Perl for good. $_='opcpez/xsjuft/qzax/,kvtu/gps/hppe!' ;szaxfsmyb-z,/!a-y !-print;

Re: http://archive.develooper.com/perl6-announce-rfc@perl.org/msg00318.html

2002-04-05 Thread Luke Palmer
By ultimate control, I meant that if you have an interpolate command, you can then do whatever you want at each stage. You could do: $z = interpolate interpolate $y; Good point. Well, we were brainstorming macros for a reason ;). But an efficient version would be nice, I suppose.

Re: $^a, $^b, and friends

2002-04-05 Thread Luke Palmer
You can do anything you like if you mess with the parser. Changing the rules for recognizing an identifier would be trivial. Does this refer to messing with the parser... compile time (that is, when Perl compiles, not when Perl is compiled)? Or are you actually talking about screwing with

Re: Ex4 smart match question

2002-04-05 Thread Luke Palmer
On Fri, 5 Apr 2002 [EMAIL PROTECTED] wrote: Does one of these items not belong? From Exegesis 4: This new turbo-charged 'smart match' operator will also work on arrays, hashes and lists: if @array =~ $elem {...}# true if @array contains $elem if $key =~ %hash

Re: Bracekets

2002-04-08 Thread Luke Palmer
As to the inspring issue about using [] for hashes, I say go for it if (and only if) it is a signifigant improvement for the parser. I would imagine it's not. The braces are one of the things that make Perl feel like Perl. My original post that inspired this gigantic discussion was simply

Re: Bracekets

2002-04-09 Thread Luke Palmer
If the new, spiffy features of Perl6 are out of my reach that 60-80% of the time, and I have to use perl5compat -nle ..., then the usefulness of this new language will be largely lost on me. I'm not sure I follow. What hypothetical features are you talking about here? From what I've seen,

Re: Unary dot

2002-04-10 Thread Luke Palmer
$.foo It's already defined as an instance variable. I don't think I like that. Instance variables are far more common that class variables, so why not just $foo, and you could use a compile-time property for class variables. Like Cis private as discussed. That or Cis static. I

Re: Unary dot

2002-04-10 Thread Luke Palmer
Ah, but I think the mnemonic value of the '.' more than earns its keep here. Cour $foo is private is doing a slightly different job anyway. And instance variables are *not* the same as 'normal' variables, they hang off a different symbol table (or syte, to use Damian's oh so clever term from

Re: Defaulting params

2002-04-10 Thread Luke Palmer
On Thu, 11 Apr 2002, Piers Cawley wrote: Miko O'Sullivan [EMAIL PROTECTED] writes: The current plans indicate that a subroutine's params should be defaulted like this: sub load_data ($filename ; $version / /= 1) {...} (The space between / and / is on purpose, my emailer has

Re: Defaulting params

2002-04-11 Thread Luke Palmer
class myobj { ... int a,b,c; myobj(int aa, int bb, int cc) : a(aa), b(bb), c(cc) const {} ... }; Ummm no. Straight from Bjarne: You can't have a const constructor. You just do what you did without

Re: How to default? (was Unary dot)

2002-04-12 Thread Luke Palmer
On Fri, 12 Apr 2002, Trey Harris wrote: I think I've missed something, even after poring over the archives for some hours looking for the answer. How does one write defaulting subroutines a la builtins like print() and chomp()? Assume the code: for { printRec; } printRec

Re: Fisher-Yates shuffle

2002-04-12 Thread Luke Palmer
On Fri, Apr 12, 2002 at 04:42:07PM +0100, Piers Cawley wrote: [EMAIL PROTECTED] writes: Why isn't if %foo {key} {print Hello 1} equivalent with the perl5 syntax: if (%foo) {key} {print Hello 1} Which keyword is it expecting? Keyword /els(e|if)/, or end of line, or

Re: Subroutine variables are like underwear

2002-04-12 Thread Luke Palmer
On Fri, 12 Apr 2002, Miko O'Sullivan wrote: SUMMARY A way to declare public names for params irrelevant to the internal variable names: sub load_data (-filename $filename_tainted ; 'version' 'ver' $version_input / /= 1) {...} I like it. It's clean (doesn't introduce any wierd

Re: How to default? (was Unary dot)

2002-04-13 Thread Luke Palmer
There'd be an interaction between is topic_preserving, default parameter values, and explicit parameter values which should be clarified. Now I understand why someone suggested using //= $_ instead of is topic_preserving, somewhere along the line. Clearly if the user supplies the

Re: Unary dot

2002-04-15 Thread Luke Palmer
On Mon, 15 Apr 2002, Damian Conway wrote: More interestingly, it may also be that, by default, the Coperator:{} (i.e. hash-look-up) method of a class invokes the accessor of the same name as the key, so that: I'm a tad bit confused on the grounds of classes. Are we allowed to: %fred = new

Re: Cfor loop variations

2002-04-16 Thread Luke Palmer
Now, I love that the for loop can do both of these things, but the subtlety of the difference in syntax is likely, IMO, to lead to very difficult- to-find bugs. It's very easy to miss that I've used a comma when I meant to use a semicolon, and vice versa. And what's the mnemonic again? Well,

Re: Please rename 'but' to 'has'.

2002-04-21 Thread Luke Palmer
On Fri, 19 Apr 2002, Daniel S. Wilkerson wrote: Please don't use 'but' to associate runtime properties to things. Please call it 'has'. How about both? Luke

Re: Please rename 'but' to 'has'.

2002-04-21 Thread Luke Palmer
On Sat, 20 Apr 2002, Daniel S. Wilkerson wrote: Everyone I've ever talked to about it agrees that defining things to be a negative is just a bad idea. Consider: if (gronk) do_this(); else do_that(); versus if (not_gronk) do_that(); else do_this(); But look how well Cunless reads

Re: Regex and Matched Delimiters

2002-04-22 Thread Luke Palmer
(?=...) before: ... (?!...) !before: ... (?=...) after: ... (?!...) !after: ... (?...) grab: ... Yummy :) I'd say this is about perfect. The look(ahead|behind)s, er, look:ahead|behinds are used seldom enough that this is

RE: Regex and Matched Delimiters

2002-04-23 Thread Luke Palmer
# =~ $re =~ /$re/ ouch? I don't see the win. Naturally =~ $re is a bit cleaner, but we can't do that because =~ is smart match, not regex match. # (?=...) before: ... # (?!...) !before: ... # (?=...)after: ... # (?!...)

Re: Regex and Matched Delimiters

2002-04-23 Thread Luke Palmer
On Wed, 24 Apr 2002, Iain Truskett wrote: * Larry Wall ([EMAIL PROTECTED]) [23 Apr 2002 11:56]: [...] * Parens always capture. Maybe I missed something in the rest of the details, but is anything going to replace non-capturing parens? It's just that I do find them quite useful.

Re: Loop controls

2002-04-25 Thread Luke Palmer
foreach my $var (arr) { ... } You mean foreach arr - $var {...} before { ... } # run before first iteration, only if there is at least one iteration after { ... } # run after last iteration, only if there is at least one iteration noloop { ...

Re: Loop controls

2002-04-26 Thread Luke Palmer
On Fri, 26 Apr 2002, Allison Randal wrote: Besides, I would expect an Celsfor to actually be a loop of it's own, on the principle of elsif = else + if so elsfor = else + for. So, you're suggesting we add Celsunless then? Just because it's possible doesn't mean it's necessary. Luke

Re: Loop controls

2002-04-29 Thread Luke Palmer
See above. Two issues spring to mind: 1) Do we have a reality check on why this syntax is needed? I agree it's cool idea, but can anyone name a real-world scenario where it would be useful? Can we do things just bcause they're cool? That approach didn't work too well for me as

Re: Loop controls

2002-04-29 Thread Luke Palmer
So, the answer to your question is: yes, I do propose that there should be an elsif, elsloop and elsfor. That's it. Three words, not an expansive list of ever-more-complex words. Oh! I have an idea! Why don't we make the lexer just realize a prefix els on any operator. Then you could do Cif

Re: Loop controls

2002-04-30 Thread Luke Palmer
On Tue, 30 Apr 2002, Miko O'Sullivan wrote: Damian, now having terrible visions of someone suggesting Celswhen ;-) Then may I also give you nightmares on: elsdo, elsdont, elsgrep, elstry ... Ooh! Why don't we have a dont command! With several variants: dont FILE dont BLOCK

Re: Loop controls

2002-04-30 Thread Luke Palmer
On Tue, 30 Apr 2002, Trey Harris wrote: Why not allow Celse if while still allowing Celsif as a synonym, preserving backwards compatibility while still allowing all these weird and varied constructs people seem to have use for? Backwards compatability is pretty much a lost cause for Perl 6.

Re: Loop controls

2002-04-30 Thread Luke Palmer
On Tue, 30 Apr 2002, Jim Cromie wrote: so, assuming we have; print 'you gave me: wordlist = ';# single quote - no interpolation for words - $it { print; FIRST { print '(' }# provisionally NEXT { print ',' } LAST {print ');' } } # and maybe else { print

Re: eval {} or carp blah: $@

2002-05-02 Thread Luke Palmer
On Thu, 2 May 2002, Jim Cromie wrote: with p5, Ive often written eval {} or carp $ blah; it seems to work, and it reads nicer (to my eye) than eval {}; if ($) {} but I surmise that it works cuz the return-value from the block is non-zero, for successful eval, and 0 or undef when

Re: Loop controls

2002-05-06 Thread Luke Palmer
Oh. Sorry. I suppose there was no discussion because there were no objections. I support it strongly. But everyone's already heard my opinion, and my opinion, and my opinion about it, so I'll be quiet now. Luke On 6 May 2002, Aaron Sherman wrote: It's odd, folks are still talking about the

Methods, and such

2002-05-15 Thread Luke Palmer
It seems something messed up while I tried to send this earlier. If this is essentially a duplicate, ignore it. I've always liked how VB allowed you to do instance methods. They allow for more elegant callbacks, and more structure if callbacks are complicated. Will Perl6 allow this? (Perl5

RE: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-17 Thread Luke Palmer
On 16 May 2002, Aaron Sherman wrote: On Thu, 2002-05-16 at 16:13, David Whipp wrote: Aaron Sherman [mailto:[EMAIL PROTECTED]] wrote: You might not be able to REASONABLY get a length, so you return undef. In your documentation, you advise users not to take the length, but just dive

Backslashes

2002-05-20 Thread Luke Palmer
I'm sort of side-tracking from the trend of discussions, but I was just thinking that I always found it annoying how you had to double backslashes in single-quoted strings. I like the bash's behavior with regard to this much better... I mean, the whole idea behind single-quoted strings is

Re: Idea

2002-05-22 Thread Luke Palmer
On Wed, 22 May 2002, Chris Angell wrote: Everyone, Please correct me if I am emailing the wrong address/list. Thanks. Well, in general, you are mailing the wrong list; however, we do know a lot of perl 5, so you'll get your question answered :) (This is the Perl 6 list, used for

Re: Idea

2002-05-23 Thread Luke Palmer
The rest of this message assumes that the answer to A is run time error. I'm not sure that's correct. Might just be a runtime warning, I would assume not. How can we optimize if we just make it a warning?

Convention

2002-05-24 Thread Luke Palmer
I hate to solicit, but I have a favor to ask someone who is willing. I would very much enjoy attending the O'reilly Open Source convention, particularly the Perl conference; however, I am less that wealthy (seeing as how I'm only 17). Would someone extremely generous be willing to donate any

Re: Perl6 currying

2002-05-28 Thread Luke Palmer
On Tue, 28 May 2002, Glenn Linderman wrote: with reads very nicely, but we already have a perl6 precedent, perhaps... how about reusing when as the method name for currying? This may not curry favor with Damian, but I suggest my half = div.when(y = 2); would declare the subroutine

Re: 6PAN (was: Half measures all round)

2002-06-04 Thread Luke Palmer
Hmm... I like it. It took me a good 6 months before I learned how to use CPAN. I don't see how your proposal is that different from: alias cpan='perl -MCPAN -e shell' But I get the idea. Someone (well, you've inspired me now, so I) could write a perl5 equivilent, because command line is

Auto-capturing

2002-06-05 Thread Luke Palmer
I just read through A5 (wow, that's long), and I agree with most of it. Some of it's really cool. Here's what makes me uneasy: The fact that a grammar rule auto-captures into a variable of its name. Is this efficient? If I'm writing a syntax-directed translator, I usually don't need to

Re: Apoc 5 questions/comments

2002-06-07 Thread Luke Palmer
Note: My answers are non-authoritative. Don't trust me. Can we please have a 'reverse x' modifier that means treat whitespace as literals? Yes, we are living in a Unicode world now and your data could theoretically be coming in from a different character set than expected. But there are

Re: Apoc 5 questions/comments

2002-06-07 Thread Luke Palmer
The most serious objection to this was 'well, use modules for matching *ml - which simply points out that the current incarnation of perl6 regex doesn' t handle a very large class of matching problems very well. The modules use regexes. They just spend more time on them and make them better

Re: Apoc 5 questions/comments

2002-06-07 Thread Luke Palmer
On Fri, 7 Jun 2002, John Siracusa wrote: On 6/7/02 4:48 PM, Luke Palmer wrote: rule tag($name) {:w \ $name %opts:=[ (\S+)=(\S+) ]* \ } Then, you can match an img tag with: / tag 'img' / See, isn't that great? Don't you mean, see, isn't that massively over-simplified

Re: Apoc 5 questions/comments

2002-06-11 Thread Luke Palmer
Dave Storrs wrote: Can we please have a 'reverse x' modifier that means treat whitespace as literals? Yes, we are living in a Unicode world now and your data could /FATAL ERROR\:Process (\d+) received signal\: (\d+)/ I don't see how this example is nearly as flexible as

lex behavior

2002-06-13 Thread Luke Palmer
I'm still unclear as to how you implement lex-like longest token rule with P6 regexes. If the | operator grabs the first one it matches, how do I match bacamus out of this?: bacamus =~ / b.*a | b.*s / Luke

Re: lex behavior

2002-06-13 Thread Luke Palmer
I figured that (I actually did it, in a less-pretty form, in my early Perl days when I wrote a syntax highlighter for my website). So there's no elegant way the new regexes support it? That's a shame. But I see now how state objects are a very cool idea. Oh, and I'd just thought I'd let

m:foobar syntax

2002-06-13 Thread Luke Palmer
I came across this problem when writing the vim syntax file: How can we tell the difference between these?: m:option(pattern) m:option(argument)/pattern/ Luke

Re: Simple RegExp (Ap5) question

2002-06-15 Thread Luke Palmer
On 15 Jun 2002, Alberto Manuel Brandão Simões wrote: If spaces delimit tokens, /abc* def/ means in perl5 /abc*def/ or /(?:abc)*def/ ? Thanks Alberto The former.

Re: Implementing Parse::RecDescent directives

2002-06-15 Thread Luke Palmer
Now, could you just do rule leftop ($leftop, $op) { $leftop [$op $leftop]* } rule leftop ($leftop, $op, $rightop) { $leftop [$op $rightop]* } I should hope that rules can take multiple arguments. Here's something that made me wonder, though: the

Re: More 6PAN musings: local namespaces

2002-06-15 Thread Luke Palmer
On Sun, 16 Jun 2002, Michael G Schwern wrote: On Sat, Jun 15, 2002 at 10:35:48PM -0400, John Siracusa wrote: Once nice thing about Java is the class naming convention that lets individual companies (or even individuals, I guess) do custom development that they can safely integrate with

Re: Ruby iterators

2002-07-02 Thread Luke Palmer
On Tue, 2 Jul 2002, Michael G Schwern wrote: On Fri, Jun 28, 2002 at 01:21:50PM -0700, Erik Steven Harrison wrote: Over on Perlmonks someone was asking about Perl 6's ability to have named argument passing. He also asked about the Jensen Machine and Ruby iterators. Now, just being on this

Re: what's new continued

2002-07-03 Thread Luke Palmer
case2 - hyperoperator : my $result = 0; for ($a,$b,$c) { if ($x == $_) { $result =1; last} } Not correct. The second case is the same as: ($x == $a, $x == $b, $x == $c) which reduces in effect to: $x == $c Hold on---something's awry here. I thought C

Re: Suggestions

2002-07-07 Thread Luke Palmer
On Sun, 7 Jul 2002, Bill Atkins wrote: 1. Perl6 should include a has and have keyword to set properties more clearly: Already been over this. Answer was no for some reason. my $var has Found; See, then you need a direct object. IWhat is it that C$var has found? :) (sortof) Seriously, we

Vim Syntax

2002-07-08 Thread Luke Palmer
For anyone interested, http://fibonaci.babylonia.flatirons.org/perl6.vim contains a fairly complete (yet buggy, I'm sure) vim highlighting file for Perl 6. I sure hope I didn't already post this :(... if so, sorry. And definitely tell me where there's bugs or when I'm missing

Re: Perl 6 Summary for week ending 20020714

2002-07-15 Thread Luke Palmer
..., and someone pointed out that it had a problem with code like { some_function_returning_a_hash() }. Should it give a closure? Or a hash ref? ... Oh, well now that it's stated this way... (something went wrong in my brain when I read the actual message) It returns a closure

Re: hyper operators - appalling proposal

2002-07-15 Thread Luke Palmer
On Mon, 15 Jul 2002, Karl Glazebrook wrote: In Apocalypse 2 Larry Wall wrote: RFC 082: Arrays: Apply operators element-wise in a list context APL, here we come... :-) This is by far the most difficult of these RFCs to decide, so I'm going to be doing a lot of thinking out loud

Re: Grammar ambiguities again (was: Perl 6 Summary for week ending

2002-07-15 Thread Luke Palmer
On Tue, 16 Jul 2002, Deborah Ariel Pickett wrote: I still have my vote on %() as a hash constructor in addition to {}. :) The problem I see with that is that % as a prefix implies a *dereferencing*, though years of Perl5 conditioning like this: %{ $mumble } = return_a_hash();

Re: Quick Perl 6 regex question

2002-07-16 Thread Luke Palmer
On Tue, 16 Jul 2002, Brent Dax wrote: I was reading through the Monastery, and I noticed a node (about the line between what's considered Perl discussion and what's off-topic) that had this regex in it: m:iw/how [do[es]?|can] [I|one] tasks in non_perl_languages/ (Yes, people are

Re: RFC - Hashing PMC's albie@halfarrabio.di.uminho.pt

2002-07-25 Thread Luke Palmer
On 25 Jul 2002 [EMAIL PROTECTED] wrote: Personally I don't like the C is Hashed::ByValues because it smacks of spooky action at a distance; I much prefer my notion of C %h{*@x} = 1. And in Perl 6 I have the horrible feeling that C %h = (*@x = 1) would expand to C %h = (1,2,3 = 1) ,

Re: RFC - Hashing PMC's albie@halfarrabio.di.uminho.pt

2002-07-25 Thread Luke Palmer
On 25 Jul 2002 [EMAIL PROTECTED] wrote: Luke Palmer [EMAIL PROTECTED] writes: On 25 Jul 2002 [EMAIL PROTECTED] wrote: Personally I don't like the C is Hashed::ByValues because it smacks of spooky action at a distance; I much prefer my notion of C %h{*@x} = 1. And in Perl 6 I

Re: Autovivi

2002-08-14 Thread Luke Palmer
From: Larry Wall [EMAIL PROTECTED] The default is pass-by-reference, but non-modifiable. If there's a pass-by-value, it'll have to be specially requested somehow. This is a minimal difference from Perl 5, in which everything was pass-by-reference, but modifiable. To get pass-by-value,

Re: Copy-restore on parameters? (was Re: Autovivi)

2002-08-15 Thread Luke Palmer
On Thu, 15 Aug 2002, Deven T. Corzine wrote: On Thu, 15 Aug 2002, Larry Wall wrote: On Thu, 15 Aug 2002, Deven T. Corzine wrote: : I've got another idea. How about using a copy-restore technique? I suspect that would make Perl 6's sub calls even slower than Perl 5's. Yes and no.

Re: Just reading up on Pike...

2002-08-16 Thread Luke Palmer
Well, I'm still hopeful Larry will approve superpositions. In which case, since types in Perl 6 are first-class, you would be able to write the same thing something like: class Foo { attr any(str,int) $bar; method SETUP(any(str,int) $newBar) {

Re: rule, rx and sub

2002-08-25 Thread Luke Palmer
Funny you should mention that. This brings up something that I was afraid to mention before, lest it be regarded as too weird. There isn't any strong syntactic reason for subs to be delimited with just braces either.[*] Sure, there's a historical Perl precedent, and I'd probably be forced

Re: rule, rx and sub

2002-08-25 Thread Luke Palmer
On Sun, 25 Aug 2002, Glenn Linderman wrote: Deborah Ariel Pickett wrote: I'm imagining a table something like this: Subroutine Pattern matching Default { code }

Re: rule, rx and sub

2002-08-26 Thread Luke Palmer
The only extra piece of syntactic sugar that Crx is giving us over Crule[*] is the ability to have arbitrary delimiters. Not quite arbitrary. Alphanumerics aren't allowed, nor are colon or parens. Aww, no alphanumerics anymore. That's too bad; it was so nice in poetry to be able to

Re: rule, rx and sub

2002-08-27 Thread Luke Palmer
On 27 Aug 2002, Piers Cawley wrote: Damian Conway [EMAIL PROTECTED] writes: Debbie Pickett asked: (Offtopic: can I say: $c = - $xyz { mumble } Yes. Though you need a semicolon at the end unless its the last statement in a block. Um... when did that rule come in? I thought a

Re: rule, rx and sub

2002-08-27 Thread Luke Palmer
On Tue, 27 Aug 2002, Sean O'Rourke wrote: On Tue, 27 Aug 2002, Luke Palmer wrote: On 27 Aug 2002, Piers Cawley wrote: Damian Conway [EMAIL PROTECTED] writes: Debbie Pickett asked: (Offtopic: can I say: $c = - $xyz { mumble } Yes. Though you need a semicolon

Re: need help on perl scripts #1 newuser.pl

2002-08-28 Thread Luke Palmer
This is really the wrong place to be sending this. This is Perl 5 (or maybe even Perl 4, which I don't know) code, and this is a list for discussing the design of Perl 6. A good place to send this would probably be [EMAIL PROTECTED] Good Luck, Luke On Wed, 28 Aug 2002, frank crowley

Re: Hypothetical synonyms

2002-08-28 Thread Luke Palmer
On Thu, 29 Aug 2002, Steffen Mueller wrote: Nicholas Clark wrote: On Thu, Aug 29, 2002 at 12:00:55AM +0300, Markus Laire wrote: And I'm definitely going to try any future PerlGolf challenges also in perl6. Is it considered better if perl6 use more characters than perl5? (ie implying

Re: rule, rx and sub

2002-08-28 Thread Luke Palmer
Second, is there a prototype-way to specify the arguments to for (specifically, the first un-parentesized multidimensional array argument)? In other words, is that kind of signature expected to be used often enough to justify not forcing people to explicitly extend the grammar? If you're

Re: Hypothetical synonyms

2002-08-29 Thread Luke Palmer
The ° character doesn't have any special meaning, that's why I choosed it in the above example. However, it also symbolizes a little capturing and as it isn't filled, it could really symbolize an uncapturing. Interesting idea. I'm not sure if I agree with it yet. However, I don't agree

Re: @array = %hash

2002-09-03 Thread Luke Palmer
Hmm... I think I'd rather see my $foo is Bag = array.as('Bag'); The idea being that one could treat hashes and arrays as syntactic vitamins meaning 'Dictionary' (to use the Smalltalk term) and 'OrderedCollection', but all Collections would implement an Cas method allowing conversion

RE: atomicness and \n

2002-09-03 Thread Luke Palmer
On Tue, 3 Sep 2002, Brent Dax wrote: Damian Conway: # Neither. You need: # # $roundor7 = rx /roundascii+[17]/ # # That is: the union of the two character classes. How can you be sure that roundascii is implemented as a character class, as opposed to (say) an alternation?

Re: User-defined character classes and repeat counts

2002-09-04 Thread Luke Palmer
Aaron Sherman wrote: So, for example here are some translations of existing operators: + ={.count 0} * ={1} *?={1}? 8 ={.count == 8}# No optimization possible! Could it be done this way?: c:=(.)* ( c == 8 ) Surely inefficient, but it works

RE: First crack at Builtins.p6m

2002-09-05 Thread Luke Palmer
On 5 Sep 2002, Aaron Sherman wrote: On Thu, 2002-09-05 at 01:47, Brent Dax wrote: Aaron Sherman: The one thing I notice all over the place is: sub abs($num is int){ return $num=0 ?? $num :: -$num } Another thing I'm not sure on... how do you force numeric, but not integer

Re: More A5/E5 questions

2002-09-06 Thread Luke Palmer
Answering to the best of my knowledge. On Sat, 7 Sep 2002, Jonathan Scott Duff wrote: Question #2: Why are we storing the hypothetical's sigil in the match object? I think it's to differentiate the different namespaces (scalar, array, hash) within the match object's hash. Personally, I

Re: Suggestion for perl 6 regex syntax

2002-09-07 Thread Luke Palmer
On Fri, 6 Sep 2002, Mr. Nobody wrote: While Apocolypse 5 raises some good points about problems with the old regex syntax, its new syntax is actually worse than in perl 5. Most regexes, such as this one to match a C float /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ would actually

Re: Throwing lexicals

2002-09-09 Thread Luke Palmer
Going back to patterns, this gives us an added bonus. It not only explains the behavior of hypotheticals, but also of subexpression placeholders, which are created when the pattern returns: $self but lexicals(0=$self, 1= $self.{1}, 2= $self.{2}, etc...) That yields the side

Re: Throwing lexicals

2002-09-09 Thread Luke Palmer
On Mon, 9 Sep 2002, Andrew Wilson wrote: On Mon, Sep 09, 2002 at 02:14:25PM -0500, Me wrote: Hence the introduction of let: m/ { let $date := date } / which makes (a symbol table like entry for) $date available somewhere via the match object. Somewhere? where it appears in

Re: Blocks and semicolons

2002-09-11 Thread Luke Palmer
This is for everyone: EOA4 In Perl, this problem comes up most often when people say Why do I have to put a semicolon after do {} or eval {} when it looks like a complete statement? Well, in Perl 6, you don't, if the final curly is on a line by itself. That is, if you

Re: Blocks and semicolons

2002-09-11 Thread Luke Palmer
Luke Palmer wrote: [quote from A4] To me, this looks like it has answers to all these questions. Up to a point. Look at the discussion of given/when in the same Apocalypse. Here's some example code from A4: given $! { when Error::Overflow { ... } when Error

Re: Blocks and semicolons

2002-09-12 Thread Luke Palmer
On Thu, 12 Sep 2002, Ken Fox wrote: Luke Palmer wrote: This requires infinite lookahead to parse. Nobody likes infinite lookahead grammars. Perl already needs infinite lookahead. Anyways, most people don't care whether a grammar is ambiguous or not -- if we did, natural human

Re: Blocks and semicolons

2002-09-12 Thread Luke Palmer
BTW, there are some parser generators that handle ambiguous grammars -- they either support backtracking, infinite lookahead, or simultaneously parse all possible derivations. In the case of the simultaneous parse, they can actually return multiple parse trees and let the code generator

Re: hotplug regexes, other misc regex questions

2002-09-18 Thread Luke Palmer
On Wed, 18 Sep 2002, Josh Jore wrote: On Wed, 18 Sep 2002, Damian Conway wrote: Would it be correct for this to print 0? Would it be correct for this to print 2? my $n = 0; aargh =~ /a* { $n++ } aargh/; print $n; Yes. ;-) Wouldn't that print 2 if $n is lexical

Re: Regex query

2002-09-20 Thread Luke Palmer
I was just thinking that $((1,2,3)) is also the same as [1,2,3], and shorter than scalar(1,2,3). I wonder if you can't just use $(1, 2, 3) to the same effect. I think you can. I was under the impression that the C comma was dying, so that would have to make a list or err. Also, I

Re: Regex query

2002-09-20 Thread Luke Palmer
On Fri, 20 Sep 2002, Chip Salzenberg wrote: According to Luke Palmer: I think to get Perl5 behavioueaur :), you do this: my flatL = ( *(1a, 2a), *(1b, 2b) ); Geez, I hope not, because that would imply that in my v = ( func() ); that func is called in a scalar context

Re: Passing arguments

2002-09-21 Thread Luke Palmer
On 21 Sep 2002, Smylers wrote: Larry Wall wrote: On 20 Sep 2002, Aaron Sherman wrote: : Does that mean that I can't : : for $x - $_ { : for $y - $z { : print $_, $z\n; : } : } : : And expect to get different

Re: Regex query

2002-09-21 Thread Luke Palmer
On 21 Sep 2002, Smylers wrote: Luke Palmer wrote: my v = $( func() ); Would provide scalar context. But then assign it to a list... In the course of reading that I developed a concern about memory usage when trying to find the size of arrays. As I understand it the Perl 5

Re: Regex query

2002-09-21 Thread Luke Palmer
On Sun, 22 Sep 2002, Markus Laire wrote: On Sat, Sep 21, 2002 at 11:36:49AM -0600, John Williams wrote: On Sat, 21 Sep 2002, Jonathan Scott Duff wrote: Anyway, (7) or (3+4) should yield a number, not a list, because otherwise every math expression will break. Why can't perl

  1   2   3   4   5   6   7   8   9   10   >