mit-scheme.git
6 years agoAdd forgotten export.
Chris Hanson [Wed, 21 Mar 2018 05:53:32 +0000 (22:53 -0700)]
Add forgotten export.

6 years agoChange spar-match-null to a procedure.
Chris Hanson [Tue, 20 Mar 2018 05:34:31 +0000 (22:34 -0700)]
Change spar-match-null to a procedure.

6 years agoSimplify spar interface a bit more.
Chris Hanson [Mon, 19 Mar 2018 03:38:53 +0000 (20:38 -0700)]
Simplify spar interface a bit more.

6 years agoImplement record inheritance at Arthur's request.
Chris Hanson [Mon, 19 Mar 2018 03:10:00 +0000 (20:10 -0700)]
Implement record inheritance at Arthur's request.

6 years agoEliminate default-inits arg from make-record-type.
Chris Hanson [Sun, 18 Mar 2018 22:01:23 +0000 (15:01 -0700)]
Eliminate default-inits arg from make-record-type.

This will allow all optional args to be removed after 9.3.

6 years agoStreamline definition of record-type proxies.
Chris Hanson [Sat, 17 Mar 2018 23:42:40 +0000 (16:42 -0700)]
Streamline definition of record-type proxies.

6 years agoAllow a record to be both applicable and fasdumpable.
Chris Hanson [Sat, 17 Mar 2018 23:38:30 +0000 (16:38 -0700)]
Allow a record to be both applicable and fasdumpable.

6 years agoRestrict access to type proxies.
Chris Hanson [Sat, 17 Mar 2018 23:38:13 +0000 (16:38 -0700)]
Restrict access to type proxies.

6 years agoChange default value of repl:write-result-hash-numbers? as requested by GJS.
Chris Hanson [Sat, 17 Mar 2018 07:56:09 +0000 (00:56 -0700)]
Change default value of repl:write-result-hash-numbers? as requested by GJS.

6 years agoChange pathname representation to be a fasdumpable record.
Chris Hanson [Fri, 16 Mar 2018 05:52:45 +0000 (22:52 -0700)]
Change pathname representation to be a fasdumpable record.

6 years agoUse proxy instances for set-record-type-fasdumpable!.
Chris Hanson [Fri, 16 Mar 2018 05:52:24 +0000 (22:52 -0700)]
Use proxy instances for set-record-type-fasdumpable!.

6 years agoFix typo in previous change.
Chris Hanson [Fri, 16 Mar 2018 05:52:08 +0000 (22:52 -0700)]
Fix typo in previous change.

6 years agoImplement fasdumpable records.
Chris Hanson [Fri, 16 Mar 2018 05:28:31 +0000 (22:28 -0700)]
Implement fasdumpable records.

This is restricted to the runtime system since each type must have a
pre-allocated constant to represent it in the proxy table.

At the moment an applicable record can't be fasdumpable too.  That can be fixed
by teaching the microcode about the proxy mechanism, but for now it's not
necessary.

6 years agoIn pp, treat named list/vector specially.
Chris Hanson [Thu, 15 Mar 2018 04:37:56 +0000 (21:37 -0700)]
In pp, treat named list/vector specially.

6 years agoUse cached predicate dispatchers only where tagging is ubiquitous.
Chris Hanson [Thu, 15 Mar 2018 04:29:03 +0000 (21:29 -0700)]
Use cached predicate dispatchers only where tagging is ubiquitous.

6 years agoImplement applicable records.
Chris Hanson [Wed, 14 Mar 2018 05:54:25 +0000 (22:54 -0700)]
Implement applicable records.

6 years agoChange representation of dispatch tags to eliminated nested "extra" vector.
Chris Hanson [Tue, 13 Mar 2018 05:18:37 +0000 (22:18 -0700)]
Change representation of dispatch tags to eliminated nested "extra" vector.

6 years agoEliminate two unused procedures.
Chris Hanson [Wed, 7 Mar 2018 04:52:32 +0000 (20:52 -0800)]
Eliminate two unused procedures.

6 years agoGuarantee that capture-syntactic-environment preserves error context.
Chris Hanson [Wed, 7 Mar 2018 04:48:07 +0000 (20:48 -0800)]
Guarantee that capture-syntactic-environment preserves error context.

6 years agoSome more tweaks to the low-level macro interfaces.
Chris Hanson [Wed, 7 Mar 2018 02:26:54 +0000 (18:26 -0800)]
Some more tweaks to the low-level macro interfaces.

6 years agoImplement first two macros using syntax-parser.
Chris Hanson [Wed, 7 Mar 2018 01:47:16 +0000 (17:47 -0800)]
Implement first two macros using syntax-parser.

6 years agoMore tweaks to syntax-parser interface.
Chris Hanson [Wed, 7 Mar 2018 01:46:34 +0000 (17:46 -0800)]
More tweaks to syntax-parser interface.

6 years agoTweak interface for syntax-parser macros.
Chris Hanson [Wed, 7 Mar 2018 01:26:11 +0000 (17:26 -0800)]
Tweak interface for syntax-parser macros.

6 years agoRefactor syntax-low to improve support for spar transformers.
Chris Hanson [Sun, 4 Mar 2018 06:23:23 +0000 (22:23 -0800)]
Refactor syntax-low to improve support for spar transformers.

6 years agoEliminate a bunch of now-unused classifier procedures.
Chris Hanson [Sat, 3 Mar 2018 18:58:32 +0000 (10:58 -0800)]
Eliminate a bunch of now-unused classifier procedures.

6 years agoSplit compile-expr-item into expr and non-expr versions.
Chris Hanson [Thu, 1 Mar 2018 06:18:00 +0000 (22:18 -0800)]
Split compile-expr-item into expr and non-expr versions.

6 years agoAdd weak-pair support to equal?.
Chris Hanson [Wed, 28 Feb 2018 06:27:22 +0000 (22:27 -0800)]
Add weak-pair support to equal?.

6 years agoAdd call/cc as alias.
Chris Hanson [Wed, 28 Feb 2018 06:20:53 +0000 (22:20 -0800)]
Add call/cc as alias.

6 years agoAllow calling register-predicate! twice with the same args.
Chris Hanson [Wed, 28 Feb 2018 06:16:05 +0000 (22:16 -0800)]
Allow calling register-predicate! twice with the same args.

6 years agoPut back support for printing tagged lists and vectors when built by 9.2.
Chris Hanson [Fri, 23 Feb 2018 07:36:24 +0000 (23:36 -0800)]
Put back support for printing tagged lists and vectors when built by 9.2.

6 years agoMake sure that tagged vector/pair predicates are registered.
Chris Hanson [Thu, 22 Feb 2018 07:35:23 +0000 (23:35 -0800)]
Make sure that tagged vector/pair predicates are registered.

6 years agoChange compiled-code environments to be records.
Chris Hanson [Thu, 22 Feb 2018 07:34:53 +0000 (23:34 -0800)]
Change compiled-code environments to be records.

6 years agoPut error messages back into classifiers.
Chris Hanson [Wed, 21 Feb 2018 07:27:45 +0000 (23:27 -0800)]
Put error messages back into classifiers.

Also:
* Clean up spar API some more.
* Add spar-error for signalling errors.
* Add special args for specifying procedure args.

6 years agoRename spar-require-X to spar-match-X.
Chris Hanson [Wed, 21 Feb 2018 05:31:51 +0000 (21:31 -0800)]
Rename spar-require-X to spar-match-X.

6 years agoMake sure to flatten items in a body.
Chris Hanson [Wed, 21 Feb 2018 01:48:08 +0000 (17:48 -0800)]
Make sure to flatten items in a body.

6 years agoRewrite mit-syntax using syntax parsers.
Chris Hanson [Tue, 20 Feb 2018 07:13:39 +0000 (23:13 -0800)]
Rewrite mit-syntax using syntax parsers.

This is functionally equivalent except for error reporting.  Most syntax errors
will be "ill-formed syntax" with a form.  An future commit will tailor the
messages to be more informative.

This also breaks one syntax test, which will be fixed in the next commit.

6 years agoAnother round of changes to the spar API.
Chris Hanson [Tue, 20 Feb 2018 07:01:29 +0000 (23:01 -0800)]
Another round of changes to the spar API.

6 years agoFix thinko.
Chris Hanson [Mon, 19 Feb 2018 20:27:45 +0000 (12:27 -0800)]
Fix thinko.

6 years agoImplement spar-macro-transformer.
Chris Hanson [Mon, 19 Feb 2018 06:32:39 +0000 (22:32 -0800)]
Implement spar-macro-transformer.

6 years agoSplit transformer->expander procedures into internal and external.
Chris Hanson [Mon, 19 Feb 2018 06:01:22 +0000 (22:01 -0800)]
Split transformer->expander procedures into internal and external.

The external version takes a runtime environment as its closing env, while the
internal version takes a syntactic environment.

6 years agoMerge classifier and keyword items.
Chris Hanson [Mon, 19 Feb 2018 05:44:09 +0000 (21:44 -0800)]
Merge classifier and keyword items.

6 years agoA round of updates to the syntax parser.
Chris Hanson [Mon, 19 Feb 2018 05:13:18 +0000 (21:13 -0800)]
A round of updates to the syntax parser.

6 years agoAdd syntax-parser to runtime; not yet being used.
Chris Hanson [Sun, 18 Feb 2018 08:49:48 +0000 (00:49 -0800)]
Add syntax-parser to runtime; not yet being used.

6 years agoRefactor the syntax-error mechanism.
Chris Hanson [Thu, 15 Feb 2018 03:29:32 +0000 (19:29 -0800)]
Refactor the syntax-error mechanism.

* There's now a condition type for syntax errors.
* There's a distinction between errors that happen in macro expanders and those
  that happen inside the syntax implementation.
* All syntax errors now get the (form senv hist) objects.
* Syntax errors don't yet use the history to report context; that will come
  later.

6 years agoEliminate keyword-binder.
Chris Hanson [Thu, 15 Feb 2018 03:03:59 +0000 (19:03 -0800)]
Eliminate keyword-binder.

6 years agoMake field-names argument of condition-constructor be optional.
Chris Hanson [Thu, 15 Feb 2018 02:48:53 +0000 (18:48 -0800)]
Make field-names argument of condition-constructor be optional.

When that happens it uses the type's field-names value.

6 years agoSimplify slightly be introducing smap.
Chris Hanson [Wed, 14 Feb 2018 06:11:44 +0000 (22:11 -0800)]
Simplify slightly be introducing smap.

6 years agodecl-item doesn't need to be distinct from expr-item.
Chris Hanson [Wed, 14 Feb 2018 01:37:28 +0000 (17:37 -0800)]
decl-item doesn't need to be distinct from expr-item.

6 years agoMake sure history is correct for identifiers in declarations.
Chris Hanson [Tue, 13 Feb 2018 06:03:09 +0000 (22:03 -0800)]
Make sure history is correct for identifiers in declarations.

Plumb selectors through map-decl-ids and pass to procedure.

6 years agoReorganize cold-load for syntax.
Chris Hanson [Tue, 13 Feb 2018 05:24:32 +0000 (21:24 -0800)]
Reorganize cold-load for syntax.

* Rename syntax-transforms to syntax-low.
* Move expander-item to syntax-low.
* Don't load syntax-items early in cold load.
* Move compile-expr-item to syntax-items.

6 years agoBind classifiers directly into global environment.
Chris Hanson [Tue, 13 Feb 2018 04:50:20 +0000 (20:50 -0800)]
Bind classifiers directly into global environment.

Eliminates kludge of syntax-definitions.

6 years agoEliminate compile-body-item and simplify.
Chris Hanson [Mon, 12 Feb 2018 06:48:57 +0000 (22:48 -0800)]
Eliminate compile-body-item and simplify.

6 years agoMinor tweaks to classifiers.
Chris Hanson [Mon, 12 Feb 2018 06:20:27 +0000 (22:20 -0800)]
Minor tweaks to classifiers.

6 years agoRename classify-body to classify-forms-in-order.
Chris Hanson [Mon, 12 Feb 2018 06:05:52 +0000 (22:05 -0800)]
Rename classify-body to classify-forms-in-order.

Also have it return a list of items rather than a seq-item.

6 years agoSome minor tweaks that were missed in earlier commits.
Chris Hanson [Mon, 12 Feb 2018 05:42:10 +0000 (21:42 -0800)]
Some minor tweaks that were missed in earlier commits.

6 years agoEliminate compiler items.
Chris Hanson [Mon, 12 Feb 2018 05:37:09 +0000 (21:37 -0800)]
Eliminate compiler items.

6 years agoEliminate compiler->keyword.
Chris Hanson [Mon, 12 Feb 2018 05:17:30 +0000 (21:17 -0800)]
Eliminate compiler->keyword.

6 years agoEliminate the remaining three compilers.
Chris Hanson [Mon, 12 Feb 2018 05:09:55 +0000 (21:09 -0800)]
Eliminate the remaining three compilers.

6 years agoChange most of the "compilers" to "classifiers".
Chris Hanson [Mon, 12 Feb 2018 04:51:48 +0000 (20:51 -0800)]
Change most of the "compilers" to "classifiers".

This is the first step in eliminating the idea of a "compiler".

6 years agoInsert a reduction step in the history when processing a closed subexpression.
Chris Hanson [Sun, 11 Feb 2018 07:18:18 +0000 (23:18 -0800)]
Insert a reduction step in the history when processing a closed subexpression.

6 years agoImplement history mechanism for syntax processor.
Chris Hanson [Sun, 11 Feb 2018 07:14:18 +0000 (23:14 -0800)]
Implement history mechanism for syntax processor.

This mechanism keeps track of how each subexpression is derived from the larger
program, so that error messages can have that context.

The history isn't yet hooked up to anything; it's just being tracked.  The next
step is to attach it to the syntax errors and change the error messages to
reveal that context.

6 years agoMake sure that host-adapter causes rebuild of toolchain.
Chris Hanson [Sun, 11 Feb 2018 01:55:28 +0000 (17:55 -0800)]
Make sure that host-adapter causes rebuild of toolchain.

Also always load the .scm file since the compiled files may be out of date.

6 years agoRewrite this file to match current standards.
Chris Hanson [Sun, 11 Feb 2018 01:37:08 +0000 (17:37 -0800)]
Rewrite this file to match current standards.

6 years agoRevert change that broke the build.
Chris Hanson [Sat, 10 Feb 2018 05:35:42 +0000 (21:35 -0800)]
Revert change that broke the build.

6 years agoAnother small round of renaming.
Chris Hanson [Sat, 10 Feb 2018 04:53:13 +0000 (20:53 -0800)]
Another small round of renaming.

6 years agoEliminate now-unused output/lambda and rename output/{named-,}lambda.
Chris Hanson [Sat, 10 Feb 2018 04:48:23 +0000 (20:48 -0800)]
Eliminate now-unused output/lambda and rename output/{named-,}lambda.

6 years agoSome minor cleanups.
Chris Hanson [Sat, 10 Feb 2018 04:45:58 +0000 (20:45 -0800)]
Some minor cleanups.

6 years agoDowncase explicit arguments to syntax-check and syntax-match?.
Chris Hanson [Sat, 10 Feb 2018 04:37:06 +0000 (20:37 -0800)]
Downcase explicit arguments to syntax-check and syntax-match?.

Also replace '(keyword ...) -> '(_ ...) in syntax-check patterns.

6 years agoImplement classify-form-cXr to simplify code slightly.
Chris Hanson [Sat, 10 Feb 2018 04:24:38 +0000 (20:24 -0800)]
Implement classify-form-cXr to simplify code slightly.

This will be more important when history is added.

6 years agoRename environment to senv in mit-syntax.
Chris Hanson [Sat, 10 Feb 2018 04:17:29 +0000 (20:17 -0800)]
Rename environment to senv in mit-syntax.

6 years agoEliminate classify-expr.
Chris Hanson [Sat, 10 Feb 2018 04:12:04 +0000 (20:12 -0800)]
Eliminate classify-expr.

6 years agoA big round of renamings.
Chris Hanson [Fri, 9 Feb 2018 04:39:12 +0000 (20:39 -0800)]
A big round of renamings.

6 years agoChange predicate dispatchers to use dispatch cache.
Chris Hanson [Thu, 8 Feb 2018 07:34:00 +0000 (23:34 -0800)]
Change predicate dispatchers to use dispatch cache.

6 years agoEliminate keyword-value-item.
Chris Hanson [Wed, 7 Feb 2018 06:45:14 +0000 (22:45 -0800)]
Eliminate keyword-value-item.

6 years agoA bunch of renames to eliminate weird "/" phase of mine.
Chris Hanson [Wed, 7 Feb 2018 06:31:46 +0000 (22:31 -0800)]
A bunch of renames to eliminate weird "/" phase of mine.

6 years agoCollapse syntax, syntax-classify, and syntax-compile into one file.
Chris Hanson [Wed, 7 Feb 2018 04:48:53 +0000 (20:48 -0800)]
Collapse syntax, syntax-classify, and syntax-compile into one file.

6 years agoMake comment in identifier=? more comprehensive.
Chris Hanson [Wed, 7 Feb 2018 04:22:16 +0000 (20:22 -0800)]
Make comment in identifier=? more comprehensive.

6 years agoMove the higher-level senv procedures into syntax-environments.
Chris Hanson [Sat, 3 Feb 2018 08:18:48 +0000 (00:18 -0800)]
Move the higher-level senv procedures into syntax-environments.

* Clean up the high-level interface, making arg order consistent.
* Rename syntactic-environment->environment as syntactic-environment->runtime.
* Eliminate ->syntactic-environment in favor of runtime-environment->syntactic.
* Rename syntactic-environment/top-level? to top-level-syntactic-environment?.
* Export closed-identifier? to (runtime syntax).

6 years agoImplement better pp support for syntactic environments.
Chris Hanson [Fri, 2 Feb 2018 05:56:41 +0000 (21:56 -0800)]
Implement better pp support for syntactic environments.

This should be a standard pattern: what's interesting in these bundles of
procedures isn't the procedures themselves, but rather the state they are
carrying around.

6 years agoDon't generate keyword-value-item except at top level.
Chris Hanson [Fri, 2 Feb 2018 05:55:33 +0000 (21:55 -0800)]
Don't generate keyword-value-item except at top level.

They aren't needed for internal environments.

6 years agoHandle define-syntax better when unsyntaxing.
Chris Hanson [Fri, 2 Feb 2018 05:55:07 +0000 (21:55 -0800)]
Handle define-syntax better when unsyntaxing.

6 years agoFix test broken by earlier change.
Chris Hanson [Fri, 2 Feb 2018 05:54:55 +0000 (21:54 -0800)]
Fix test broken by earlier change.

6 years agoEliminate another empty file.
Chris Hanson [Thu, 1 Feb 2018 08:02:24 +0000 (00:02 -0800)]
Eliminate another empty file.

6 years agoSimplify how runtime syntactic environments are created.
Chris Hanson [Thu, 1 Feb 2018 07:00:33 +0000 (23:00 -0800)]
Simplify how runtime syntactic environments are created.

No more layering of top-level environments over one another, or of top-level
environments over runtime environments -- a top-level environment IS a runtime
environment.

6 years agoDon't use syntactic enviroment to indirectly bind global macros.
Chris Hanson [Thu, 1 Feb 2018 07:00:26 +0000 (23:00 -0800)]
Don't use syntactic enviroment to indirectly bind global macros.

6 years agoRemove empty file.
Chris Hanson [Thu, 1 Feb 2018 07:00:16 +0000 (23:00 -0800)]
Remove empty file.

6 years agoAdd bindings for the block-declaration renames.
Chris Hanson [Tue, 30 Jan 2018 06:54:14 +0000 (22:54 -0800)]
Add bindings for the block-declaration renames.

6 years agoChange declaration processing to decouple it from open blocks.
Chris Hanson [Tue, 30 Jan 2018 06:32:09 +0000 (22:32 -0800)]
Change declaration processing to decouple it from open blocks.

6 years agoRename block-declaration -> scode-block-declaration and move to "scode".
Chris Hanson [Tue, 30 Jan 2018 05:43:28 +0000 (21:43 -0800)]
Rename block-declaration -> scode-block-declaration and move to "scode".

6 years agoChange seq-item to flatten its arguments.
Chris Hanson [Tue, 30 Jan 2018 05:32:43 +0000 (21:32 -0800)]
Change seq-item to flatten its arguments.

Also rename flatten-seq-items to flatten-items.

6 years agoA large number of renames for syntax items.
Chris Hanson [Tue, 30 Jan 2018 05:08:54 +0000 (21:08 -0800)]
A large number of renames for syntax items.

6 years agoEliminate unnecessary condition.
Chris Hanson [Tue, 30 Jan 2018 04:22:56 +0000 (20:22 -0800)]
Eliminate unnecessary condition.

6 years agoDon't use binding-item for LET bindings.
Chris Hanson [Tue, 30 Jan 2018 03:24:31 +0000 (19:24 -0800)]
Don't use binding-item for LET bindings.

6 years agoChange syntactic environments to be records rather than bundles.
Chris Hanson [Mon, 29 Jan 2018 00:47:37 +0000 (16:47 -0800)]
Change syntactic environments to be records rather than bundles.

It's not using the bundle functionality so there's no advantage.

6 years agoChange define-bundle-interface to use quote-identifier.
Chris Hanson [Mon, 29 Jan 2018 00:47:12 +0000 (16:47 -0800)]
Change define-bundle-interface to use quote-identifier.

6 years agoImplement quote-identifier, which is needed for macro-generating macros.
Chris Hanson [Sun, 28 Jan 2018 23:36:17 +0000 (15:36 -0800)]
Implement quote-identifier, which is needed for macro-generating macros.

I'm not entirely happy with this; it feels like a wart.  But I don't see an
alternative at the moment.

6 years agoRename combinator-substitution -> list-substitution.
Chris Hanson [Sun, 28 Jan 2018 22:50:33 +0000 (14:50 -0800)]
Rename combinator-substitution -> list-substitution.

6 years agoFix but: top-level definition names must be symbols.
Chris Hanson [Sun, 28 Jan 2018 01:18:11 +0000 (17:18 -0800)]
Fix but: top-level definition names must be symbols.

6 years agoDisallow runtime environments in make-syntactic-environment.
Chris Hanson [Sat, 27 Jan 2018 05:42:35 +0000 (21:42 -0800)]
Disallow runtime environments in make-syntactic-environment.

6 years agoSimplify the rename-db implementation.
Chris Hanson [Sat, 27 Jan 2018 05:09:40 +0000 (21:09 -0800)]
Simplify the rename-db implementation.