For example, CLPZ(ℤ) needs to export .. as an operator, without any predicate definition.
As a workaround, I currently pretend to export the predicate (..)/2, and this seems to make the operator available. See for example line 59 of https://www.metalevel.at/clpz/scryer/clpz3.pl
Without this workaround, I get:
?- T = (X in 1..5). caught: error(syntax_error(incomplete_reduction),read_term/2:1)
Expected: T = (X in 1..5).
It would be nice to have a better way for this use case.
I have been thinking of how to do this for a while. Something like,
:- module(m, [op(400,xfy,#>), ...])
perhaps?
Yes, that would be perfect! In this way, any operators can be exported in addition to all predicates.
I also suppose that exporting the operator won't also result in exporting the associated predicate, as it does now. If you want that to be done also, it needs to be exported separately.
Yes!
This now works, so I am closing this issue. Thank you!
Most helpful comment
I also suppose that exporting the operator won't also result in exporting the associated predicate, as it does now. If you want that to be done also, it needs to be exported separately.