Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fifth-postulate/julian
Date and time library for Prolog
https://github.com/fifth-postulate/julian
Last synced: 3 months ago
JSON representation
Date and time library for Prolog
- Host: GitHub
- URL: https://github.com/fifth-postulate/julian
- Owner: fifth-postulate
- License: unlicense
- Created: 2013-10-11T14:29:27.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2021-03-08T02:58:15.000Z (over 3 years ago)
- Last Synced: 2024-05-18T20:34:42.706Z (6 months ago)
- Language: Prolog
- Size: 76.2 KB
- Stars: 26
- Watchers: 7
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
- awesome-prolog - julian - Date-time library. (Date)
README
# julian [![Build Status](https://travis-ci.org/fifth-postulate/julian.svg?branch=main)](https://travis-ci.org/fifth-postulate/julian)
A date and time library for Prolog.*Warning*: This is _alpha_ quality software. APIs will change. There are bugs. Use with caution. Time zones are not yet supported and semantics that should account for time zone choose arbitrary, unpredictable behavior.
With that out of the way, the library can do a lot of useful stuff. See the [in-depth tutorial][tutorial] for examples.
## Synopsis
```
:- use_module(library(julian)).
:- use_module(library(clpfd)).
solution(Year) :-
% Eisenhower presidency had Fourth of July on Sunday in ...
form_time([dow(sunday), Year-07-04]),
Year in 1953..1961.
?- solution(Y).
Y = 1954.
```## Installation
Using SWI-Prolog 7.1.18 or later:
```
?- pack_install(julian).
```This module uses [semantic versioning][versioning].
Source code available and pull requests accepted at [`http://github.com/fifth-postulate/julian`][project]
## Development
### Testing
Test are written with the _Test Anything Protocol_ ([TAP][tap]) and use the [`fnogatz/tap`][pack(tap)] library.To install the tap pack run
```prolog
?- pack_install(tap).
```Next, the `julian` pack should be available as a library. One can install from the local installation by running
```prolog
?- pack_install('file:///home//julian').
```A TAP test harness should be used to run the tests in this project. To run the `t/types.pl` test on could execute
```sh
prove -v -e 'swipl -q -t main -s' t/types.pl
```To run all test one could use
```sh
prove -v -e 'swipl -q -t main -s' t/**.pl
```Or use `make tests`.
[tutorial]: http://fifth-postulate.github.io/julian/
[versioning]: http://semver.org/
[project]: http://github.com/fifth-postulate/julian
[tap]: http://testanything.org/tap-specification.html
[pack(tap)]: https://github.com/fnogatz/tap