I've released Jarc 21 today which has: 1) A rainbow compatibility module Jarc> (use 'rainbow)
t
Jarc> (java-import "java.lang.Integer")
#(tagged mac #<procedure>)
Jarc> (= jint (Integer new 12))
12
Jarc> jint!doubleValue
12.0
Jarc> (java-static-field "java.lang.Integer" "MAX_VALUE")
2147483647
Jarc> (Integer parseInt "12")
12
It also includes dynamic proxies so you can implement
Java interfaces. Very cool Rainbow feature! (java-imports java (util TreeSet Comparator))
#(tagged mac #<procedure>)
Jarc> (= lists-by-len (TreeSet new (Comparator implement nil (obj compare
(fn (o1 o2)
(if (iso o1 o2) 0
(< (len o1) (len o2)) -1
1))))))
#set( )
Jarc> (lists-by-len 'add '())
t
Jarc> (lists-by-len 'add '(foo bar))
t
Jarc> (lists-by-len 'add '(baz))
t
Jarc> lists-by-len
#set( nil (baz) (foo bar) )
2) Various bug fixes reported in the forum recently (utest "double catch" (catch:list:point ignored throw.nil) is nil)
(utest "on-err in ccc" (catch:on-err [+ 1] (fn () throw.2)) is 2)
(utest "readc eof" (w/instring i "" (readc i)) is nil)
(utest "double annotate" (rep (annotate 'a (annotate 'a 12))) is 12)
(utest "cons as table key" (type:car:keys:obj (a) 1) is 'cons)
(utest "ds opt arg" (let ((o x 2)) nil x) is 2)
(utest "ds opt arg nil" (let ((o x 2)) '(nil) x) is nil)
(utest "ds opt 2nd arg" (let (a (o b 2)) '(1) b) is 2)
(utest "ds opt arg eval'd" (let default 2 (let ((o x default)) nil x)) is 2)
(utest "ds opt 2nd arg eval'd" (let default 2 (let (a (o b default)) '(1) b)) is 2)
And I implemented the optional 'append arg to outfile also.The goal of the Rainbow compatibility is to support a
library of code that uses Java API's that will run on both
Rainbow and Jarc. |