gregspurrier / shen-ruby

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

Exception thrown when applying too many arguments to a function is not caught by trap-error #5

Closed gregspurrier closed 11 years ago

gregspurrier commented 11 years ago

This is the expected behavior as seen in Shen 7.1 under CLisp:

(0-) ((/. X Y (+ X Y)) 1 2 3)
oops

This is the behavior of ShenRuby 0.1.0:

(0-) (trap-error ((/. X Y (+ X Y)) 1 2 3) (/. _ oops))
Ruby exception: undefined method `arity' for 3:Fixnum

This situation should instead raise an instance of Kl::Error so that trap-error can catch it.

gregspurrier commented 11 years ago

This is fixed with commit 0bcf02665022ed7e72ab4be226c3d1c492a6d0ed.