Closed rohni closed 13 years ago
works for me, but I'm using swank-clojure 1.3.0, emacs 23.1, linux, slime Date: Thu Oct 15 16:40:37 2009 +0000
user> (link. 1 "Secure Google" "https://www.google.com" "search" "secure" "default" nil)
note markdown eliminates [] I think, or some at least
Hmmm, so it seems to be a mac os x annoyance. I was wondering. Because the first version of the code I develeped a few months ago on linux, and then tried running it on the mac, and boom. I attributed it to revamping in the slime/swank stuff. I would like to say I am surprised but this is not the first time mac specific stuff has bitten me.
I will have to try running this code on my other laptop, and see how it goes. Thanks for testing it out.
I've noticed this on Debian as well with Emacs 24. Will definitely investigate.
Okay, so emacs innovations rather than mac ones this time. I am not using emacs 24 on my linux system, so I suspect it will work. If I have a chance this weekend I will see if I cannot figure out some of the code. I am more used to staring at python backtraces than java, but maybe I'll stumble on something. Thanks for looking into this technomancy.
I've trace this back to emacs 24 not properly zero padding hex numbers with the format function. Here's workaround I am using:
(defun slime-net-encode-length (n)
"Encode an integer into a 24-bit hex string."
(subst-char-in-string ?\ ?0 (format "%06x" n)))
remvee: can you repro on the latest from git? I think I got a workaround that handled this in 1.4.0-SNAPSHOT.
Problem is fixed in emacs since 2011-06-05; http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/104506
technomancy: I tested 1.4.0-SNAPSHOT and yes it does work properly with older emacs snapshot with broken format function.
First things first: Mac OS X 10.6.7 Emacs: GNU Emacs 24.0.50.1 (i386-apple-darwin10.7.0, NS apple-appkit-1038.35) of 2011-06-02 on Rohan-Nichollss-MacBook-Pro.local This was compiled on the system using homebrew. I have just done a lein update And this is the project file: (defproject scrumptious "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contrib "1.2.0"] [ring/ring-core "0.3.5"] [ring/ring-jetty-adapter "0.3.5"] [clj-json "0.3.1"] [ring-json-params "0.1.3"] ;; [ring "0.3.5"] [clj-time "0.3.0-SNAPSHOT"]] :dev-dependencies [[ring/ring-devel "0.3.5"]]) I installed swank-clojure as a lein plugin, and am using that.
Here is the start code, and I get the same result with a struct:
(defrecord link [id title url tags creation comments]) (defn nowint [](.getTime %28java.util.Date.%29))
If I create a link with atomic parameters it works scrumptious.db> (link. 1 "Secure Google" "https://www.google.com" nil (nowint) nil)
:scrumptious.db.link{:id 1, :title "Secure Google", :url "https://www.google.com", :tags nil, :creation 1307603770553, :comments nil}
But if I now actually fill in the tags properly (note the vector where nil was in third to last param): scrumptious.db> (link. 1 "Secure Google" "https://www.google.com" "search" "secure" "default" nil)
with swank-clojure 1.2.x it would just hang and I would have to disconnect and reconnect to get my repl back. In 1.3.1 it is more proactive, and disconnects on its own. A slime-connect reconnects, and the state is still there.
Ooh, in order to do this post I did a slime-connect to a lein swank (which is using the plugin) and I can see backtraces.
exception in read loop java.lang.NumberFormatException: For input string: " ae" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at swank.core.protocol$read_swank_message.invoke(protocol.clj:41) at swank.core.connection$read_from_connection.invoke(connection.clj:59) at swank.core$read_loop.invoke(core.clj:337) at swank.swank$connection_serve$fn1580$fn1581.invoke(swank.clj:41) at clojure.lang.AFn.applyToHelper(AFn.java:159) at clojure.lang.AFn.applyTo(AFn.java:151) at clojure.core$apply.invoke(core.clj:540) at swank.swank$connection_serve$fn__1580.doInvoke(swank.clj:38) at clojure.lang.RestFn.invoke(RestFn.java:398) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:637)
I am not sure if this helps.
Thanks for any help on this, I think it might be related to the windows issues I have seen, but perhaps this is more specific. ;)
Rohan