# HG changeset patch # User Steve Losh # Date 1457222319 0 # Node ID c60cac27a0a78bb88eb03d99666fa94edff511a9 Initial commit diff -r 000000000000 -r c60cac27a0a7 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,3 @@ +syntax: glob + +docs/build diff -r 000000000000 -r c60cac27a0a7 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,18 @@ +.PHONY: test pubdocs + +docfiles = $(shell ls docs/*.markdown) + +test: + sbcl --noinform --load test/run.lisp --eval '(quit)' + +docs: docs/build/index.html + +docs/build/index.html: $(docfiles) + cd docs && ~/.virtualenvs/d/bin/d + +pubdocs: docs + hg -R ~/src/sjl.bitbucket.org pull -u + rsync --delete -a ./docs/build/ ~/src/sjl.bitbucket.org/bones + hg -R ~/src/sjl.bitbucket.org commit -Am 'bones: Update site.' + hg -R ~/src/sjl.bitbucket.org push + diff -r 000000000000 -r c60cac27a0a7 README.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,22 @@ + eeeee eeeee eeeee eeee eeeee + 8 8 8 88 8 8 8 8 " + 8eee8e 8 8 8e 8 8eee 8eeee + 88 8 8 8 88 8 88 88 + 88eee8 8eee8 88 8 88ee 8ee88 + +Bones is a logic programming library for Common Lisp. + +**Bones is still in development, don't actually try to use this for anything +yet. It should be usable by mid-2016.** + +* **License:** MIT/X11 +* **Documentation:** +* **Code:** +* **Issues:** + +![I don't know what that means](https://i.imgur.com/EWPGAHa.gif) + +License +------- + +Copyright 2016 Steve Losh and contributors. Licensed as **MIT/X11**. diff -r 000000000000 -r c60cac27a0a7 bones-test.asd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bones-test.asd Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,12 @@ +(asdf:defsystem #:bones-test + :description "Test suite for bones." + :author "Steve Losh " + :license "MIT/X11" + :depends-on (#:bones + #:fiveam) + :serial t + :components ((:file "package-test") + (:module "test" + :serial t + :components ((:file "bones"))))) + diff -r 000000000000 -r c60cac27a0a7 bones.asd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bones.asd Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,20 @@ +(asdf:defsystem #:bones + :name "bones" + :description "A logic programming library for Common Lisp." + + :author "Steve Losh " + :maintainer "Steve Losh " + + :license "MIT/X11" + :version "0.0.1" + + :depends-on (#:defstar + #:optima + #:fare-quasiquote-optima + #:fare-quasiquote-readtable) + + :serial t + :components ((:file "package") + (:module "src" + :components ((:file "bones"))))) + diff -r 000000000000 -r c60cac27a0a7 docs/01-installation.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/01-installation.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,2 @@ +Installation +============ diff -r 000000000000 -r c60cac27a0a7 docs/02-overview.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/02-overview.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,2 @@ +Overview +======== diff -r 000000000000 -r c60cac27a0a7 docs/03-reference.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/03-reference.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,2 @@ +Reference +========= diff -r 000000000000 -r c60cac27a0a7 docs/04-changelog.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/04-changelog.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,2 @@ +Changelog +========= diff -r 000000000000 -r c60cac27a0a7 docs/bones.gif Binary file docs/bones.gif has changed diff -r 000000000000 -r c60cac27a0a7 docs/footer.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/footer.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,3 @@ +Made with Lisp and love by [Steve Losh][] in Reykjavík, Iceland. + +[Steve Losh]: http://stevelosh.com/ diff -r 000000000000 -r c60cac27a0a7 docs/index.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/index.markdown Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,12 @@ +Bones is a logic programming library for Common Lisp. + +**Bones is still in development, don't actually try to use this for anything +yet. It should be usable by mid-2016.** + +* **License:** MIT/X11 +* **Documentation:** +* **Code:** +* **Issues:** + + diff -r 000000000000 -r c60cac27a0a7 docs/title --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/title Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,1 @@ +Bones diff -r 000000000000 -r c60cac27a0a7 package-test.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package-test.lisp Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,3 @@ +(defpackage #:bones-test + (:use #:cl #:bones #:5am)) + diff -r 000000000000 -r c60cac27a0a7 package.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package.lisp Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,5 @@ +(defpackage #:bones + (:use #:cl) + (:export :hello) + ) + diff -r 000000000000 -r c60cac27a0a7 src/bones.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/bones.lisp Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,6 @@ +(in-package #:bones) + +(defun hello () + 1) + + diff -r 000000000000 -r c60cac27a0a7 test/99.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/99.pl Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,59 @@ +% 99 Prolog Problems +% from http://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/ +% +% Solutions to at least a few of these, for testing purposes. + +% P01 +my_last(X, [X]). +my_last(X, [_ | T]) :- + my_last(X, T). + +% P02 +my_lastbutone(X, [X, _]). +my_lastbutone(X, [_ | T]) :- + my_lastbutone(X, T). + +% P03 +my_nth(X, [X | _], 1). +my_nth(X, [_ | T], N) :- + M is N - 1, + my_nth(X, T, M). + +% P04 +my_len([], 0). +my_len([_ | T], Length) :- + my_len(T, M), + Length is M + 1. + +my_len_acc([], A, A). +my_len_acc([_ | T], A, Length) :- + B is A + 1, + my_len_acc(T, B, Length). + +my_len2(L, Length) :- + my_len_acc(L, 0, Length). + +% P05 +my_reverse_acc([], Acc, Acc). +my_reverse_acc([X | T], Acc, Reversed) :- + my_reverse_acc(T, [X | Acc], Reversed). + +my_reverse(L, R) :- + my_reverse_acc(L, [], R). + +% P06 +my_palindrome(L) :- + my_reverse(L, L). + +% P07 +my_flatten([], []). + +my_flatten([Atom | Tail], [Atom | FlatTail]) :- + \+ is_list(Atom), + my_flatten(Tail, FlatTail). + +my_flatten([HeadList | Tail], Flattened) :- + is_list(HeadList), + my_flatten(HeadList, FlatHeadList), + my_flatten(Tail, FlatTail), + append(FlatHeadList, FlatTail, Flattened). diff -r 000000000000 -r c60cac27a0a7 test/bones.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bones.lisp Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,7 @@ +(in-package #:bones-test) + +(def-suite bones) +(in-suite bones) + +(test hello-works + (is (equal 0 (1- (hello))))) diff -r 000000000000 -r c60cac27a0a7 test/run.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/run.lisp Sat Mar 05 23:58:39 2016 +0000 @@ -0,0 +1,6 @@ +(let ((*standard-output* (make-broadcast-stream))) + (ql:quickload "bones-test")) + + +(in-package #:bones-test) +(run!)