lsevero / abclj Goto Github PK
View Code? Open in Web Editor NEWClojure to Common lisp interop
License: Eclipse Public License 2.0
Clojure to Common lisp interop
License: Eclipse Public License 2.0
Is there a way presently to convert Common Lisp vectors to Clojure vectors? Especially the higher dimensional variety?
For instance
(require '[abclj.quicklisp :refer [quickload]])
(quickload :april)
(-> (with-cl `(april:april-c "1 2 3 + 1 2 3") .coptyToVec vec)
Or something of the sort. I guess this method is only expecting list results from lisp, rather than the native CL vector type. Does there need to be some additional conversion functions written to handle vector types, or is there already something that supports this conversion?
Further, round tripping of values doesn't seem to be supported for CL vectors either.
CL-USER> (setq x (april:april-c "1 2 3 + 1 2 3"))
#(2 4 6)
CL-USER> x
#(2 4 6)
CL-USER> (april:april-c "{⍵+⍵}" x) ;; add vector x to itself using an april function
#(4 8 12)
In the above example, x is store, then passed into the next expression. but using clj, x is said to be an org.armedbear.lisp.SimpleVector
and yet I can't pass it back into an expression expecting a lisp vector
abclj.core> (def x (with-cl '(april:april-c "1 2 3 + 1 2 3")))
;; => #'abclj.core/x
abclj.core> (with-cl `(april:april-c "{⍵+⍵}" ~x))
Execution error (UnhandledCondition) at abclj.java.AbcljUtils$2/execute (AbcljUtils.java:70).
Unhandled lisp condition: #<ERROR {1D4DD0A0}>
Look at the following example:
(deftest stuck-test
(is (= (cl-cons [1 2 cl-nil]) 1)))
;; Running test stuck-test in abclj.core-test...
;; forever!
(defmacro not-a-problem []
`(is (= (cl-cons [1 2 cl-nil]) 1)))
(not-a-problem)
;; => false
I thought the problem was somehow related to the usage of clj-macro. But it doesn't. Might be interesting to dig deeper and see what the testing framework is complaining about. I can't get the first example to run, get stuck with no output message. Maybe you can get something interesting out of this.
user=> (require '[abclj.quicklisp :refer [quickload]])
nil
user=> (quickload :trivial-http :drakma)
Execution error (UnhandledCondition) at abclj.java.AbcljUtils$2/execute (AbcljUtils.java:70).
Unhandled lisp condition: Cannot probe a wild pathname as a directory.
anyway to debug this further?
Hello!
I managed to load the Lem (lem-project/lem#686) to ABCL correctly (more or less), and I managed to then run it inside abclj:
(quickload :swank)
(quickload :lem-ncurses)
(cl-evaluate "(lem::lem)")
Then it hangs with this screen:
I'm testing with ABCL:
Armed Bear Common Lisp 1.9.0
Java 11.0.19 Ubuntu
OpenJDK 64-Bit Server VM
With Linux Mint Vanessa.
I know this is not strictly related to abclj, just asking for some help 😃 .
Still, thanks a lot!
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.