From 555d0181fa1d76f02d1b86843123eda494c0fbec Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 16 Jan 2015 19:42:24 -0400 Subject: [Bugs] - In let forms, the local had the wrong data-structure as a type. [Enhancements] - Can now instance objects. - Java-interop now handles array inputs. - System now has object array creation, storing and retrieving. --- test2.lux | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'test2.lux') diff --git a/test2.lux b/test2.lux index 8f076a839..15bcecdbc 100644 --- a/test2.lux +++ b/test2.lux @@ -335,7 +335,7 @@ )) (def (range from to) - (if (= to from) + (if (= from to) #Nil (#Cons from (range (inc from) to)))) @@ -350,25 +350,14 @@ (def (normalize-ident ident) (fold concat "" (map normalize-char (text->list ident)))) -#( - - - - - (def (fresh-class-loader path) - (let file (jvm/new java.io.File [String] [path]) - (let url (jvm/invokevirtual java.io.File "toURL" [] - file []) - (let urls (array java.net.URL (list url)) - (jvm/new java.net.URLClassLoader [(Array java.net.URL)] [urls]))))) - - (def (fresh-class-loader path) - (let [file (jvm/new java.io.File [String] [path]) - url (jvm/invokevirtual java.io.File "toURL" [] - file []) - urls (array java.net.URL (list url))] - (jvm/new java.net.URLClassLoader [(Array java.net.URL)] [urls]))) - )# +(def (fresh-class-loader path) + (let file (jvm/new java.io.File [String] [path]) + (let url (jvm/invokevirtual java.io.File "toURL" [] + file []) + (let urls (jvm/new-array java.net.URL 1) + (do (jvm/aastore urls 0 url) + (jvm/new java.net.URLClassLoader [(Array java.net.URL)] [urls])))) + )) (def (cons tail head) (#Cons head tail)) @@ -487,5 +476,6 @@ (println (normalize-char char)))) (println (show-list (range 0 10))) (println (normalize-ident "text->list")) + (println (fresh-class-loader "./")) ) )) -- cgit v1.2.3