Skip Menu |

This queue is for tickets about the AI-Prolog CPAN distribution.

Report information
The Basics
Id: 64942
Status: resolved
Priority: 0/
Queue: AI-Prolog

People
Owner: DOUGW [...] cpan.org
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.740
Fixed in: 0.741



Subject: Head/Tail results bug patch
This is is fix for the infamous [HEAD|TAIL] result binding bug. Here is a test program: #!/usr/bin/perl use strict; use warnings; use AI::Prolog; use Data::Dumper qw(Dumper); my $p = AI::Prolog->new(<<EOT); foo(X,[1,2,3,4]). EOT $p->raw_results(0); $p->query('foo(1,[X,Y|Z])'); while (my $r = $p->results) { print Dumper $r; }
Subject: Term.pm.diff
--- TermOld.pm 2007-05-04 20:02:48 -0700 +++ Term.pm 2011-01-19 17:01:41 -0800 @@ -425,7 +425,11 @@ my $term = $self->{args}[1]; while ( "cons" eq $term->getfunctor && 2 == $term->getarity ) { - push @result => $term->getarg(0)->_to_data($parent); + if ( $term->{varname} ) { + push @result => $term->_to_data($parent); + } else { + push @result => $term->getarg(0)->_to_data($parent); + } $term = $term->getarg(1); }
Subject: Re: [rt.cpan.org #64942] Head/Tail results bug patch
Date: Mon, 31 Jan 2011 22:46:27 -0800
To: bug-AI-Prolog [...] rt.cpan.org
From: Joshua ben Jore <twists [...] gmail.com>
On Wed, Jan 19, 2011 at 5:32 PM, Douglas Wilson via RT <bug-AI-Prolog@rt.cpan.org> wrote: Show quoted text
> Wed Jan 19 20:32:01 2011: Request 64942 was acted upon. > Transaction: Ticket created by DOUGW >       Queue: AI-Prolog >     Subject: Head/Tail results bug patch >   Broken in: 0.740 >    Severity: Important >       Owner: Nobody >  Requestors: DOUGW@cpan.org >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=64942 > > > > This is is fix for the infamous [HEAD|TAIL] result binding bug. Here is > a test program: > > #!/usr/bin/perl > > use strict; > use warnings; > > use AI::Prolog; > use Data::Dumper qw(Dumper); > > my $p = AI::Prolog->new(<<EOT); > foo(X,[1,2,3,4]). > EOT > > $p->raw_results(0); > > $p->query('foo(1,[X,Y|Z])'); > > while (my $r = $p->results) { >  print Dumper $r; > } > > > --- TermOld.pm  2007-05-04 20:02:48 -0700 > +++ Term.pm     2011-01-19 17:01:41 -0800 > @@ -425,7 +425,11 @@ >             my $term   = $self->{args}[1]; > >             while ( "cons" eq $term->getfunctor && 2 == $term->getarity ) { > -                push @result => $term->getarg(0)->_to_data($parent); > +                if ( $term->{varname} ) { > +                  push @result => $term->_to_data($parent); > +                } else { > +                  push @result => $term->getarg(0)->_to_data($parent); > +                } >                 $term = $term->getarg(1); >             }
Would you like CPAN permissions to upload changes yourself? Josh
Subject: Re: [rt.cpan.org #64942] Head/Tail results bug patch
Date: Tue, 1 Feb 2011 06:12:20 -0800
To: bug-AI-Prolog [...] rt.cpan.org
From: Douglas Wilson <douglasg.wilson [...] gmail.com>
On Mon, Jan 31, 2011 at 10:46 PM, Joshua ben Jore via RT <bug-AI-Prolog@rt.cpan.org> wrote: Show quoted text
> > Would you like CPAN permissions to upload changes yourself? >
That would be great. Doug
On Tue Feb 01 10:58:02 2011, douglasg.wilson@gmail.com wrote: Show quoted text
> On Mon, Jan 31, 2011 at 10:46 PM, Joshua ben Jore via RT > <bug-AI-Prolog@rt.cpan.org> wrote:
> > > > Would you like CPAN permissions to upload changes yourself? > >
> > That would be great. > > Doug
Just saw your note. I apparently don't have enough CPAN perms to do this and asked OVID to do this.
On Sat Mar 19 13:33:14 2011, JJORE wrote: Show quoted text
> On Tue Feb 01 10:58:02 2011, douglasg.wilson@gmail.com wrote:
> > On Mon, Jan 31, 2011 at 10:46 PM, Joshua ben Jore via RT > > <bug-AI-Prolog@rt.cpan.org> wrote:
> > > > > > Would you like CPAN permissions to upload changes yourself? > > >
> > > > That would be great. > > > > Doug
> > Just saw your note. I apparently don't have enough CPAN perms to do this > and asked OVID to do this.
OK, I've gone ahead and added DOUGW. Sorry it took so long. Cheers, Ovid
Fixed in 0.741