wryun / es-shell

es: a shell with higher-order functions
http://wryun.github.io/es-shell/
Other
313 stars 26 forks source link

Use the `%run` hook function for running binaries. #90

Open jpco opened 9 months ago

jpco commented 9 months ago

Resolves #80.

I'm actually not sure if it's better to go with this "use the primitive if %run is unset" fallback, or to just throw an error if %run happens to be unset. The former is more useful but the latter is more consistent.

jpco commented 4 months ago

Well, I was coming back to switch this to the more-consistent behavior (throw an error if %run isn't set) but it seems like there's a memory bug in this PR that causes es to crash with -DGCDEBUG=1 with the commands

fn-%run = ()
exit

EDIT: Actually, I was wrong, I think this might have been one of the recent exception-related bug fixes that haven't been merged into my development branch. It works at head.