Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests #5

Merged
merged 32 commits into from
Oct 1, 2023
Merged

Tests #5

merged 32 commits into from
Oct 1, 2023

Conversation

Bike
Copy link
Member

@Bike Bike commented Oct 1, 2023

No description provided.

Bike added 30 commits September 29, 2023 12:40
Mostly failing for the moment.
trivial-cltl2 will give us the native parse-macro, which could
expand into gods know what. In particular on SBCL it uses a lot of
POP and some internal SBCL functions, which can cause issues.
Important so that macros can actually use macroexpand.
Not sure exactly what was wrong with the DO* loop, but DO* is hard
to understand anyway. It was adding special variables called NIL
from normal free special declarations somehow, and some of the
binding related ANSI tests got really screwy results.
See extensive comment in native-sham
See long comment/apologia in parse-macro.lisp.
It's this or hack the reader, and I don't want to hack the reader.
It's nicer if the test files can just be loaded normally without
whatever ASDF nonsense is required to use Eclector or something.

Majority of macrolet tests now pass. Amazing.
For these tests the same variable needs to be bound inside and
outside the macrolet, so the whole thing has to go through the
test evaluator, not just the outer part.
Example previous breakage:
(funcall (let ((x 0)) (lambda (&optional (x x)) x)))
would return an internal unboundedness marker. This is because
the default form, X, was compiled in an environment in which all
the parameters were already bound.

compile-with-lambda-list is getting really unwieldly.
I made some mistakes whiles removing the backquotes.
It checked for local specialness, which doesn't actually mean that
a new binding should also be special. Failed ANSI's FLET.40.

Also, the stuff about remaking optionals and keys as special that
I deleted in this commit is now moot, because default forms are no
longer compiled in new-env.
without this, code like (let ((x 0)) ((lambda () (setq x 1))) x)
will return a cell (!) instead of the actual value.
Not actually sure why I used catch originally. I mean obviously
it's to avoid the nested VM calls thing the native VM does, but
catch instead of block, I don't know. Plus I apparently just
completely screwed it up so that NLX would never work.

There was a problem (besides NLX just totally failing, that was the
lack of GO) that didn't trip any of the ANSI tests I'm running:

(let ((x 0))
  (declare (special x))
  (block nil
    (let ((x 1))
      (declare (special x))
      (return-from nil)))
  x)

returned 1 instead of 0 because the dynenv stack wasn't getting
undone. Also happened with the NLX version (wrap the block in a
thunk). Need tests for this.
The compiler should be doing the right thing but the instructions
are untested (so far).
the restored ones were causing stack overflows (??) when I first
ran the tests. Since I completely redid PARSE-MACRO those seem to
have disappeared.
@Bike Bike marked this pull request as ready for review October 1, 2023 01:15
@Bike Bike merged commit cbb2373 into main Oct 1, 2023
2 checks passed
@Bike Bike deleted the tests branch October 1, 2023 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant