I’m not sure if this is a bug or if I’m making a mistake. I have some workarounds that work for me, but I wanted to report this in case it’s a bug or if anyone has advice.
When I try to use_module using the // DCG syntax and as aliasing the predicate, it loses its meta_predicate behavior (it doesn’t prefix it with the module). This only happens when I use both the // and as aliasing.
I’m using SWI-Prolog version 9.2.4.
Examples
Using both // and as is broken
:- module(foo).
:- use_module(library(dcg/high_order),
[ sequence//2 as seq
]).
seq(bar, S) does not prefix my predicate with my module.
I get an error that looks like Unknown procedure: dcg_high_order:bar/3
DCG // only (Good)
:- module(foo).
:- use_module(library(dcg/high_order),
[ sequence//2
]).
sequence(bar, S) does prefix my predicate to foo:bar.
Alias as only (Good)
:- module(foo).
:- use_module(library(dcg/high_order),
[ sequence/4 as seq
]).
seq(bar, S) does prefix my predicate to foo:bar.