Did you know ... | Search Documentation: |
Pack purity -- docs/quickstart.md |
Up: Purity
There are two versions of Purity, a standalone version that contains no module information and a package that can be installed using SWI-Prolog.
pack_install(purity)
.set_prolog_flag(double_quotes, chars)
.use_module(library(pstring))
.
?- use_module(library(plist))
.purity_test(S, R)
:-
pstr_split(S, ' ', Split)
,
pexclude((eq(pstring, "is"), Split, Small),
pstr_join(Small, '-', R)
)
).
true.
?- purity_test("This is a test", R)
, maplist(write, R)
, nl.
This-a-test
R = ['T', h, i, s, -, a, -, t, e|...].
Ready for action.