Re: Scans

2006-05-09 Thread Smylers
Larry Wall writes: On Mon, May 08, 2006 at 05:30:23PM +0300, Gaal Yahas wrote: : We have a very nifty reduce metaoperator. Scans are a counterpart of : reduce that are very useful -- they are the (preferably lazy) list : of consecutive accumulated reductions up to the final result. I'm

Re: Scans

2006-05-09 Thread Markus Laire
On 5/9/06, Smylers [EMAIL PROTECTED] wrote: But this could just be because I don't (yet) grok scans. Here's a simple example: [+] 1,2,3,4,5 would return scalar 1+2+3+4+5 as a reduction and list (0, 1, 1+2, 1+2+3, 1+2+3+4, 1+2+3+4+5) as a scan. (0 comes from [+](), i.e. [+] with no

Re: Scans

2006-05-09 Thread Smylers
Markus Laire writes: On 5/9/06, Smylers [EMAIL PROTECTED] wrote: But this could just be because I don't (yet) grok scans. Here's a simple example: [+] 1,2,3,4,5 would return scalar 1+2+3+4+5 as a reduction and list (0, 1, 1+2, 1+2+3, 1+2+3+4, 1+2+3+4+5) as a scan. That doesn't

Re: Scans

2006-05-09 Thread Gaal Yahas
On Mon, May 08, 2006 at 04:02:35PM -0700, Larry Wall wrote: : I'm probably not thinking hard enough, so if anyone can come up with an : implementation please give it :) Otherwise, how about we add this to : the language? Maybe that's just what reduce operators do in list context. I love

Re: Scans

2006-05-09 Thread Gaal Yahas
On Tue, May 09, 2006 at 11:23:48AM +0100, Smylers wrote: So I have the list generated by the scan. And? What do I do with it? I can't think of any situation in my life where I've been wanting such a list. Scans are useful when the intermediate results are interesting, as well as when you

Re: Scans

2006-05-09 Thread Austin Hastings
Gaal Yahas wrote: On Mon, May 08, 2006 at 04:02:35PM -0700, Larry Wall wrote: : I'm probably not thinking hard enough, so if anyone can come up with an : implementation please give it :) Otherwise, how about we add this to : the language? Maybe that's just what reduce operators do in list

Re: Scans

2006-05-09 Thread Markus Laire
On 5/9/06, Austin Hastings [EMAIL PROTECTED] wrote: Gaal Yahas wrote: I love this idea and have implemented it in r10246. One question though, what should a scan for chained ops do? list [==] 0, 0, 1, 2, 2; # bool::false? # (bool::true, bool::true, bool::false, bool::false,

Re: normalized hash-keys

2006-05-09 Thread TSa
HaloO, Smylers wrote: But why would a hash be doing equality operations at all? I think it does so in the abstract. A concrete implementation might use the .id method to get a hash value directly. Assuming that a hash is implemented efficiently, as a hash, then it needs to be able to map

Re: Scans

2006-05-09 Thread Mark A. Biggar
Austin Hastings wrote: Gaal Yahas wrote: On Mon, May 08, 2006 at 04:02:35PM -0700, Larry Wall wrote: : I'm probably not thinking hard enough, so if anyone can come up with an : implementation please give it :) Otherwise, how about we add this to : the language? Maybe that's just what

Re: Scans

2006-05-09 Thread Mark A. Biggar
Markus Laire wrote: ps. Should first element of scan be 0-argument or 1-argument case. i.e. should list([+] 1) return (0, 1) or (1) APL defines it as the later (1). -- [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: normalized hash-keys

2006-05-09 Thread Dr.Ruud
Larry Wall schreef: Dr.Ruud: What would be the way to define-or-set that a specific hash has non-case-sensitive keys? Use a shaped hash with a key type that defines infix:=== appropriately, since object hashes are based on infix:=== rather than infix:eq. Suppose I want the keys to be

Re: Scans

2006-05-09 Thread Mark A. Biggar
Austin Hastings wrote: Gaal Yahas wrote: On Mon, May 08, 2006 at 04:02:35PM -0700, Larry Wall wrote: : I'm probably not thinking hard enough, so if anyone can come up with an : implementation please give it :) Otherwise, how about we add this to : the language? Maybe that's just what

Re: Scans

2006-05-09 Thread Jonathan Scott Duff
On Tue, May 09, 2006 at 06:07:26PM +0300, Markus Laire wrote: ps. Should first element of scan be 0-argument or 1-argument case. i.e. should list([+] 1) return (0, 1) or (1) I noticed this in earlier posts and thought it odd that anyone would want to get an extra zero arg that they didn't

[svn:perl6-synopsis] r9153 - doc/trunk/design/syn

2006-05-09 Thread larry
Author: larry Date: Tue May 9 14:06:29 2006 New Revision: 9153 Modified: doc/trunk/design/syn/S03.pod Log: Reduce in list context. Modified: doc/trunk/design/syn/S03.pod == --- doc/trunk/design/syn/S03.pod

Re: Scans

2006-05-09 Thread Smylers
Gaal Yahas writes: On Tue, May 09, 2006 at 11:23:48AM +0100, Smylers wrote: So I have the list generated by the scan. And? What do I do with it? I can't think of any situation in my life where I've been wanting such a list. Scans are useful when the intermediate results are

Re: Scans

2006-05-09 Thread Smylers
Mark A. Biggar writes: Austin Hastings wrote: Gaal Yahas wrote: list [==] 0, 0, 1, 2, 2; # bool::false? # (bool::true, bool::true, bool::false, bool::false, bool::false) (And I'm with Smylers on this one: show me a useful example, please.) Well the above

A rule by any other name...

2006-05-09 Thread Allison Randal
On Apr 20, 2006, at 1:32 PM, Damian Conway wrote: KeywordImplicit adverbsBehaviour regex (none) Ignores whitespace, backtracks token :ratchetIgnores whitespace, no backtracking rule :ratchet :words Skips whitespace, no

Re: A rule by any other name...

2006-05-09 Thread James Mastros
On Tue, May 09, 2006 at 04:51:17PM -0700, Allison Randal wrote: I'm comfortable with the semantic distinction between 'rule' as thingy inside a grammar and 'regex' as thingy outside a grammar. But, I think we can find a better name than 'regex'. [...] Maybe 'match' is a better keyword. Can

Re: Scans

2006-05-09 Thread Austin Hastings
Mark A. Biggar wrote: Austin Hastings wrote: Gaal Yahas wrote: On Mon, May 08, 2006 at 04:02:35PM -0700, Larry Wall wrote: : I'm probably not thinking hard enough, so if anyone can come up with an : implementation please give it :) Otherwise, how about we add this to : the language?

Re: A rule by any other name...

2006-05-09 Thread Damian Conway
Allison wrote: I'm comfortable with the semantic distinction between 'rule' as thingy inside a grammar and 'regex' as thingy outside a grammar. But, I think we can find a better name than 'regex'. The problem is both the 'regex' vs. 'regexp' battle, Is that really an issue? I've never met

Re: Scans

2006-05-09 Thread Damian Conway
Austin Hastings wrote: I'm thinking that APL is dead for a reason. And that every language designer in the world has had a chance to pick over its dessicated bones: all the good stuff has been stolen already. So while scans may fall out as a potential side-effect of reduce, the real question

Re: A rule by any other name...

2006-05-09 Thread Audrey Tang
Allison Randal wrote: More importantly, whitespace skipping isn't a very significant option in grammars in general, so creating two keywords that distinguish between skipping and no skipping is linguistically infelicitous. It's like creating two different words for shirts with horizontal

Re: Scans

2006-05-09 Thread Austin Hastings
Smylers wrote: Mark A. Biggar writes: Austin Hastings wrote: Gaal Yahas wrote: list [==] 0, 0, 1, 2, 2; # bool::false? # (bool::true, bool::true, bool::false, bool::false, bool::false) (And I'm with Smylers on this one: show me a useful example,

[PATCH] S02 - add grammar / rule info to sigil list

2006-05-09 Thread jerry gay
i noticed a few things missing from the list of sigils. patch inline below. ~jerry Index: design/syn/S02.pod === --- design/syn/S02.pod (revision 9154) +++ design/syn/S02.pod (working copy) @@ -494,8 +494,8 @@ $ scalar @

[svn:perl6-synopsis] r9156 - doc/trunk/design/syn

2006-05-09 Thread larry
Author: larry Date: Tue May 9 21:26:12 2006 New Revision: 9156 Modified: doc/trunk/design/syn/S02.pod Log: patch from jerry++. Modified: doc/trunk/design/syn/S02.pod == --- doc/trunk/design/syn/S02.pod

the 'postfix:::' operator

2006-05-09 Thread jerry gay
that's postfix ::, as mentioned in the Names section of S02. snip There is no longer any special package hash such as %Foo::. Just subscript the package object itself as a hash object, the key of which is the variable name, including any sigil. The package object can be derived from a type name