On Wed, 2005-02-09 at 14:57, Ovid wrote: > --- Matt Fowles <[EMAIL PROTECTED]> wrote: > > > Logic Programming in Perl 6 > > Ovid asked what logic programming in perl 6 would look like. No > > answer yet, but I suppose I can pick the low hanging fruit: as a > > limiting case > > you could always back out the entire perl 6 grammar and insert > > that of prolog. > > I dunno about that. The predicate calculus doesn't exactly translate > well to the sort of programming that Perl 6 is geared for. I don't > think it's a matter of redefining a grammar. Maybe unification can be > handled with junctions, but backtracking?
The grammar is easy (well, as easy as any high-level programming language grammar, and easier than some), and the rest could be implemented in one of two ways: write a Prolog::Engine module with the whole thing from scratch or linked in from some existing Prolog interpreter; or layer it all on top of the Perl 6 rules engine. The latter would be possible, but indescribably gross. -- â 781-324-3772 â [EMAIL PROTECTED] â http://www.ajs.com/~ajs