gregspurrier / shen-ruby

ShenRuby is a port of the Shen programming language to Ruby
Other
76 stars 7 forks source link

Allow injecting of Ruby functions via Shen REPL #10

Closed gregspurrier closed 9 years ago

gregspurrier commented 11 years ago

From the qilang Google group:

Hi Greg,

As you specified on the webpage https://github.com/gregspurrier/shen-ruby the shen environment can be extended with functions written in Ruby. This functionality turned out to be quite useful. For example in "Ruby Program 2" in https://groups.google.com/forum/#!msg/qilang/aOdyQQJYR5w/3Ep-K7k37ZUJ I used the Ruby modulo function in a Shen program in order to achieve speedup. In the example in https://groups.google.com/forum/#!msg/qilang/lFWmNMQydD0/thpnLIrvA_MJ I used the Ruby "rand" function from within Shen (since Shen does not have its own random number generator).

My question is whether it is possible to use the wrapped Ruby functions from within the srrepl? If not, would it be possible to allow these wrapped functions to be accessible from within the Repl, please? Thanks.

This could be a good bridge between no Shen->Ruby interop and full support. Perhaps via eval-ruby and/or load-ruby functions.

gregspurrier commented 9 years ago

Shen->Ruby interop was added in ShenRuby 0.12.0.