bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nth in latest unstable version


From: Jasper Taylor
Subject: nth in latest unstable version
Date: Fri, 04 Dec 2009 16:52:13 +0000
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

nth and nth0 do not work when the position is a number but the list is free. Examples (on Ubuntu but MacOS is same I think):

address@hidden:~$ gprolog
GNU Prolog 1.3.2
By Daniel Diaz
Copyright (C) 1999-2009 Daniel Diaz
| ?- nth(1,B,c).

no
| ?- nth0(0,B,c).

no

Working examples:

| ?- nth(A,B,c).

A = 1
B = [c|_] ? ;

A = 2
B = [_,c|_] ? ;

A = 3
B = [_,_,c|_] ?

yes
| ?- nth0(A,B,c).

A = 0
B = [c|_] ?

yes

Cheers
   --Jasper





reply via email to

[Prev in Thread] Current Thread [Next in Thread]