In SWI It is highly recommended that you install from within by using its
package manager.
To install simply do:
?- pack_install(options). And then load by: ?- use_module( library(options) ). To test ?- [pack(options/examples/ex_sort)]. ?- ex_sort( [a,b,e,c,b], Ord, true ). Ord = [a, b, c, e]. ?- ex_sort( [a,b,e,c,b], Ord, debug(true) ). % Input list length: 5 % Output list length: 4 Ord = [a, b, c, e]. ?- ex_sort( [a,b,e,c,b], Ord, order(>) ). Ord = [e, c, b, a]. ?- ex_sort( [a,b,e,c,b], Ord, duplicates(true) ). Ord = [a, b, b, c, e]. Create file $HOME/.pl/ex_sort.pl with content order(>). ?- ex_sort( [a,b,e,c,b], Ord, true ).
Ord = [e, c, b, a]. Default for user is now order(>) which can still be over-ridden at invocation
?- ex_sort( [a,b,e,c,b], Ord, order(<) ). Ord = [a, b, c, e].
module documentation:
options.html
sources: options
github: stoics.infra
Nicos Angelopoulos
---
London
July, 2015 - Jan 2021