Predicate ordering when using current_predicate/1

emacstheviking <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <CAEiEuU+Z0ErdjqTKcGW9Y69h1jKXFGqRYWkgOL1wEb1GuAXwHw@mail.gmail.com>
Hi,

There is no mention of the actual order of returned predicates, recently I
created a testing framework and it has this line of code thanks to Daniel,

findall(Name,(current_predicate(Name/0), atom_concat('test_', _,
Name)),AllTests)

I am writing tests now that rely upon them being executed in the order that
they are defined in the source file i.e. the temporal order in which they
were added to the database I presume.

However, they do not seem to come out in the expected order unless I have
done something wrong but the above line of code is what dictates the order
of execution.

Sean.

_______________________________________________
Users-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/users-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.