From ffae1ddd22a01874eb6d04d39c9ee0f78d7d5cb5 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 16:26:46 -0600 Subject: [PATCH 01/11] Adds vim / CHICKEN compiler artefacts to gitignore --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e4e5f6c..e186b71 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ -*~ \ No newline at end of file +*~ +*.swp +*.import.scm +*.so +salmonella.log From 2e3c368b57c8a39f9f9251545860a73d60eca6a8 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:08:50 -0600 Subject: [PATCH 02/11] Changes module to srfi-128 and modifies include paths Note that I also fixed everything to just use spaces since it appears there was mixed indentation in the file itself. --- comparators/comparators.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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:)) From 351a65321322e38a3b99c1e11976f1859fbe3494 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:09:56 -0600 Subject: [PATCH 03/11] Setup tests to run with salmonella once egg is packaged Note that for some reason one test fails. This is the final test, which fails because `(fake-salt-hash #t)` is an error (the procedure doesn't exist). I imagine it has been removed or existed only locally. I have no idea of its origin. --- comparators/comparators-test.scm | 4 ++-- tests/run.scm | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 tests/run.scm diff --git a/comparators/comparators-test.scm b/comparators/comparators-test.scm index ea06a1e..15cfbbb 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)) 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") From c79dc20b283519b53cff0b6cf0a4cbbda5215f81 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:11:37 -0600 Subject: [PATCH 04/11] Adds types file to gitignore It is a compilation artefact and isn't worth keeping since it is generated when the egg is compiled. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e186b71..79801b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.swp *.import.scm *.so +*.types salmonella.log From 3b67689344250925904995ef68d156f794dd6e7b Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:12:34 -0600 Subject: [PATCH 05/11] Adds meta, setup, and release-info to repo --- srfi-128.meta | 21 +++++++++++++++++++++ srfi-128.release-info | 3 +++ srfi-128.setup | 13 +++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 srfi-128.meta create mode 100644 srfi-128.release-info create mode 100644 srfi-128.setup diff --git a/srfi-128.meta b/srfi-128.meta new file mode 100644 index 0000000..cd94a39 --- /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") + (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..ef6ec4f --- /dev/null +++ b/srfi-128.setup @@ -0,0 +1,13 @@ +;; -*- Hen -*- + +(define (dynld-name fn) + (make-pathname #f fn ##sys#load-dynamic-extension)) + +(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"))) From bba35c12afcd5005d6ecbd02cedc7eefd5556e16 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:13:04 -0600 Subject: [PATCH 06/11] Removes old meta/setup in favour of srfi-128.{meta/setup} --- comparators/comparators.meta | 13 ------------- comparators/comparators.setup | 10 ---------- 2 files changed, 23 deletions(-) delete mode 100644 comparators/comparators.meta delete mode 100644 comparators/comparators.setup 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.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))) From 5cb05053614ca4c4810d15f7e1a315f768d3ed01 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:13:50 -0600 Subject: [PATCH 07/11] Adds LICENSE and README.md to the repo --- LICENSE | 19 +++++++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 LICENSE create mode 100644 README.md 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. From a4c0ddff86b6e72b6e30717832866c6199e32e6f Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:37:48 -0600 Subject: [PATCH 08/11] Removes failing / faulty test --- comparators/comparators-test.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comparators/comparators-test.scm b/comparators/comparators-test.scm index 15cfbbb..33c074c 100644 --- a/comparators/comparators-test.scm +++ b/comparators/comparators-test.scm @@ -250,7 +250,7 @@ (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)) + ;(test (hash-salt) (fake-salt-hash #t)) ) ; end comparators/bound-salt ) ; end comparators From 4a49733deb7c1331b9bcc65fcc8f0bc228d519c1 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 17:38:41 -0600 Subject: [PATCH 09/11] Delets faulty test --- comparators/comparators-test.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/comparators/comparators-test.scm b/comparators/comparators-test.scm index 33c074c..ce58348 100644 --- a/comparators/comparators-test.scm +++ b/comparators/comparators-test.scm @@ -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 From 484c8805c490fe28677a87016081086cf39eee80 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 18:08:17 -0600 Subject: [PATCH 10/11] Giving myself some credit --- srfi-128.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srfi-128.meta b/srfi-128.meta index cd94a39..4a7f41e 100644 --- a/srfi-128.meta +++ b/srfi-128.meta @@ -14,7 +14,7 @@ (category data) (depends numbers) (test-depends test) - (author "John Cowan, Egg by Jörg F. Wittenberger") + (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") From 4d4ec1b70ba14b04f6a48f067059307407c9d930 Mon Sep 17 00:00:00 2001 From: Jeremy Steward Date: Sat, 30 Apr 2016 18:11:27 -0600 Subject: [PATCH 11/11] Removes extraneous definition from setup --- srfi-128.setup | 3 --- 1 file changed, 3 deletions(-) diff --git a/srfi-128.setup b/srfi-128.setup index ef6ec4f..38b4c0e 100644 --- a/srfi-128.setup +++ b/srfi-128.setup @@ -1,8 +1,5 @@ ;; -*- Hen -*- -(define (dynld-name fn) - (make-pathname #f fn ##sys#load-dynamic-extension)) - (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")