Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta_predicate is unexpectedly an operator #2822

Open
triska opened this issue Feb 9, 2025 · 4 comments
Open

meta_predicate is unexpectedly an operator #2822

triska opened this issue Feb 9, 2025 · 4 comments

Comments

@triska
Copy link
Contributor

triska commented Feb 9, 2025

We currently have:

?- current_op(Pri, Fix, meta_predicate).
   Pre = 1199, Fix = fx, unexpected.

meta_predicate is not a standard operator, and therefore should not be defined as an operator!

I would greatly appreciate any help with this: First, systematically remove all occurrences in library code where meta_predicate is used as a prefix operator (use functional notation instead in such cases), and second, remove the operator definition to make Scryer more strictly conforming in its default execution mode, i.e., on startup.

@hurufu
Copy link
Contributor

hurufu commented Feb 10, 2025

Doesn't it conflict with the requirement to accept a sequence of meta-predicate specifications (#2444 and similar to #1586)? IMHO sequences only make sense if meta_predicate is used as an operator. Like in the following example:

:- meta_predicate a(0), b(1), c(2).

Otherwise they don't help with readability.

@UWN
Copy link

UWN commented Feb 10, 2025

Doesn't it conflict with ... similar to #1586)?

No. In #1586 all examples use functional notation for the directives.

@hurufu
Copy link
Contributor

hurufu commented Feb 10, 2025

I agree, but from the readability and developer experience point of view, I don't see benefit of meta_predicate((a(0), b(1), c(1))) notation compared to let's say meta_predicate([a(0), b(1), c(2)]). If it is just standards compliance issue, then I'm only for it.

@triska
Copy link
Contributor Author

triska commented Feb 10, 2025

let's say meta_predicate([a(0), b(1), c(2)])

Yes, a predicate indicator list should work, as for dynamic/1. I have filed #2823 for this, thank you a lot!

If it is just standards compliance issue, then I'm only for it.

Yes perfect! Everyone who wants more dedicated operators can define them in ~/.scryerrc or in applications. A great advantage of defining only the standard operators by default is that we can then readily use Scryer Prolog as a reference system to test whether other conforming systems will also be able to parse the code as it is.

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

No branches or pull requests

3 participants