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

General modern "quotation" syntax support #1229

Closed
mn200 opened this issue May 1, 2024 · 0 comments
Closed

General modern "quotation" syntax support #1229

mn200 opened this issue May 1, 2024 · 0 comments

Comments

@mn200
Copy link
Member

mn200 commented May 1, 2024

Suggestion from @myreen on Discord:

Could there be general-purpose quote filter support for making this nicer? Specifics can be discussed, but something along these lines:

val cakeml_code = append_prog o process_topdecs;

Quote cakeml_code:
  fun b_inputAllTokens c0 is f g =
    b_inputAllTokens_aux c0 is f g []
End

Quote cakeml_code:
  fun b_inputAllTokensFrom c0 fname f g =
    let
      val is = b_openIn fname
      val lines = b_inputAllTokens c0 is f g
    in
      b_closeIn is; Some lines
    end handle BadFileName => None
End

I can't quite decide what the syntax should be if one also wants to bind the result of applying the function... Perhaps:

Quote cake_ast = process_topdecs:
  fun b_inputAllTokens c0 is f g =
    b_inputAllTokens_aux c0 is f g []
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant