ciao-lang / ciao

Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
https://ciao-lang.org
GNU Lesser General Public License v3.0
268 stars 20 forks source link

Clarification request: does Ciao Prolog have a foreach/2 somewhere? #69

Open Jean-Luc-Picard-2021 opened 2 years ago

Jean-Luc-Picard-2021 commented 2 years ago

I tried first in Ciao Prolog playground:

?- foreach(member(X,[1,2,3]), write(X)), nl.
{ERROR: No handle found for thrown exception error(existence_error(procedure,'user:foreach'/2),'user:foreach'/2)} 

On the other hand SWI-Prolog gives me:

?- foreach(member(X,[1,2,3]), write(X)), nl.
123
true.

Its not the optimal test case for foreach/2 since the main application of foreach/2 is rather a goal in the second argument that produces constraints.

I also checked the Ciao Prolog documentation search function, but it didn't show me literally the name foreach of some predicate.

Maybe its burried somewhere by another name?

Jean-Luc-Picard-2021 commented 4 months ago

Come on the ticket is more than 2 years old, and you couldn't answer the question in the ticket?

But you have time to reopen it? Whats wrong with Ciao people?