Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Notable changes to shen-lua. Release notes for earlier versions are under

### Changed

- **Kernel: ShenOSKernel 43.1 at upstream `ec16a9f`** (the 43.1 release plus
shen-sources#117): `shen.by-hypothesis` and `shen.search-user-datatypes`
dereference the checked term once per call through new `-h` predicates, and
fail at once on an empty list. Vendored byte-identical from
`ShenOSKernel-43.1-ec16a9f.tar.gz` (SHA-256 `060066a8…9baacd`); `(version)`
is still `"43.1"`. The native typechecker follows it without falling back:
`typecheck_native.lua` accepts the new `shen.search-user-datatypes`
fingerprint (the hand port already fails on an empty list), and the driver
translator compiles the `(= (shen.lazyderef Hyp B) ())` guard in
`shen.by-hypothesis` as an arena comparison. eqterm still fires in
`shen.by-hypothesis-h`.

- **Kernel: ShenOSKernel 43.1** (community `Shen-Language/shen-sources`);
vendored wholesale from the verified `shen-43.1` release. The public
`char-stream?`, `read-unit-string`, and `write-string` interfaces are
Expand Down
17 changes: 14 additions & 3 deletions klambda/PROVENANCE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Provenance of the vendored KLambda kernel

## Current: ShenOSKernel 43.1 (community `shen-sources` line)
## Current: ShenOSKernel 43.1 at upstream `ec16a9f` (community `shen-sources` line)

The 23 `.kl` files are vendored **byte-identical** from the kernel built at upstream
`Shen-Language/shen-sources` master `ec16a9f`: the 43.1 release plus the type checker's
deref-once change (shen-sources#117, with its empty-list guard). The kernel test suite
under `../tests/` is unchanged from 43.1 and identical to that build's.

- **Build**: `ShenOSKernel-43.1-ec16a9f.tar.gz`, unmodified upstream sources built with
the repo's `make klambda`/`make release`, from
https://github.com/pyrex41/shen-sources/releases/tag/upstream-ec16a9f
- SHA-256: `060066a8f84d9a2f7d41cb3b37b986a8d4653279752b739b5063cd648d9baacd`
- `(version)` still reports `"43.1"`.

The record of the original 43.1 import follows.

All 23 official `.kl` files and the kernel test suite under `../tests/` are vendored
**byte-identical** from the ShenOSKernel 43.1 release.

- **Repository**: [`Shen-Language/shen-sources`](https://github.com/Shen-Language/shen-sources)
- Tag: `shen-43.1`
Expand Down
3 changes: 2 additions & 1 deletion klambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

These are the KLambda sources of **ShenOSKernel 43.1** (community
[`shen-sources`](https://github.com/Shen-Language/shen-sources) release
`shen-43.1`), vendored byte-identical so that `shen-lua` is self-contained:
`shen-43.1`, as built at upstream master `ec16a9f`, which adds shen-sources#117),
vendored byte-identical so that `shen-lua` is self-contained:
you can `git clone` and run without a separate kernel checkout. See
[PROVENANCE.md](PROVENANCE.md) for the exact source, checksum and the lineage
note (this replaced Tarver's S42.0 kernel). The public character stream
Expand Down
18 changes: 9 additions & 9 deletions klambda/extension-expand-dynamic.kl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ BSD 3-Clause License: http://opensource.org/licenses/BSD-3-Clause"

(defun shen.x.expand-dynamic.initialise () (set shen.x.expand-dynamic.*arities* ()))

(defun shen.x.expand-dynamic.expand-dynamic (V7449) (cond ((= () V7449) ()) ((and (cons? V7449) (and (cons? (hd V7449)) (and (= declare (hd (hd V7449))) (and (cons? (tl (hd V7449))) (and (cons? (tl (tl (hd V7449)))) (= () (tl (tl (tl (hd V7449)))))))))) (cons (shen.x.expand-dynamic.expand-declare (hd V7449)) (shen.x.expand-dynamic.expand-dynamic (tl V7449)))) ((and (cons? V7449) (and (cons? (hd V7449)) (and (= shen.initialise-arity-table (hd (hd V7449))) (and (cons? (tl (hd V7449))) (= () (tl (tl (hd V7449)))))))) (do (set shen.x.expand-dynamic.*arities* (eval-kl (hd (tl (hd V7449))))) (cons (hd V7449) (shen.x.expand-dynamic.expand-dynamic (tl V7449))))) ((and (cons? V7449) (and (cons? (hd V7449)) (and (= shen.build-lambda-table (hd (hd V7449))) (and (cons? (tl (hd V7449))) (and (cons? (hd (tl (hd V7449)))) (and (= external (hd (hd (tl (hd V7449))))) (and (cons? (tl (hd (tl (hd V7449))))) (and (= shen (hd (tl (hd (tl (hd V7449)))))) (and (= () (tl (tl (hd (tl (hd V7449)))))) (= () (tl (tl (hd V7449))))))))))))) (let W7450 X (append (shen.x.expand-dynamic.expand-lambda-entries (cons shen.tuple (cons 1 (cons shen.pvar (cons 1 (cons shen.dictionary (cons 1 (cons shen.print-prolog-vector (cons 1 (cons shen.print-freshterm (cons 1 (cons shen.printF (cons 1 (value shen.x.expand-dynamic.*arities*)))))))))))))) (shen.x.expand-dynamic.expand-dynamic (tl V7449))))) ((cons? V7449) (cons (hd V7449) (shen.x.expand-dynamic.expand-dynamic (tl V7449)))) (true (shen.f-error shen.x.expand-dynamic.expand-dynamic))))
(defun shen.x.expand-dynamic.expand-dynamic (V7477) (cond ((= () V7477) ()) ((and (cons? V7477) (and (cons? (hd V7477)) (and (= declare (hd (hd V7477))) (and (cons? (tl (hd V7477))) (and (cons? (tl (tl (hd V7477)))) (= () (tl (tl (tl (hd V7477)))))))))) (cons (shen.x.expand-dynamic.expand-declare (hd V7477)) (shen.x.expand-dynamic.expand-dynamic (tl V7477)))) ((and (cons? V7477) (and (cons? (hd V7477)) (and (= shen.initialise-arity-table (hd (hd V7477))) (and (cons? (tl (hd V7477))) (= () (tl (tl (hd V7477)))))))) (do (set shen.x.expand-dynamic.*arities* (eval-kl (hd (tl (hd V7477))))) (cons (hd V7477) (shen.x.expand-dynamic.expand-dynamic (tl V7477))))) ((and (cons? V7477) (and (cons? (hd V7477)) (and (= shen.build-lambda-table (hd (hd V7477))) (and (cons? (tl (hd V7477))) (and (cons? (hd (tl (hd V7477)))) (and (= external (hd (hd (tl (hd V7477))))) (and (cons? (tl (hd (tl (hd V7477))))) (and (= shen (hd (tl (hd (tl (hd V7477)))))) (and (= () (tl (tl (hd (tl (hd V7477)))))) (= () (tl (tl (hd V7477))))))))))))) (let W7478 X (append (shen.x.expand-dynamic.expand-lambda-entries (cons shen.tuple (cons 1 (cons shen.pvar (cons 1 (cons shen.dictionary (cons 1 (cons shen.print-prolog-vector (cons 1 (cons shen.print-freshterm (cons 1 (cons shen.printF (cons 1 (value shen.x.expand-dynamic.*arities*)))))))))))))) (shen.x.expand-dynamic.expand-dynamic (tl V7477))))) ((cons? V7477) (cons (hd V7477) (shen.x.expand-dynamic.expand-dynamic (tl V7477)))) (true (shen.f-error shen.x.expand-dynamic.expand-dynamic))))

(defun shen.x.expand-dynamic.functions-with-lambdas (V7451) (cond ((= () V7451) ()) ((and (cons? V7451) (cons? (tl V7451))) (cons (hd V7451) (shen.x.expand-dynamic.functions-with-lambdas (tl (tl V7451))))) (true (shen.f-error shen.x.expand-dynamic.functions-with-lambdas))))
(defun shen.x.expand-dynamic.functions-with-lambdas (V7479) (cond ((= () V7479) ()) ((and (cons? V7479) (cons? (tl V7479))) (cons (hd V7479) (shen.x.expand-dynamic.functions-with-lambdas (tl (tl V7479))))) (true (shen.f-error shen.x.expand-dynamic.functions-with-lambdas))))

(defun shen.x.expand-dynamic.expand-declare (V7452) (cond ((and (cons? V7452) (and (= declare (hd V7452)) (and (cons? (tl V7452)) (and (cons? (tl (tl V7452))) (= () (tl (tl (tl V7452)))))))) (let W7453 (eval-kl (hd (tl (tl V7452)))) (let W7454 (shen.prolog-abstraction W7453) (let W7455 (cons set (cons shen.*sigf* (cons (cons shen.assoc-> (cons (hd (tl V7452)) (cons W7454 (cons (cons value (cons shen.*sigf* ())) ())))) ()))) W7455)))) (true (shen.f-error shen.x.expand-dynamic.expand-declare))))
(defun shen.x.expand-dynamic.expand-declare (V7480) (cond ((and (cons? V7480) (and (= declare (hd V7480)) (and (cons? (tl V7480)) (and (cons? (tl (tl V7480))) (= () (tl (tl (tl V7480)))))))) (let W7481 (eval-kl (hd (tl (tl V7480)))) (let W7482 (shen.prolog-abstraction W7481) (let W7483 (cons set (cons shen.*sigf* (cons (cons shen.assoc-> (cons (hd (tl V7480)) (cons W7482 (cons (cons value (cons shen.*sigf* ())) ())))) ()))) W7483)))) (true (shen.f-error shen.x.expand-dynamic.expand-declare))))

(defun shen.x.expand-dynamic.expand-lambda-entries (V7456) (cond ((= () V7456) ()) ((and (cons? V7456) (cons? (tl V7456))) (append (shen.x.expand-dynamic.expand-lambda-form-entry (hd V7456) (hd (tl V7456))) (shen.x.expand-dynamic.expand-lambda-entries (tl (tl V7456))))) (true (simple-error (cn "expand-lambda-entries: got unexpected " (shen.app V7456 "" shen.a))))))
(defun shen.x.expand-dynamic.expand-lambda-entries (V7484) (cond ((= () V7484) ()) ((and (cons? V7484) (cons? (tl V7484))) (append (shen.x.expand-dynamic.expand-lambda-form-entry (hd V7484) (hd (tl V7484))) (shen.x.expand-dynamic.expand-lambda-entries (tl (tl V7484))))) (true (simple-error (cn "expand-lambda-entries: got unexpected " (shen.app V7484 "" shen.a))))))

(defun shen.x.expand-dynamic.expand-lambda-form-entry (V7465 V7466) (cond ((= package V7465) ()) ((= receive V7465) ()) ((= list V7465) ()) ((= foreign V7465) ()) (true (if (= V7466 -1) () (if (= V7466 0) () (cons (cons shen.set-lambda-form-entry (cons (cons cons (cons V7465 (cons (shen.lambda-function (cons V7465 ()) V7466) ()))) ())) ()))))))
(defun shen.x.expand-dynamic.expand-lambda-form-entry (V7493 V7494) (cond ((= package V7493) ()) ((= receive V7493) ()) ((= list V7493) ()) ((= foreign V7493) ()) (true (if (= V7494 -1) () (if (= V7494 0) () (cons (cons shen.set-lambda-form-entry (cons (cons cons (cons V7493 (cons (shen.lambda-function (cons V7493 ()) V7494) ()))) ())) ()))))))

(defun shen.x.expand-dynamic.split-defuns-h (V7467 V7468) (cond ((and (cons? V7467) (and (cons? (hd V7467)) (and (= defun (hd (hd V7467))) (tuple? V7468)))) (shen.x.expand-dynamic.split-defuns-h (tl V7467) (@p (cons (hd V7467) (fst V7468)) (snd V7468)))) ((and (cons? V7467) (tuple? V7468)) (shen.x.expand-dynamic.split-defuns-h (tl V7467) (@p (fst V7468) (cons (hd V7467) (snd V7468))))) ((and (= () V7467) (tuple? V7468)) (@p (reverse (fst V7468)) (reverse (snd V7468)))) (true (shen.f-error shen.x.expand-dynamic.split-defuns-h))))
(defun shen.x.expand-dynamic.split-defuns-h (V7495 V7496) (cond ((and (cons? V7495) (and (cons? (hd V7495)) (and (= defun (hd (hd V7495))) (tuple? V7496)))) (shen.x.expand-dynamic.split-defuns-h (tl V7495) (@p (cons (hd V7495) (fst V7496)) (snd V7496)))) ((and (cons? V7495) (tuple? V7496)) (shen.x.expand-dynamic.split-defuns-h (tl V7495) (@p (fst V7496) (cons (hd V7495) (snd V7496))))) ((and (= () V7495) (tuple? V7496)) (@p (reverse (fst V7496)) (reverse (snd V7496)))) (true (shen.f-error shen.x.expand-dynamic.split-defuns-h))))

(defun shen.x.expand-dynamic.split-defuns (V7469) (shen.x.expand-dynamic.split-defuns-h V7469 (@p () ())))
(defun shen.x.expand-dynamic.split-defuns (V7497) (shen.x.expand-dynamic.split-defuns-h V7497 (@p () ())))

(defun shen.x.expand-dynamic.wrap-in-defun (V7470 V7471 V7472) (cons defun (cons V7470 (cons V7471 (cons (shen.x.expand-dynamic.to-single-expression V7470 V7472) ())))))
(defun shen.x.expand-dynamic.wrap-in-defun (V7498 V7499 V7500) (cons defun (cons V7498 (cons V7499 (cons (shen.x.expand-dynamic.to-single-expression V7498 V7500) ())))))

(defun shen.x.expand-dynamic.to-single-expression (V7477 V7478) (cond ((and (cons? V7478) (= () (tl V7478))) (hd V7478)) ((cons? V7478) (cons do (cons (hd V7478) (cons (shen.x.expand-dynamic.to-single-expression V7477 (tl V7478)) ())))) (true (simple-error (cn "to-single-expression: got empty list of expressions: " (shen.app V7477 "" shen.a))))))
(defun shen.x.expand-dynamic.to-single-expression (V7505 V7506) (cond ((and (cons? V7506) (= () (tl V7506))) (hd V7506)) ((cons? V7506) (cons do (cons (hd V7506) (cons (shen.x.expand-dynamic.to-single-expression V7505 (tl V7506)) ())))) (true (simple-error (cn "to-single-expression: got empty list of expressions: " (shen.app V7505 "" shen.a))))))

6 changes: 3 additions & 3 deletions klambda/extension-features.kl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"Copyright (c) 2019 Bruno Deferrari.
BSD 3-Clause License: http://opensource.org/licenses/BSD-3-Clause"

(defun shen.x.features.cond-expand-macro (V7285) (cond ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (= () (tl V7285)))) (simple-error "Unfulfilled shen.x.features.cond-expand clause.")) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (= true (hd (tl V7285))) (and (cons? (tl (tl V7285))) (= () (tl (tl (tl V7285))))))))) (hd (tl (tl V7285)))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (hd (tl V7285))) (and (= and (hd (hd (tl V7285)))) (and (= () (tl (hd (tl V7285)))) (cons? (tl (tl V7285))))))))) (hd (tl (tl V7285)))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (hd (tl V7285))) (and (= and (hd (hd (tl V7285)))) (and (cons? (tl (hd (tl V7285)))) (cons? (tl (tl V7285))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7285)))) (cons (cons shen.x.features.cond-expand (cons (cons and (tl (tl (hd (tl V7285))))) (tl (tl V7285)))) (tl (tl (tl V7285))))))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (hd (tl V7285))) (and (= or (hd (hd (tl V7285)))) (and (= () (tl (hd (tl V7285)))) (cons? (tl (tl V7285))))))))) (cons shen.x.features.cond-expand (tl (tl (tl V7285))))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (hd (tl V7285))) (and (= or (hd (hd (tl V7285)))) (and (cons? (tl (hd (tl V7285)))) (cons? (tl (tl V7285))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7285)))) (cons (hd (tl (tl V7285))) (cons true (cons (cons shen.x.features.cond-expand (cons (cons or (tl (tl (hd (tl V7285))))) (tl (tl V7285)))) ())))))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (hd (tl V7285))) (and (= not (hd (hd (tl V7285)))) (and (cons? (tl (hd (tl V7285)))) (and (= () (tl (tl (hd (tl V7285))))) (cons? (tl (tl V7285)))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7285)))) (cons (cons shen.x.features.cond-expand (tl (tl (tl V7285)))) (cons true (cons (hd (tl (tl V7285))) ())))))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (and (cons? (tl (tl V7285))) (element? (hd (tl V7285)) (value shen.x.features.*features*)))))) (hd (tl (tl V7285)))) ((and (cons? V7285) (and (= shen.x.features.cond-expand (hd V7285)) (and (cons? (tl V7285)) (cons? (tl (tl V7285)))))) (cons shen.x.features.cond-expand (tl (tl (tl V7285))))) (true V7285)))
(defun shen.x.features.cond-expand-macro (V7313) (cond ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (= () (tl V7313)))) (simple-error "Unfulfilled shen.x.features.cond-expand clause.")) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (= true (hd (tl V7313))) (and (cons? (tl (tl V7313))) (= () (tl (tl (tl V7313))))))))) (hd (tl (tl V7313)))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (hd (tl V7313))) (and (= and (hd (hd (tl V7313)))) (and (= () (tl (hd (tl V7313)))) (cons? (tl (tl V7313))))))))) (hd (tl (tl V7313)))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (hd (tl V7313))) (and (= and (hd (hd (tl V7313)))) (and (cons? (tl (hd (tl V7313)))) (cons? (tl (tl V7313))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7313)))) (cons (cons shen.x.features.cond-expand (cons (cons and (tl (tl (hd (tl V7313))))) (tl (tl V7313)))) (tl (tl (tl V7313))))))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (hd (tl V7313))) (and (= or (hd (hd (tl V7313)))) (and (= () (tl (hd (tl V7313)))) (cons? (tl (tl V7313))))))))) (cons shen.x.features.cond-expand (tl (tl (tl V7313))))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (hd (tl V7313))) (and (= or (hd (hd (tl V7313)))) (and (cons? (tl (hd (tl V7313)))) (cons? (tl (tl V7313))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7313)))) (cons (hd (tl (tl V7313))) (cons true (cons (cons shen.x.features.cond-expand (cons (cons or (tl (tl (hd (tl V7313))))) (tl (tl V7313)))) ())))))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (hd (tl V7313))) (and (= not (hd (hd (tl V7313)))) (and (cons? (tl (hd (tl V7313)))) (and (= () (tl (tl (hd (tl V7313))))) (cons? (tl (tl V7313)))))))))) (cons shen.x.features.cond-expand (cons (hd (tl (hd (tl V7313)))) (cons (cons shen.x.features.cond-expand (tl (tl (tl V7313)))) (cons true (cons (hd (tl (tl V7313))) ())))))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (and (cons? (tl (tl V7313))) (element? (hd (tl V7313)) (value shen.x.features.*features*)))))) (hd (tl (tl V7313)))) ((and (cons? V7313) (and (= shen.x.features.cond-expand (hd V7313)) (and (cons? (tl V7313)) (cons? (tl (tl V7313)))))) (cons shen.x.features.cond-expand (tl (tl (tl V7313))))) (true V7313)))

(defun shen.x.features.current () (value shen.x.features.*features*))

(defun shen.x.features.initialise (V7286) (do (declare shen.x.features.initialise (cons (cons list (cons symbol ())) (cons --> (cons (cons list (cons symbol ())) ())))) (do (declare shen.x.features.current (cons --> (cons (cons list (cons symbol ())) ()))) (do (declare shen.x.features.add (cons symbol (cons --> (cons (cons list (cons symbol ())) ())))) (let W7287 (trap-error (value shen.x.features.*features*) (lambda Z7288 (do (set shen.x.features.*features* ()) (do (shen.set-lambda-form-entry (cons shen.x.features.cond-expand-macro (lambda Z7289 (shen.x.features.cond-expand-macro Z7289)))) (shen.record-macro shen.x.features.cond-expand-macro (lambda Z7290 (shen.x.features.cond-expand-macro Z7290))))))) (let W7291 (shen.x.features.current) (let W7292 (set shen.x.features.*features* V7286) W7291)))))))
(defun shen.x.features.initialise (V7314) (do (declare shen.x.features.initialise (cons (cons list (cons symbol ())) (cons --> (cons (cons list (cons symbol ())) ())))) (do (declare shen.x.features.current (cons --> (cons (cons list (cons symbol ())) ()))) (do (declare shen.x.features.add (cons symbol (cons --> (cons (cons list (cons symbol ())) ())))) (let W7315 (trap-error (value shen.x.features.*features*) (lambda Z7316 (do (set shen.x.features.*features* ()) (do (shen.set-lambda-form-entry (cons shen.x.features.cond-expand-macro (lambda Z7317 (shen.x.features.cond-expand-macro Z7317)))) (shen.record-macro shen.x.features.cond-expand-macro (lambda Z7318 (shen.x.features.cond-expand-macro Z7318))))))) (let W7319 (shen.x.features.current) (let W7320 (set shen.x.features.*features* V7314) W7319)))))))

(defun shen.x.features.add (V7293) (let W7294 (shen.x.features.current) (let W7295 (set shen.x.features.*features* (adjoin V7293 W7294)) W7294)))
(defun shen.x.features.add (V7321) (let W7322 (shen.x.features.current) (let W7323 (set shen.x.features.*features* (adjoin V7321 W7322)) W7322)))

Loading
Loading