diff --git a/.gitignore b/.gitignore index e4e5f6c..79801b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ -*~ \ No newline at end of file +*~ +*.swp +*.import.scm +*.so +*.types +salmonella.log diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..854176d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) John Cowan (2016). All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2eb082f --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# SRFI 128 - Comparators (reduced) + +This repository hosts a reference implementation of SRFI 128 - Comparators +(reduced). The full documentation for this SRFI can be found on the [SRFI +Document Reference](http://srfi.schemers.org/srfi-128/). The repository hosts a +complete implementation of the SRFI, running on [CHICKEN](http://call-cc.org) +Scheme. + +## File Description + +While this repository is primarily to provide a reference implementation of +SRFI 128, it also currently serves as the base repository to host the library +as a CHICKEN extension (egg). Thus, there are three files that are independent +of the SRFI itself, and are as follows: + +`srfi-128.meta` : This file denotes metadata about the CHICKEN extension, such +as author, license, and dependencies (and dependencies for tests). + +`srfi-128.setup` : This file tells the CHICKEN package manager +(`chicken-install`) how to build the egg. + +`srfi-128.release-info` : Describes the URL / different releases of the CHICKEN +extension. + +Additionally, the `tests/` directory has been added to accommodate the CHICKEN +package manager (for running tests). Currently it provides a default test +runner which merely includes the tests found in the `ilists/` directory. + +## License + +Provided under a single clause BSD license, Copyright (C) John Cowan 2016. See +LICENSE for full details. diff --git a/comparators/comparators-test.scm b/comparators/comparators-test.scm index ea06a1e..ce58348 100644 --- a/comparators/comparators-test.scm +++ b/comparators/comparators-test.scm @@ -1,6 +1,6 @@ (use test) -(use comparators) -(load "r7rs-shim.scm") +(use srfi-128) +(load "../comparators/r7rs-shim.scm") (define (print x) (display x) (newline)) @@ -250,7 +250,6 @@ (test-assert (exact-integer? (hash-bound))) (test-assert (exact-integer? (hash-salt))) (test-assert (< (hash-salt) (hash-bound))) - (test (hash-salt) (fake-salt-hash #t)) ) ; end comparators/bound-salt ) ; end comparators diff --git a/comparators/comparators.meta b/comparators/comparators.meta deleted file mode 100644 index abafd00..0000000 --- a/comparators/comparators.meta +++ /dev/null @@ -1,13 +0,0 @@ -;; -*- mode: Scheme; -*- -((category data) - (license "BSD") - (author "John Cowan, Egg by Jörg F. Wittenberger") - (synopsis "SRFI-128: Comparators (reduced)") - ;(doc-from-wiki) - (files "comparators.meta" "comparators.setup" - "comparators.scm" "r7rs-shim.scm" "comparators-impl.scm" "default.scm" - "comparators-test.scm" - "comparators.sld" "complex-shim.scm" - ) - (needs srfi-4 srfi-13) - '((version 0.1))) diff --git a/comparators/comparators.scm b/comparators/comparators.scm index 55cdec5..1f6ca0d 100644 --- a/comparators/comparators.scm +++ b/comparators/comparators.scm @@ -2,7 +2,7 @@ (safe-globals) (specialize)) -(module comparators () +(module srfi-128 () (import scheme) (import (only chicken use export include case-lambda error define-record-type make-parameter parameterize : define-type)) @@ -18,7 +18,7 @@ (export =? ? <=? >=?) (export comparator-if<=>) (export comparator-type-test-predicate comparator-equality-predicate - comparator-ordering-predicate comparator-hash-function) + comparator-ordering-predicate comparator-hash-function) (use numbers) (use srfi-4) (use srfi-13) @@ -27,9 +27,9 @@ (define-type :comparison-test: (procedure (* *) boolean)) (define-type :hash-code: fixnum) (define-type :hash-function: (procedure (*) :hash-code:)) - (include "r7rs-shim.scm") - (include "comparators-impl.scm") - (include "default.scm") + (include "comparators/r7rs-shim.scm") + (include "comparators/comparators-impl.scm") + (include "comparators/default.scm") ;; Chicken type declarations (: comparator? (* --> boolean : :comparator:)) (: comparator-type-test-predicate (:comparator: --> :type-test:)) diff --git a/comparators/comparators.setup b/comparators/comparators.setup deleted file mode 100644 index 15ac3e7..0000000 --- a/comparators/comparators.setup +++ /dev/null @@ -1,10 +0,0 @@ -;; -*-Scheme-*- - -(compile -s -O3 -d2 -J -emit-type-file "comparators.types" "comparators.scm") -(compile -c -O3 "comparators.scm" -unit comparators) -(compile -s -O2 -d0 "comparators.import.scm") - -(install-extension - 'comparators - '("comparators.types" "comparators.so" "comparators.import.so") - '((version 0.1))) diff --git a/srfi-128.meta b/srfi-128.meta new file mode 100644 index 0000000..4a7f41e --- /dev/null +++ b/srfi-128.meta @@ -0,0 +1,21 @@ +;; -*- Hen -*- + +((egg "srfi-128.egg") + ; List of files that should be bundled alongside egg + (files "comparators" + "tests" + "srfi-128.setup" + "srfi-128.meta" + "srfi-128.release-info" + "LICENSE" + "README.md") + + (license "BSD") + (category data) + (depends numbers) + (test-depends test) + (author "John Cowan, Egg by Jörg F. Wittenberger / Jeremy Steward") + (synopsis "SRFI-128: Comparators (reduced)") + (email "cowan@ccil.org") + (repo "https://github.com/scheme-requests-for-implementation/srfi-128") + (version "0.1")) diff --git a/srfi-128.release-info b/srfi-128.release-info new file mode 100644 index 0000000..f8fb050 --- /dev/null +++ b/srfi-128.release-info @@ -0,0 +1,3 @@ +(repo git "git://github.com/scheme-requests-for-implementation/srfi-128.git") +(uri targz "https://codeload.github.com/scheme-requests-for-implementation/srfi-128/tar.gz/CHICKEN-{egg-release}") +(release "0.1") diff --git a/srfi-128.setup b/srfi-128.setup new file mode 100644 index 0000000..38b4c0e --- /dev/null +++ b/srfi-128.setup @@ -0,0 +1,10 @@ +;; -*- Hen -*- + +(compile -O3 -d2 -s -J -emit-type-file "srfi-128.types" "comparators/comparators.scm") +(compile -O3 -d0 -s "comparators/comparators.scm" -unit srfi-128) +(compile -s -O2 -d0 "srfi-128.import.scm") + +(install-extension + 'srfi-128 + '("srfi-128.types" "srfi-128.so" "srfi-128.import.so") + '((version "0.1"))) diff --git a/tests/run.scm b/tests/run.scm new file mode 100644 index 0000000..579f469 --- /dev/null +++ b/tests/run.scm @@ -0,0 +1 @@ +(include "../comparators/comparators-test.scm")