Giter Site home page Giter Site logo

shen-ruby's People

Contributors

brixen avatar gregspurrier avatar tizoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shen-ruby's Issues

The 'or' and 'and' functions should support partial application

The or and and functions should support partial application. When partially applied, they move into the realm of normal functions and no longer short-circuit their evaluation.

This is the behavior in the SBCL port:

(0-) ((or) true (do (print "evaluated") true))
"evaluated"true

This the is current, erroneous behavior in ShenRuby:

(0-) ((or) true (do (print "evaluated") true))
or expects 2 arguments but was given 0

Exception raised by Shen-YACC

Shen, copyright (C) 2010-2015 Mark Tarver
www.shenlanguage.org, Shen 17
running under Ruby, implementation: ruby 2.2.0
port 0.13.0 ported by Greg Spurrier


(0-) (defcc <a> a := [/.];)
undefined method `hd' for nil:NilClass

This works in both the SBCL and chibi-scheme ports. The latter is important because, like ShenRuby, chibi-shen raises an error when hd is applied to the empty list. This suggests this is a ShenRuby bug rather than a case of Shen accidentally relying on (hd []) returning [] as it does in the CL ports.

ShenRuby::Shen initialization fails with java.lang.ArrayIndexOutOfBoundsException under JRuby

Using JRuby 1.7.2 and master as of commit a642f9b, ShenRuby::Shen.new fails with java.lang.ArrayIndexOutOfBoundsException while loading declarations.kl.

The failure occurs while evaluating the shen-initialise_arity_table expression.

Using the v0.1.0 code, the same exception is encountered while executing the chapter 11: (load "binary.shen") test case. Therefore I do not thinks this problem is introduced by the changes since v0.1.0, but rather that the characteristics of the code have changed in such a way that the same problem manifests itself in a different situation.

interpreter.shen fails

Using Shen 15 and Ruby 2.0.0 the test in interpreter.shen fails with the following message:
Qi interpreter - chapter 13: (tc +) = true
run time: 4.0531158447265625e-06 secs
passed
Qi interpreter - chapter 13: (load "interpreter.shen") = loaded
type#num : symbol
type#primitive_object : symbol
type#pattern : symbol
type#l_formula : symbol
l_interpreter : (A --> B)
read_eval_print_loop : (string --> A)
normal_form : (l_formula --> l_formula)

failed with error maximum stack depth exceeded

Qi interpreter - chapter 13: (tc -) = false
run time: 1.0013580322265625e-05 secs
passed
passed ... 111
failed ...1
pass rate ...99.10714285714286%

srrepl fails to start under cygwin

Reported on the Qilang Google group:

I just tried it but I am getting an error:

$ srrepl
Loading.../usr/lib/ruby/gems/1.9.1/gems/shen-ruby-0.1.0/lib/kl/cons.rb:32: stack level too deep (SystemStackError)

I am testing under cygwin, is that a problem?

(quit) raises type error when type checking is enabled

The type of quit should be declared so that it works properly when type checking is enabled.

Shen 2010, copyright (C) 2010 Mark Tarver
www.shenlanguage.org, version 8
running under Ruby, implementation: ruby 1.9.3
port 0.3.1 ported by Greg Spurrier


(0-) (tc +)
true

(1+) (quit)
type error

Coerce Ruby Arrays to Vectors?

This isn't an issue but a suggestion for the next version. How would you feel about coercing Ruby Arrays to vectors instead of cons lists? This way the length attribute can be preserved and to me it seems like a more intuitive mapping.

Allow injecting of Ruby functions via Shen REPL

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.