Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | Sugar to make Prolog a little sweeter |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.1.1 |
SHA1 sum: | 7430a98fec98bb4a30c30aea8b00fd49645587e1 |
Author: | Michael Hendricks <michael@ndrix.org> |
Maintainer: | Michael Hendricks <michael@ndrix.org> |
Packager: | Michael Hendricks <michael@ndrix.org> |
Home page: | http://packs.ndrix.com/sweet/index.html |
Download URL: | http://packs.ndrix.com/sweet/sweet-0.1.1.tgz |
Requires: | lambda |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.0.1 | e935cd147e1d903d02c29358a93cd38133db2c3b | 1 | http://packs.ndrix.com/sweet/sweet-0.0.1.tgz |
0.0.3 | 91439fd775c4dfe1f94e4c71160b33192f5189f4 | 1 | http://packs.ndrix.com/sweet/sweet-0.0.3.tgz |
0.1.0 | 9393c84988801fa83844b8bed813f8f421d0a8b8 | 3 | http://packs.ndrix.com/sweet/sweet-0.1.0.tgz |
0.1.1 | 7430a98fec98bb4a30c30aea8b00fd49645587e1 | 74 | http://packs.ndrix.com/sweet/sweet-0.1.1.tgz |
:- use_module(library(sweet)). ?- (false -> throw(oops); otherwise -> writeln(ok)). ok true. ?- if(fail,throw(oops)), if(true,writeln(ok)). ok true. ?- forall(X in [1,2,3], writeln(ok)). ok ok ok true. :- use lists -> append/{2,3}, last/2. % same as use_module(library(lists),[append/2,append/3,last/2]).
The sweet
pack adds some convenient syntactic sugar to Prolog. The
main goal is to reduce the amount of redundant code that one must read
(and write). Some of the predicates and macros are simple aesthetic
adjustments (like otherwise/0). Others, like in/2, define powerful
interfaces which can be extended by library authors.
Using SWI-Prolog 6.3 or later:
?- pack_install(sweet).
This module uses semantic versioning.
Source code available and pull requests accepted at http://github.com/mndrix/sweet
Pack contains 10 files holding a total of 15.8K bytes.