You can actually get native tail call optimisation in Ruby, if this works for Läsp it would perhaps even be nicer than mimicking Clojure's recur. It has to be turned on like this:
RubyVM::InstructionSequence.compile_option = {
tailcall_optimization: true,
trace_instruction: false,
}
One pitfall is that this has to be set before the code that uses it is compiled.
You can actually get native tail call optimisation in Ruby, if this works for Läsp it would perhaps even be nicer than mimicking Clojure's
recur. It has to be turned on like this:One pitfall is that this has to be set before the code that uses it is compiled.