DaveEdelstein
DaveEdelstein

Reputation: 1256

Exporting predicates using :- module

I know I can export predicates for a module by using the standard declaration:

:- module(my_test, [hello/1]).

hello(a).
hello(b).

But wanted to know is there another way I can export predicate hello in module my_test? In the example below, what code would I need to fill in, to make my_export directive do this for me?

:- module(my_test, []).

hello(a).
hello(b).
:- my_export(hello/1).

I can't quite figure it out import/export but those are the only real ways I can come up with.

Upvotes: 2

Views: 537

Answers (1)

twinterer
twinterer

Reputation: 2436

Simply using

:- export(hello/1).

should do the trick.

Upvotes: 1

Related Questions