Skip to content

Conversation

@ALSchwalm
Copy link
Contributor

Fixes #161

This mostly just pulls in the run-context logic from janet. It sounds like we were probably going to need that anyway for #194 (though I might misunderstand, I've not been closely tracking that).

Adds a *show-result* variable that defaults to true. When set to nil, the output from evaluations is not shown when implicit parens have been added.

@andrewchambers
Copy link
Owner

Yeah, the idea with #194 is that this let's us add a hook before each top level form is evaluated and do some introspection on the form body.

Not suggesting a change, but I wonder if the show-result login could be part of a default hook.

@ALSchwalm
Copy link
Contributor Author

Maybe? I think we would probably run in to some issues though. Namely, we would need to know in the post-exec hook whether we had added parens in the pre-exec hook and getting that info there seems like it would probably be messy. But I could definitely be wrong.

@andrewchambers
Copy link
Owner

andrewchambers commented Jun 7, 2019

I wonder if show-result should be something like show-exit-code or show-exit-status

@ALSchwalm
Copy link
Contributor Author

Yep, that sounds better. I'll change it. The other question is if we want to store the exit code in a variable (I would assume this would be done regardless of the value of 'show-exit-code'), but I could make a separate issue/pr for that.

@andrewchambers
Copy link
Owner

The old repl stored them in '_' , you can see janet does this after pp in the old signal handler.

@ALSchwalm
Copy link
Contributor Author

Ah, true. I'll add that and rebase

@andrewchambers
Copy link
Owner

andrewchambers commented Jun 7, 2019

Oh it seems this new repl also doesn't print a stack trace like the old one when we error.

@ALSchwalm ALSchwalm force-pushed the 161-optional-repl-results branch from f1de330 to 749d795 Compare June 7, 2019 03:32
@ALSchwalm
Copy link
Contributor Author

Should be fixed now. Sorry about that.

@andrewchambers andrewchambers merged commit a09143f into andrewchambers:master Jun 7, 2019
@andrewchambers
Copy link
Owner

Thank you very much :)

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.

Don't print evaluation result when adding implicit parens

2 participants