Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

functions inside forall, foreach, findall, bagof, etc. #12

Open
mndrix opened this issue May 27, 2014 · 1 comment
Open

functions inside forall, foreach, findall, bagof, etc. #12

mndrix opened this issue May 27, 2014 · 1 comment
Labels

Comments

@mndrix
Copy link
Owner

mndrix commented May 27, 2014

Expanding a function inside the goal argument of these predicates should keep the entire expansion inside the predicate. Currently it moves the expansion outside the predicate.

@mndrix
Copy link
Owner Author

mndrix commented Oct 28, 2016

A concrete example of the problem:

$ cat expand.pl
:- use_module(library(func)).
nmain :-
    bagof(x,between(1,succ(2,~),_),Xs),
    writeln(Xs).

$ swipl -q -s expand.pl
1 ?- listing(main).
main :-
    succ(2, A),
    bagof(x, between(1, A, _), B),
    writeln(B).

true.

The listing should have been as follows:

main :-
    bagof(x, (succ(2,A),between(1, A, _)), B),
    writeln(B).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant