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

function printing #215

Open
porcuquine opened this issue Aug 15, 2024 · 0 comments
Open

function printing #215

porcuquine opened this issue Aug 15, 2024 · 0 comments

Comments

@porcuquine
Copy link
Contributor

Functions (Funs) do not currently have a readable printed representation. That's fine, for now.

I think the default representation of a function should not include the body. This can get very long and makes looking at expressions containing functions unwieldy.

Here's what I propose.

By default:

  • Functions are displayed with their argument lists and hashes (maybe a 'short hash') so it's easy to distinguish functions and gain some insight about their arity and likely identity.
  • Function body is elided (...).
  • The length of the closed env is displayed.

Separately, and with lower priority, we support a debug mode (ideally this can be toggled in REPL) that shows the full function body and full env. Actually, full env is likely overkill most of the time — but there is definitely a need for it sometimes. So this should perhaps be two distinct settings.

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