Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Bringing Logic Programming to Perl

by hv (Parson)
on Jan 22, 2005 at 15:50 UTC ( #424239=note: print w/ replies, xml ) Need Help??


in reply to Bringing Logic Programming to Perl

One of the new features in perl6 that may be useful for this is a switch for rules (patterns) that tells it to find every way this pattern can match, rather than finding only one match for each possible start position. I'm not sure what it's called this week, but it would mean you could say something like:

"abcd" =~ m:every/^(.*)(.*)$/;
.. and get the five matches that represent the five ways of splitting the string into two parts.

I'd also love to see the pattern matching concept extended from simple strings to data structures, but I don't think anyone yet knows of a good paradigm for expressing the patterns. The only halfway useful approach I know of is expat XPath, and the way it expresses its patterns is ugly as hell.

Hugo


Comment on Re: Bringing Logic Programming to Perl
Download Code
Re^2: Bringing Logic Programming to Perl
by Aristotle (Chancellor) on Jan 22, 2005 at 22:14 UTC

    Hm. Doesn't XPath do just that?

    Makeshifts last the longest.

      Oops, I meant XPath rather than Expat.

      Hugo

Re^2: Bringing Logic Programming to Perl
by bsb (Priest) on Apr 20, 2007 at 09:54 UTC
    I'm not sure what it's called this week

    :exhaustive or :ex for short, some where in S05/Modifiers

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://424239]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-23 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls