Closed eli-oat closed 3 years ago
A way to re-frame this question would be: is there a way to load a script from the repl, akin to common lisp's (load "file-name")
I don't see a way to do it currently, but you could implement a load
and/or eval
feature as the inverse of the existing print
feature. If you search for P_PRINT
in fe.c
and then look at the main
function you can maybe see how this could be implemented.
Thanks @jminor this is very helpful.
I've been exploring ways to port do-file
from aq, but I think your suggestion is a better tack.
At this point I have a workable direction, but haven't gotten it to work, yet. Going to close this since I'm relatively confident that this functionality is already there, I just need to sort out how to get it working.
Firstly, I fully confess that I'm totally inept when it comes to writing C, so the answer here may very well to be to extend fe -- but I'm wondering about the best way to pass user input into a program written in fe -- either by pipe or by prompting for user input.