Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Ovid
--- Rod Adams <[EMAIL PROTECTED]> wrote: > I was just relaying the observation that the P6RE was fairly close to > being able to implement Logical Programming, which several people > seem to be trying to get into Perl in some fashion or another. When I get a chance to talk to someone about logic p

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Rod Adams
Larry Wall wrote: I suspect it's another one of the many things we just try to stay within hailing distance of without trying to solve for 6.0.0. That's cool. I was just relaying the observation that the P6RE was fairly close to being able to implement Logical Programming, which several people

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Larry Wall
On Wed, Mar 09, 2005 at 08:56:22AM -0700, Luke Palmer wrote: : I was decently insane last night. This generator stuff probably isn't : going anywhere. It's too abstract, and not precise enough, to be a : truly powerful part of the language. I suspect it's another one of the many things we just t

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. > > > > / $:= )> / > > > > > 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 capture to $.

Re: Logic Programming with Rules (and Argument Patterns)

2005-03-09 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: Or you could avoid the global modifier and write your tests in <( )> blocks instead... after all, that's what it's there for. I *knew* I had seen a syntax for that before... I just didn't see it when I scanned S05 for it. I still want the :z modifier for

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) { >