|
Hi Arthur,
since we want to use µManager inside Fiji, we need to use Clojure 1.3. However, I get a nasty error that I cannot easily fix (Clojure's notation is a mild nightmare if you ask me; the concepts underneath are so elegant, why can't they expose that in the language syntax, too?). In particular, the problem manifests itself as Exception in thread "Acquisition Engine Thread (Clojure)" java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: org.micromanager.acq-engine/state at clojure.lang.Var.pushThreadBindings(Var.java:339) at clojure.core$push_thread_bindings.invoke(core.clj:1716) at org.micromanager.acq_engine$run_acquisition.invoke(acq_engine.clj:437) at org.micromanager.acq_engine$_run$fn__1111.invoke(acq_engine.clj:636) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:662) It appears that the issue was discussed here: http://blog.japila.pl/2011/03/cant-dynamically-bind-non-dynamic-var-in-clojure-1-3/ (In short: Clojure 1.3 requires variables that need to be rebound later to be defined with the ^:dynamic tag -- very, very intuitive... However, I did not find any place where 'state' is defined explicitly, but I suspect that it is the 'swap!' call in 'prepare-state'. But all that is completely over my head.) Would you have time to help me on that issue, please? Thanks, Johannes ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ micro-manager-general mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/micro-manager-general |
|
Hi Johannes,
> Clojure's notation > is a mild nightmare if you ask me; The transition from Clojure 1.2 to 1.3 has been unnecessarily painful in my opinion (I complained about this at length on the Clojure mailing list) but in general I do like lisp notation. :))))) > In particular, the problem manifests itself as > > Exception in thread "Acquisition Engine Thread (Clojure)" > java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: > ... > at org.micromanager.acq_engine$run_acquisition.invoke(acq_engine.clj:437) > at org.micromanager.acq_engine$_run$fn__1111.invoke(acq_engine.clj:636) > ... > http://blog.japila.pl/2011/03/cant-dynamically-bind-non-dynamic-var-in-clojure-1-3/ I think I have eliminated such issues in the code last year. Right now there is no code at acq_engine.clj:437, so I think you may have either an old version of the source code or the bytecode. You may need to svn update and recompile the acquisition engine to make sure your bytecode is up to date. There's a Makefile.am and a build.bat in the acqEngine directory. > (In short: Clojure 1.3 requires variables that need to be rebound later > to be defined with the ^:dynamic tag -- very, very intuitive... However, I > did not find any place where 'state' is defined explicitly, but I suspect > that it is the 'swap!' call in 'prepare-state'. But all that is completely > over my head.) (The reason for the ^:dynamic weirdness is that the authors of Clojure are strongly discouraging the rebinding of vars. Rather you should use atoms, refs or agents for stateful data. The swap! call is operating on an atom and doesn't have anything to do with vars.) I hope this helps! Please let me know if you are still running into problems. Arthur ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ micro-manager-general mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/micro-manager-general |
|
Hi Arthur,
On Thu, 26 Jan 2012, Arthur D. Edelstein wrote: > > Clojure's notation is a mild nightmare if you ask me; > > The transition from Clojure 1.2 to 1.3 has been unnecessarily painful > in my opinion (I complained about this at length on the Clojure > mailing list) but in general I do like lisp notation. :))))) You have too many closing parens there. Besides, I am not complaining about Lisp notation. I am complaining about the use of non-alphanumerical-plus-dash characters that all have a certain meaning that you have to learn if you want to use Clojure (instead of having obvious English labels). That was a lousy job: now everybody who has to cope with Clojure really needs to sit down to learn a notation instead of diving into the beauty of functional programming. Dumb. > > In particular, the problem manifests itself as > > > > Exception in thread "Acquisition Engine Thread (Clojure)" > > java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: > > ... > > at org.micromanager.acq_engine$run_acquisition.invoke(acq_engine.clj:437) > > at org.micromanager.acq_engine$_run$fn__1111.invoke(acq_engine.clj:636) > > ... > > http://blog.japila.pl/2011/03/cant-dynamically-bind-non-dynamic-var-in-clojure-1-3/ > > I think I have eliminated such issues in the code last year. Right now > there is no code at acq_engine.clj:437, so I think you may have either > an old version of the source code or the bytecode. the setup myself: the microscope for which I wrote a µManager driver and a GUI sits 7 tzs away. > You may need to svn update and recompile the acquisition engine to make > sure your bytecode is up to date. There's a Makefile.am and a build.bat > in the acqEngine directory. Unfortunately, it is not as easy as that. I have over 100 commits on top of some older revision, partially accomodating for newer libraries in Fiji, partially for Fiji's more flexible multi-platform directory structure, partially just trying to clean up the many confusing different targets for generated files (bin_Win32/, Install_Win32/ and sometimes even directly into C:\Program Files -- which might not even exist on non-English Windows or even worse is the wrong directory on 64-bit boxes). It is all far from ideal, I tried to make it so that the compile products are stored in a dist/ directory which has a fully functional Fiji with µManager after a complete build, but the bin_Win32/ directories and friends did not go away, I did not have time to go the full nine yards there. To stay up-to-date I usually use git-svn (because Git has so much more powerful tools than Subversion, such as 'rebase -i'). That does not work too well, though, since many of the files in the Subversion repository were checked in with DOS line endings! So I get millions of conflicts where I should get none. So I asked my colleagues to check out just acqEngine and mmstudio from the current trunk and it seemed as if that worked and produced the same error. However, a quick check when I finally had access again to my virtual Windows machine, it turns out that mmstudio requires changes in the core to compile, so that test was erroneous. So: sorry for the noise, I should have gone through the painful process of forward-porting my patches onto the current Subversion revision. > > (In short: Clojure 1.3 requires variables that need to be rebound > > later to be defined with the ^:dynamic tag -- very, very intuitive... > > However, I did not find any place where 'state' is defined explicitly, > > but I suspect that it is the 'swap!' call in 'prepare-state'. But all > > that is completely over my head.) > > (The reason for the ^:dynamic weirdness is that the authors of Clojure > are strongly discouraging the rebinding of vars. Rather you should use > atoms, refs or agents for stateful data. The swap! call is operating on > an atom and doesn't have anything to do with vars.) > > I hope this helps! Please let me know if you are still running into > problems. Ciao, Dscho ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ micro-manager-general mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/micro-manager-general |
|
Hi Arthur,
On Thu, 26 Jan 2012, Johannes Schindelin wrote: > On Thu, 26 Jan 2012, Arthur D. Edelstein wrote: > > > > In particular, the problem manifests itself as > > > > > > Exception in thread "Acquisition Engine Thread (Clojure)" > > > java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: > > > ... > > > at org.micromanager.acq_engine$run_acquisition.invoke(acq_engine.clj:437) > > > at org.micromanager.acq_engine$_run$fn__1111.invoke(acq_engine.clj:636) > > > ... > > > http://blog.japila.pl/2011/03/cant-dynamically-bind-non-dynamic-var-in-clojure-1-3/ > > > > I think I have eliminated such issues in the code last year. Right now > > there is no code at acq_engine.clj:437, so I think you may have either > > an old version of the source code or the bytecode. > > Indeed, I have a slightly older version around. conflicts. A couple of other issues later, the exception is gone! Thank you so much, and sorry for the noise, Dscho ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ micro-manager-general mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/micro-manager-general |
|
Hi Dscho,
> Thank you so much, and sorry for the noise, No worries! I'm glad it's working. Arthur ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ micro-manager-general mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/micro-manager-general |
| Powered by Nabble | See how NAML generates this page |
