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

Distinguish ~(deref a) from ~@a, don't unexpand reader macros if lossy #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frenchy64
Copy link

@frenchy64 frenchy64 commented Aug 12, 2024

There are several problems unexpanding reader macros, sometimes yielding pretty-printings that don't round-trip.

  1. ~(deref foo) and ~ @foo are being printed as ~@foo.
  2. reader macros are being unexpanded even with the wrong number of arguments
    • (var) => (var nil)
    • (var 1 2 3) => (var 1)
  3. The op of a reader expansion is not being checked thoroughly enough.
    • (let [deref a] (deref a)) => (let [deref a] @a)

I try and fix all these issues in this PR.

@frenchy64 frenchy64 marked this pull request as ready for review August 12, 2024 22:17
Use ~,@ as canonical form instead of ~ @ for emphasis.
@frenchy64 frenchy64 force-pushed the ws-resolved-ambiguity branch from 850985f to 884c483 Compare August 14, 2024 15:12
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