Another point of confusion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Another point of confusion

David Logan
I am using the manual, and here is the section verbatim:
——————————————————————————————————————————

8.18.4  between/3for/3

Templates

between(+integer, +integer, ?integer) 
for(?integer, +integer, +integer)

Description

between(Lower, Upper, Counter) generates an sequence of backtracking choices instantiating Counter to the values LowerLower+1,…, Upper

for(Counter, Lower, Upper) is equivalent to between(Lower, Upper, Counter). This predicate is deprecated and new code should use between/3.

——————————————————————————————————————————

Here are my results:

david@server2:~/workspace/prolog/bookworm$ prolog
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- for(X,0,10), write(X), nl, fail.
0
1
2
3
4
5
6
7
8
9
10

no
| ?- between(0,10,X), write(X), nl, fail.
uncaught exception: error(existence_error(procedure,between/3),top_level/0)
| ?- 

Again, what might I be missing here?

Thank you,
David Logan



_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Another point of confusion

Paulo Moura-2
You're looking to the documentation of a recent GNU Prolog version but running an old one.

> On 6 Jul 2017, at 16:08, David Logan <[hidden email]> wrote:
>
> I am using the manual, and here is the section verbatim:
> ——————————————————————————————————————————
> 8.18.4  between/3, for/3
>
> Templates
>
> between(+integer, +integer, ?integer)
> for(?integer, +integer, +integer)
> Description
>
> between(Lower, Upper, Counter) generates an sequence of backtracking choices instantiating Counter to the values Lower, Lower+1,…, Upper.
>
> for(Counter, Lower, Upper) is equivalent to between(Lower, Upper, Counter). This predicate is deprecated and new code should use between/3.
>
> ——————————————————————————————————————————
>
> Here are my results:
>
> david@server2:~/workspace/prolog/bookworm$ prolog
> GNU Prolog 1.3.0
> By Daniel Diaz
> Copyright (C) 1999-2007 Daniel Diaz
> | ?- for(X,0,10), write(X), nl, fail.
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> no
> | ?- between(0,10,X), write(X), nl, fail.
> uncaught exception: error(existence_error(procedure,between/3),top_level/0)
> | ?-
>
> Again, what might I be missing here?
>
> Thank you,
> David Logan
>
>
> _______________________________________________
> Users-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/users-prolog

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:[hidden email]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------





_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Another point of confusion

David Logan
Ah, I should have guessed that. I will figure out how to get Ubuntu to upgrade. What is the latest version?

David Logan


On Jul 6, 2017, at 9:16 AM, Paulo Moura <[hidden email]> wrote:

You're looking to the documentation of a recent GNU Prolog version but running an old one.

On 6 Jul 2017, at 16:08, David Logan <[hidden email]> wrote:

I am using the manual, and here is the section verbatim:
——————————————————————————————————————————
8.18.4  between/3, for/3

Templates

between(+integer, +integer, ?integer)
for(?integer, +integer, +integer)
Description

between(Lower, Upper, Counter) generates an sequence of backtracking choices instantiating Counter to the values Lower, Lower+1,…, Upper.

for(Counter, Lower, Upper) is equivalent to between(Lower, Upper, Counter). This predicate is deprecated and new code should use between/3.

——————————————————————————————————————————

Here are my results:

david@server2:~/workspace/prolog/bookworm$ prolog
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- for(X,0,10), write(X), nl, fail.
0
1
2
3
4
5
6
7
8
9
10

no
| ?- between(0,10,X), write(X), nl, fail.
uncaught exception: error(existence_error(procedure,between/3),top_level/0)
| ?-

Again, what might I be missing here?

Thank you,
David Logan


_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <[hidden email]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------






_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Another point of confusion

Alberto Simões-2
From the website:

Current stable version is gprolog-1.4.4

On Thu, Jul 6, 2017 at 4:26 PM, David Logan <[hidden email]> wrote:
Ah, I should have guessed that. I will figure out how to get Ubuntu to upgrade. What is the latest version?

David Logan


On Jul 6, 2017, at 9:16 AM, Paulo Moura <[hidden email]> wrote:

You're looking to the documentation of a recent GNU Prolog version but running an old one.

On 6 Jul 2017, at 16:08, David Logan <[hidden email]> wrote:

I am using the manual, and here is the section verbatim:
——————————————————————————————————————————
8.18.4  between/3, for/3

Templates

between(+integer, +integer, ?integer)
for(?integer, +integer, +integer)
Description

between(Lower, Upper, Counter) generates an sequence of backtracking choices instantiating Counter to the values Lower, Lower+1,…, Upper.

for(Counter, Lower, Upper) is equivalent to between(Lower, Upper, Counter). This predicate is deprecated and new code should use between/3.

——————————————————————————————————————————

Here are my results:

david@server2:~/workspace/prolog/bookworm$ prolog
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- for(X,0,10), write(X), nl, fail.
0
1
2
3
4
5
6
7
8
9
10

no
| ?- between(0,10,X), write(X), nl, fail.
uncaught exception: error(existence_error(procedure,between/3),top_level/0)
| ?-

Again, what might I be missing here?

Thank you,
David Logan


_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <[hidden email]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------






_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog




--
Alberto Simões
Direção de Curso da Licenciatura em Engenharia de Sistemas Informáticos
Escola Superior de Tecnologia - Instituto Politécnico do Cávado e do Ave

_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog