Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] nan_common v.1.0 (SWI pack)

28 views
Skip to first unread message

LudovicoVan

unread,
Nov 10, 2012, 9:11:43 AM11/10/12
to
Hello all,

I have just published a pack for SWI-Prolog named nan_common (v.1.0) under
GPL3+SWI-Exception:
<http://julio.diegidio.name/Projects/Prolog/Download/nan_common-1.0.zip>

The pack contains two modules:

- nan_common is simply a top-level re-exporter for the other modules (the
library is meant to grow);
- nan_validation is a module providing type testing and validation
predicates (builds on library(error)).

To install, just type:
?- pack_install(nan_common).
(NOTE: this requires an active Internet connection.)

To use, type:
?- use_module(library(nan_common)).

More details on SWI-Prolog packs at:
<http://www.swi-prolog.org/pack/list>
<http://www.swi-prolog.org/howto/Pack.html>

Apart from the possible defects, there are issues with the HTML of the doc
comments that I have not been able to nail down and resolve.

Anyway, this is a very first attempt, so I am sure things can be improved:
feedback, corrections, suggestions, etc. all very welcome.

Cheers,

-LV


LudovicoVan

unread,
Nov 10, 2012, 9:22:53 AM11/10/12
to
"LudovicoVan" <ju...@diegidio.name> wrote in message
news:k7lnb8$te$1...@dont-email.me...

> - nan_validation is a module providing type testing and validation
> predicates (builds on library(error)).

Just to give an idea, this is an excerpt from the test_type/2 predicate doc:

---------------------------------------------------------------------
Supports all types documented in error:must_be/2 plus those listed here:

=predicate=
=atom=/=nonneg=
=formatted=
=text=-=list= _or_ =text=
=formal_error=
=callable=
=term_order=
=oneof=([=, <, >])
=pair=(=KeyType=-=ValueType=)
=KeyType=-=ValueType=
=var=(=SubType=)
=var= _or_ =SubType=
=or=([=Type1=, ..., =TypeN=])
=Type1= _or_ ... _or_ =TypeN=
=m_var=(=SubType=)
=atom=:=var= _or_ =var(SubType)=
=m_predicate=
=atom=:=predicate= _or_ =predicate=
=m_callable=
=atom=:=callable= _or_ =callable=
=s_callable=(_Struct_:=struct=)
=callable= _and_ =has_struct=(_Struct_, Term) (*)
=struct=
=callable= _with_ "_terminals_" =atom= _or_ =var=:=SubType= (*)
=type=
=callable= _and_ =clause=(=error=:=has_type=(Term, _))

(*) The implicit predicate has_struct/2 tests functor equality of
non-"terminal" sub-terms of _Struct_ to the corresponding sub-terms of
Term. For "terminal" sub-terms of _Struct_, specifically meaning any
encountered (sub-)terms of _Struct_ that are of type =var=:=SubType=,
has_struct/2 tests that the corresponding (sub-)term of Term satisfies
=SubType=. (Variable names in "terminals" of _Struct_ are ignored but
useful for self-documentation.)
---------------------------------------------------------------------

-LV


0 new messages