Closed c42f closed 5 years ago
wow, this is super cool. Thanks! I'm going to merge this for now but I haven't done much testing on your fixes.
@c42f do you want to maintain this project going forward? I don't have a lot of time for the next year or so to be able to do this given work-related assignments :)
So I actually made and registered package a while ago called ReplMaker.jl based on the code in this repo.
For example,
julia> using LispSyntax, ReplMaker
julia> initrepl(LispSyntax.lisp_eval_helper, prompt_text="λ> ", prompt_color=:red, start_key=")", mode_name="Lisp Mode")
REPL mode Lisp Mode initialized. Press ) to enter and backspace to exit.
λ> (defn fib [a] (if (< a 2) a (+ (fib (- a 1)) (fib (- a 2)))))
fib (generic function with 1 method)
λ> (fib 10)
55
julia> fib
fib (generic function with 1 method)
Would it make sense to just make LispREPL.jl just depend on ReplMaker.jl for this stuff going forward?
Given that it's just one line, perhaps LispREPL.jl could just be deprecated and we could add a ReplMaker.jl dependancy to LispSyntax.jl and bring the REPL mode back to the main package.
@swadey thanks for the offer, though it seems the better option is to retire LispREPL and point potential users at that juicy ReplMaker one liner.
@MasonProtter that's really cool. Something like the ReplMaker interface should really be in stdlib REPL :-)
@c42f agreed. @MasonProtter That is super cool.
Thanks for the kind words! If only I had known you were updating this repo I could have saved you some heavy lifting.
I'll open a PR in LispSyntax.jl. @swadey would you rather I just point them to ReplMaker.jl in the README, or add a dependancy so the repl mode is builtin?
Deprecate and provide example code snippet would be my preference. What do you all think?
Agreed.
I'm not worried about the code in this PR being immediately obsolete ;-) It was only an hour or so of hacking to get the tests passing because they're largely similar to stdlib/REPL and I just used that as a guide when updating things.