Ruminating RFC 93- alphabet-blind pattern matching

2003-04-01 Thread Yary Hluchan
A couple nights ago I read RFC93 as discussed in Apoc. 5 and got fired up- it reminded me of some ideas from when I was hacking Henry Spencer's regexp package. How to futher generalize regular expression input. It's a bit orthoginal- a properly implemented RFC93 make some difficult things easier-

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Austin Hastings
--- Yary Hluchan <[EMAIL PROTECTED]> wrote: > A couple nights ago I read RFC93 as discussed in Apoc. 5 and got > fired up- it reminded me of some ideas from when I was hacking > Henry Spencer's regexp package. How to futher generalize regular > expression input. It's a bit orthoginal- a properly

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Uri Guttman
> "AH" == Austin Hastings <[EMAIL PROTECTED]> writes: AH> grammar Rainbow; AH> rule color {...}; # this one's on you. AH> rule same_color($color is Colorific) AH> { AH>::: { fail unless $1.looks_like($color); } AH> } AH> rule band($color is Colorific) AH> { AH> +

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Austin Hastings
I'm reordering this post rather than retype stuff. Forgive me. --- Uri Guttman <[EMAIL PROTECTED]> wrote: > for the p6 regex impaired among us, please explain that. it might > make a nice tute for the docs. i get the general picture but i don't > follow how it works regarding the color checking.

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Yary Hluchan
Thanks for the thoughtful consideration. Austin's given some high- level examples of the kind I was hoping for, "AH>" = Austin Hastings AH> grammar Rainbow; AH> use Colorific; # Import C and C, among others. AH> AH> What I don't know is how to recognize a color, which is to say I don't AH> kno

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Andrew Wilson
On Wed, Apr 02, 2003 at 10:16:37AM -0800, Austin Hastings wrote: > And the Colorific class supposedly has a way to determine if two colors > look about like each other. Again, I don't know how that works, but I > don't need to. > >> AH> rule same_color($color is Colorific) >> AH> { >> AH>

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Yary Hluchan
W= Andrew Wilson, AH=Austin Hastings AH> This is really probably bad code. Maybe a better rule would be: AH> AH> rule same_color($color is Colorific) AH> { AH>::: { fail unless $color.looks_like($1); } AH> } AH> AH> I KNOW that $color is an object-of-type-Colorific, while I'm not sure, AH> fra

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Austin Hastings
--- Andrew Wilson <[EMAIL PROTECTED]> wrote: > On Wed, Apr 02, 2003 at 10:16:37AM -0800, Austin Hastings wrote: > > And the Colorific class supposedly has a way to determine if two > colors > > look about like each other. Again, I don't know how that works, but > I > > don't need to. > > > >> A

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Joseph F. Ryan
Austin Hastings wrote: Another example. Let's say there's a class that deals with colors. It has an operator that returns true if two colors look about the same. Given a list of color objects, is there a regexp to find a rainbow? Even if the color class doesn't support stringification? Yes

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Austin Hastings
--- Yary Hluchan <[EMAIL PROTECTED]> wrote: > Thanks for the thoughtful consideration. Austin's given some high- > level examples of the kind I was hoping for, > > "AH>" = Austin Hastings > > AH> grammar Rainbow; > AH> use Colorific; # Import C and C, among others. > AH> > AH> What I don't kn

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-02 Thread Yary Hluchan
>This isn't quite meaningful. What does a "non-letter atom" mean? > >If you're processing a file or a string, that's the basic P6 model. > >But consider \u for unicode -- that's a multi-byte object in the >stream. So for streams of bytes, the right way is just to code Ccolor> such that it recogniz

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Edward Peschko
> What I think you're looking for is the fact that they're not regexes any more. They > are > "rexen", but in horrifying-secret-reality, what has happened is that Larry's > decided > to move Fortran out of core, and replace it with yacc. just an aside, and a bit off-topic, but has anybody consid

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Luke Palmer
> just an aside, and a bit off-topic, but has anybody considered > hijacking the regular expression engine in perl6 and turning it into > its opposite, namely making *productions* of strings/sounds/whatever > that could possibly match the regular expression? ie: > > a* > > producing > > '' > a >

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Austin Hastings
--- Edward Peschko <[EMAIL PROTECTED]> wrote: > > What I think you're looking for is the fact that they're not > regexes any more. They are > "rexen", but in > horrifying-secret-reality, what has happened is that Larry's decided > > to move Fortran out of core, and replace it with yacc. > > just a

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Matthijs van Duin
On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: This has been alluded to before. What would /A*B*/ produce? Because if you were just processing the rex, I think you'd have to finish generating all possibilities of A* before you began iterating over B*... The "proper" way would be

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Luke Palmer
> On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: > >This has been alluded to before. > > > >What would /A*B*/ produce? > > > >Because if you were just processing the rex, I think you'd have to > >finish generating all possibilities of A* before you began iterating > >over B*... >

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread arcadi shehter
Austin Hastings writes: > > On the other hand, let's suppose that you've got a vast array of > floating point data: > > my float @seti = {...evidence of intelligence, somewhere...}; > > It's a fair question to ask how to retarget the rexengine to use @seti > as the input stream. (I hereb

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Yary Hluchan
a = arcadi shehter <[EMAIL PROTECTED]> a>I think this was already discussed once and then it was proposed to a>attach a property to characters of the string a> a> sub peek_at_sky { a> a> my Color @numbers = peek_with_some_hardware; a> a> my $say_it = join map { "1" but color($_) } @number

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Austin Hastings
This is a big long post containing essentially me scratching my head at Luke's code. Since Uri asked yesterday for a tutorial-type explanation of some of the syntax, and since I wanted to scream and ask the same thing of Luke today when I first read his "5 unobfuscated friggin lines", I'm putting i

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Joseph F. Ryan
Edward Peschko wrote: What I think you're looking for is the fact that they're not regexes any more. They are > "rexen", but in horrifying-secret-reality, what has happened is that Larry's decided to move Fortran out of core, and replace it with yacc. just an aside, and a bit off-topic, but h

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Yary Hluchan
>making *productions* of strings/sounds/whatever that could possibly >match the regular expression? > >>Correct me if I am wrong, but isn't this the :any switch of apoc 5? >>http://www.perl.com/pub/a/2002/06/26/synopsis5.html Not really, unless the input string is infinite! :any returns all subst

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-03 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: >> On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: >> >This has been alluded to before. >> > >> >What would /A*B*/ produce? >> > >> >Because if you were just processing the rex, I think you'd have to >> >finish generating all possibilities o

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Luke Palmer
> > use Permutations <>; > > > > # Generate all strings of length $n > > method Rule::Group::generate(Int $n) { # Type sprinkles :) > > compositions($n, [EMAIL PROTECTED]) ==> map { > > my @rets = map { > > $^atom.generate($^n) > > } zi

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Edward Peschko
On Thu, Apr 03, 2003 at 07:30:10AM -0700, Luke Palmer wrote: > > just an aside, and a bit off-topic, but has anybody considered > > hijacking the regular expression engine in perl6 and turning it into > > its opposite, namely making *productions* of strings/sounds/whatever > > that could possibly m

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Luke Palmer
> Luke Palmer <[EMAIL PROTECTED]> writes: > > >> On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: > >> >This has been alluded to before. > >> > > >> >What would /A*B*/ produce? > >> > > >> >Because if you were just processing the rex, I think you'd have to > >> >finish generating a

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread arcadi shehter
Yary Hluchan writes: > a = arcadi shehter <[EMAIL PROTECTED]> > a>I think this was already discussed once and then it was proposed to > a>attach a property to characters of the string > a> > a> sub peek_at_sky { > a> > a> my Color @numbers = peek_with_some_hardware; > a> > a> my $

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Joseph F. Ryan
Luke Palmer wrote: On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: This has been alluded to before. What would /A*B*/ produce? Because if you were just processing the rex, I think you'd have to finish generating all possibilities of A* before you began iterating over B*...

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Joseph F. Ryan
Joseph F. Ryan wrote: Luke Palmer wrote: On Thu, Apr 03, 2003 at 07:29:37AM -0800, Austin Hastings wrote: This has been alluded to before. What would /A*B*/ produce? Because if you were just processing the rex, I think you'd have to finish generating all possibilities of A* before you began

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-04 Thread Joseph F. Ryan
Yary Hluchan wrote: making *productions* of strings/sounds/whatever that could possibly match the regular expression? Correct me if I am wrong, but isn't this the :any switch of apoc 5? http://www.perl.com/pub/a/2002/06/26/synopsis5.html Not really, unless the input string is infinite! Well, t

Re: Ruminating RFC 93- alphabet-blind pattern matching

2003-04-05 Thread Larry Wall
Um. Maybe it was just bad writing on my part, but it does not seem to me that what I already said about RFC 93 in A5 has sunk in at all. Larry