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

-> is an undocumented synonym for => ? #26

Open
jbclements opened this issue Jun 8, 2019 · 1 comment
Open

-> is an undocumented synonym for => ? #26

jbclements opened this issue Jun 8, 2019 · 1 comment

Comments

@jbclements
Copy link
Contributor

This program signals an error that doesn't make sense to me, but I think it might be because -> is secretly a synonym for =>:

#lang racket

(require nanopass/base)

(define-language R2a
  (Type (ty)
        (Void)
        (-> ty (ty* ...))
        ))

Specifically, this produces the error:

define-language: found mutually recursive nonterminals in: Type

which doesn't really make any sense to me, but I get the same error if I replace the -> with a =>, and suggests to me that this is interpreting the production as one using a prettifier.

@texdraft
Copy link

texdraft commented Jan 30, 2025

The -> is supposed to allow specifying a prettifying procedure. A typo prevents the functionality from working, however.

Edit: Just noticed that this is mentioned in the LOG file.

  * added a second pretty form (->) for writing procedural unparsing of
    nonterminal productions.

The code seems to want to allow the procedure expression to use ... in quasiquote, but that doesn't work.

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

No branches or pull requests

2 participants