[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Newbie question regarding clause
From: |
Paulo Moura |
Subject: |
Re: Newbie question regarding clause |
Date: |
Sun, 27 Aug 2017 06:59:00 +0100 |
clause/2 only works for dynamic predicates.
> On 27 Aug 2017, at 06:14, Curtis Hoffmann <address@hidden> wrote:
>
> I have the Clocksin and Mellish Programming in Prolog book, and I'm trying to
> get past all the errors.
> One of the programming examples is for a replacement of listing (p. 182).
>
> list1(X) :-
> clause(X, Y),
> output_clause(X, Y), write('.'), nl, fail.
> list1(X).
>
> output_clause(X, true) :- !, write(X).
> output_clause(X, Y) :- write((X :- Y)).
>
> If I type the question ?- list1(list1).
> I get no response back. Am I doing something wrong, or is there something
> about clause that I don't understand?
> I tried checking the archives and didn't see this question asked before.
>
> Thank you in advance.
> Curtis
>
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/users-prolog
-----------------------------------------------------------------
Paulo Moura
Logtalk developer
Email: <mailto:address@hidden>
Web: <http://logtalk.org/>
-----------------------------------------------------------------