Re: newbie struggling with Clooj and jars
Hi Phil, On Friday, March 23, 2012 3:57:28 PM UTC-7, Phil Hagelberg wrote: Arthur Edelstein arthuredelst...@gmail.com writes: In clooj + lein, there are three steps to adding a jar to a project. 1. Edit the project.clj file to include the artifact in the project's dependencies 2. Go to the command line and type lein deps 3. Go back to clooj and choose the menu item REPL Restart Have you gotten a chance to look at the leiningen-core library? It should let you handle this kind of thing in-process, possibly without even having Leiningen installed. It's designed with that kind of thing in mind, so I'd be very interested in hearing how that works out in practice. This is definitely something I would like to try. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: newbie struggling with Clooj and jars
Hi vet, In clooj + lein, there are three steps to adding a jar to a project. 1. Edit the project.clj file to include the artifact in the project's dependencies 2. Go to the command line and type lein deps 3. Go back to clooj and choose the menu item REPL Restart Restarting the REPL loads all jars inside the project's lib directory on the classpath. You shouldn't have to restart clooj itself. Arthur On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote: I love the premise of Clojure and the simplicity of Clooj. I used to write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain cells. I'm trying to write a simple Twitter client in Clojure. I've got twitter-api https://github.com/adamwynne/twitter-api downloaded and installed and can run the example with 'lein repl', but I can't get it to work with Clooj. I compiled twitter-api into a jar and stuck it into a jars subfolder. Then I tried this in the Clooj REPL: (ns mynamespace (:use [twitter.oauth] [twitter.callbacks] [twitter.callbacks.handlers] [twitter.api.restful]) (:import (twitter.callbacks.protocols SyncSingleCallback))) and got the following error message: #FileNotFoundException java.io.FileNotFoundException: Could not locate oauth/client__init.class or oauth/client.clj on classpath: I'm confused, because Clooj seems to think the jar is in its classpath: Classpath: /Users/david/Documents/coaching/TPG/TwitterBot/jars /Users/david/Documents/coaching/TPG/TwitterBot/src /Users/david/Documents/coaching/TPG/TwitterBot/twitter-api /Users/david/Documents/coaching/TPG/TwitterBot/jars/twitter-api-0.6.4.jar I can write code in Clooj, save it to disk, and use 'lein run', but I'd rather be able to compile a function at a time like I used to in Lisp/Emacs and I'm assuming this is possible in Clooj. What I am missing? On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote: I love the premise of Clojure and the simplicity of Clooj. I used to write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain cells. I'm trying to write a simple Twitter client in Clojure. I've got twitter-api https://github.com/adamwynne/twitter-api downloaded and installed and can run the example with 'lein repl', but I can't get it to work with Clooj. I compiled twitter-api into a jar and stuck it into a jars subfolder. Then I tried this in the Clooj REPL: (ns mynamespace (:use [twitter.oauth] [twitter.callbacks] [twitter.callbacks.handlers] [twitter.api.restful]) (:import (twitter.callbacks.protocols SyncSingleCallback))) and got the following error message: #FileNotFoundException java.io.FileNotFoundException: Could not locate oauth/client__init.class or oauth/client.clj on classpath: I'm confused, because Clooj seems to think the jar is in its classpath: Classpath: /Users/david/Documents/coaching/TPG/TwitterBot/jars /Users/david/Documents/coaching/TPG/TwitterBot/src /Users/david/Documents/coaching/TPG/TwitterBot/twitter-api /Users/david/Documents/coaching/TPG/TwitterBot/jars/twitter-api-0.6.4.jar I can write code in Clooj, save it to disk, and use 'lein run', but I'd rather be able to compile a function at a time like I used to in Lisp/Emacs and I'm assuming this is possible in Clooj. What I am missing? On Wednesday, March 21, 2012 12:42:36 PM UTC-7, TI Explorer vet wrote: I love the premise of Clojure and the simplicity of Clooj. I used to write Lisp in Emacs years ago but I'd rather not dust off the Emacs brain cells. I'm trying to write a simple Twitter client in Clojure. I've got twitter-api https://github.com/adamwynne/twitter-api downloaded and installed and can run the example with 'lein repl', but I can't get it to work with Clooj. I compiled twitter-api into a jar and stuck it into a jars subfolder. Then I tried this in the Clooj REPL: (ns mynamespace (:use [twitter.oauth] [twitter.callbacks] [twitter.callbacks.handlers] [twitter.api.restful]) (:import (twitter.callbacks.protocols SyncSingleCallback))) and got the following error message: #FileNotFoundException java.io.FileNotFoundException: Could not locate oauth/client__init.class or oauth/client.clj on classpath: I'm confused, because Clooj seems to think the jar is in its classpath: Classpath: /Users/david/Documents/coaching/TPG/TwitterBot/jars /Users/david/Documents/coaching/TPG/TwitterBot/src /Users/david/Documents/coaching/TPG/TwitterBot/twitter-api /Users/david/Documents/coaching/TPG/TwitterBot/jars/twitter-api-0.6.4.jar I can write code in Clooj, save it to disk, and use 'lein run', but I'd rather be able to compile a function at a time like I used to in Lisp/Emacs and I'm assuming this is possible in Clooj. What I am missing? -- You
Re: Really loving Clooj but..
Hi Erlis, Just to confirm: there currently aren't any built-in tracing or other special debugging capabilities in clooj. tools.trace is quite cool, though. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clooj is great :)
Hi Timothy, Thank you! I really appreciate your comments. I must admit there is still much left to be done on clooj and I haven't had much time to work on it of late. I thank everyone for their patience. Cheers, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: suggestion for clojure development
I think that clojure/core team is doing its best to ensure backward compatibility and break it only when there are prevalent reasons to do it. So what's the plan for the future? Are there plans to make clojure stable at some point so that backward compatibility can be expected? Otherwise I am going to have difficulty continuing to advocate clojure to my colleagues. In other words, when will the library ecosystem be considered important enough not to break? I think a statement of the policies of the Clojure/Core team (perhaps spelled out on the website) concerning stability and backward compatibility would really help those of us who want to be able to rely on Clojure. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
suggestion for clojure development
Dear Everyone, I would like to make a suggestion for the future of Clojure, and hopefully prompt a discussion. My comment comes as a result of my experience trying to port code to 1.3. I have run into numerous problems, most of which come from 1.3's incompatibilities with my 1.2- targeted code and the libraries I am using. While I hope and expect that none of the problems I'm encountering are insurmountable, they are requiring substantial time and effort. It raises the question of what happens to all of the many existing Clojure 1.2-based libraries in Clojars and on github. Many of these are very useful, but not necessarily actively maintained. A lot of effort will need to go into porting this code and much of it may be effectively lost. That seems like an unfortunate waste and it undermines the growing ecosystem of Clojure libraries. So my request for Clojure's future development, is that backwards compatibility not be broken. This means that Clojure code needs a way of designating what Clojure version it is targeted for. Then, for example, the Clojure 1.4 jar should be able to drop down into backwards compatibility mode to compile and run 1.3-code, or invoke a 1.3-script's vars from a 1.4 script. It would also be super-cool if someone can figure out how to do this for existing 1.2 libraries. I love that Clojure is being constantly improved and developed, and I thank everyone who has been working so hard on it. In my opinion, though, third-party libraries are as important as the core language. Clojure 1.3 interoperates with java libraries very well -- so why not with Clojure 1.2 libraries? Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: suggestion for clojure development
On Sep 27, 4:43 pm, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Sep 27, 2011 at 4:28 PM, Brian Marick mar...@exampler.com wrote: I think is it actively maintained? is not a particularly interesting question for a community. The question is: is this a useful library? Then: is the original author maintaining it? And then, if not: who will pick it up? Well, I'd hope that we can find (active) maintainers for libraries that are actually useful :) I hope so, too, but very often this doesn't happen in practice. Much useful code is not maintained. If I add a dependency from Clojars or maven central to my project.clj file, I don't want to pay the tax of deciding what Clojure version it is and whether it is actively maintained, and waiting for the maintainer to respond to me, and, if he or she does not, debugging the library myself and then resubmitting it to clojars. Of course this can be necessary when there are bugs, but now almost all the 1400+ libraries in Clojars are suspect because of the 1.2 to 1.3 transition. I consider this to be incidental complexity and I am tired/old/lazy/ stupid. I want to simply use the library. Clojure indeed is brilliantly designed exactly to make libraries easy to use (by using immutable data and avoiding the OOP pitfall of excessively complex types) and this breaking transition from 1.2 to 1.3 tends to undermine that achievement. I do like Phil's classloader suggestion, but I wonder if there might be a way for leiningen to automatically provide a transparent wrapper around 1.2 jars so that they can be called by 1.3 code without local (eval-in-1.3 ...) macros. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: suggestion for clojure development
When you're selecting a library to solve a particular problem, you normally have to do some research and evaluate more than one library so, for me, the activity of the project and software versions supported are part of that necessary research. I can't imagine just using some random library without doing some legwork...? I appreciate what you're saying, and I think it is true to some extent, but on the other hand, I think in practice many people experiment with libraries to see if they work, and use the libraries without being absolutely sure that they work perfectly. You may think I'm doing it wrong, but I don't think I'm alone at all. I feel that Flaubert's quote really reflects the situation. For example, I recently used the Brent function minimization algorithm in commons math (which admittedly has a decent reputation). I didn't review the source code of the implementation carefully -- it's too complicated -- but as far as I can tell, the code works well for my application, and that part of my app passes various tests. The risk of bugs from that library is nonzero, but acceptable to me. For clojure to break backwards compatibility is levying an extra cost beyond these usual risks. I agree, as Andreas suggested, that there is a cost to the speed of innovation in the language if one maintains backwards compatibility, but on the other hand I think breaking backwards compatibility imposes a cost to the community and slows down library innovation. We are comparing the costs to two different groups -- the language developers and the users, and I am a user whining about the pain. I just hope Clojure's re-birthing pains will be minimized in the future. ;) Phil's suggestion of adding metadata to Clojars might help Yes, I think it will be very helpful to mark which jars are compatible with 1.2 or 1.3 -- I suppose this can be extracted from the dependencies vector in the project.clj file. And Stu's suggestion of detect-and-warn or detect-and-fail are also very valuable, since right now the situation is that mysterious errors occur without warning. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Reload/Reimport Java Class
Hi Asim, In the clooj IDE, you can invoke the Restart REPL menu command and your class will be reloaded. (Every time the REPL is restarted, a new classloader is created and the old one is discarded. Note that restarting the REPL does not destroy your namespace mappings. It is necessary to create a new chk instance. See example below. Arthur === Switching to /projects/test3 REPL === (ns test3.core) nil test3.core= (import 'chk) #CompilerException java.lang.ClassNotFoundException: chk (NO_SOURCE_FILE:1) [[Here I compiled chk.java in a child directory of my test3 project directory.]] test3.core= === RESTARTING /projects/test3 REPL === (ns test3.core) user=nil test3.core= (import 'chk) chk test3.core= (. (chk.) hello) Hello from chk (v1). [[Here I recompiled chk.java with v2.]] test3.core= (. (chk.) hello) Hello from chk (v1). test3.core= === RESTARTING /projects/test3 REPL === (ns test3.core) user=nil test3.core= (. (chk.) hello) Hello from chk (v2). -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: JSON library for clojure 1.3
Hi Stuart, I've added a JIRA ticket (CLJ-826). Thanks, Arthur On Aug 7, 7:19 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: Hi Arthur, I think thos would make a reasonable addition. If you'll make a JIRA ticket in the backlog, I'll see if I can push it forward. Ultimately, it will be Rich's decision, of course. Thanks, -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: JSON library for clojure 1.3
From clojure.contrib.string 1.2, I have found myself using drop, take, and butlast. (These are more than just wrappers for String/substring, because they behave nicely when indices exceed the string length.) I like these methods in part because they match the behavior of corresponding sequence methods, but have better performance. This makes optimizing (when needed) easier. Thanks, Arthur On Aug 5, 6:36 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: Are there any features you found essential in clojure.contrib.str-utils{2|3} that are not included in clojure.string? Please let me know, and we can consider tickets for those specific functions. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojurescript interop problems
One option is (. target :slot), possibly with the not-so-great (.:slot target) as well. Why not simply (target :slot) and (:slot target) as one means of accessing field values. Then you can still have clojure's traditional (.x target) execute when x is a function object and return x's value otherwise. If you want to get a member function object instead of executing it, use (:method target). These two syntaxes seem to stay consistent with traditional clojure but also accommodate javascript's equivalence between objects and maps. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojurescript interop problems
One option is (. target :slot), possibly with the not-so-great (.:slot target) as well. Why not simply (target :slot) and (:slot target) as one means of (:slot target) would do what, when facing an object which implements the Associative interface ? Here's what I was trying to say. Assume that target is a javascript object. For the colon syntax: If member is a field, then (:member target) would return the value of the field. If member is a method, then (:member target) would return a function object (that is, the value of the member field, which is a function), and ((:member target)) would execute the function. This is sensible because javascript-style objects are associative arrays. For the dot syntax: If member is a method, then (.member target) would execute the function. If member is a field, then (.member target) would return the value of the field. This is entirely consistent with clojure's existing syntax. My feeling is this is the smallest possible perturbation to clojure's behavior. The dot notation semantics don't change at all, and the colon syntax is also essentially the same, with the handy addition that because javascript contains first-class functions, you can treat javascript objects as Associatives, whereas in general you can't treat Java objects as associatives. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojurescript interop problems
Wasn't Rich trying to come up with a solution which could be retrofitted into Clojure ? I was trying to see how to avoid having to change anything in Clojure proper. In the strategy I'm humbly suggesting, the syntax from Clojure could work as-is. Just use same the dot notation (as in Clojure, for executing methods and getting the value of non-function fields), and if you need a member function as a function object (in ClojureScript) just access it as you would a member of an IMap, using (:methodName target) or (get target :methodName). Or, instead of keywords, you could use strings, such as (get target methodName). Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojurescript interop problems
On Aug 1, 12:45 pm, Arthur Edelstein arthuredelst...@gmail.com wrote: Wasn't Rich trying to come up with a solution which could be retrofitted into Clojure ? I was trying to see how to avoid having to change anything in Clojure proper. In the strategy I'm humbly suggesting, the syntax from Clojure could work as-is. Just use same the dot notation (as in Clojure, for executing methods and getting the value of non-function fields), and if you need a member function as a function object (in ClojureScript) just access it as you would a member of an IMap, using (:methodName target) or (get target :methodName). Sorry, not an IMap, an ILookup. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: JSON library for clojure 1.3
Similar question: where is clojure.contrib.string for 1.3? There are a lot of useful functions in clojure.contrib.string that aren't in clojure.string 1.3. Thanks! :) Arthur On Aug 1, 5:57 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: clojure.contrib.json has been continued as clojure.data.json:https://github.com/clojure/data.json It should work in 1.3 -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: JSON library for clojure 1.3
On Aug 1, 7:34 pm, Vincent vincent@gmail.com wrote: how can i test using clooj ide... will lein deps, then run clooj allow me test in repl window Yes, please give it a try. Any jar in the lib directory (as typically deposited by lein or cake) should be available on the classpath. After calling lein deps, you will need to choose the Restart REPL menu item in clooj if it is already running. Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript
Hi Christopher, We plan to have a recording of tonight's talk posted soon. I'm looking forward to seeing it. Thanks! :) Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
FWIW I just double-clicked on the clooj jar and it launched like any other application -- I didn't have to know that it was a jar or even what a jar is. Assuming that this also works on other OSes (I'm using Mac OS X) then I think this is already beginner friendly. I *think* it also includes everything that a newbie needs for a complete workflow without any other tools or Terminal interactions... Perhaps the main thing that's missing (besides various code-editing features) is an option for compiling and building the project. I'm thinking about bundling in leiningen for that. But if anyone has a better idea, do let me know. :) - Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Dave, Cool project, especially if it manages to *stay* lightweight :) Thanks -- I hope it will! :) * You might want to take a look at JSyntaxPane (https://code.google.com/p/jsyntaxpane/) for the editor. In theory adding Clojure syntax highlighting should be straightforward and they already cover stuff like line numbers, etc. An interesting suggestion. * Consider using actions for your menu items so you can reuse them in toolbars and elsewhere in the UI Yes, I probably need to overhaul this at some point. * getCaretPosition (and almost all Swing methods) is not thread-safe so calling it from an agent is asking for trouble :) Oops! It's interesting I haven't run into an error yet. Added to github issues. Good luck! Thanks! :) Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
clooj, a lightweight IDE for clojure
Hi Everyone, I want to let you know about clooj, a small, simple IDE for clojure that I have been developing (in clojure). It's packaged as a single jar file (including clojure 1.2), here: https://github.com/downloads/arthuredelstein/clooj/clooj-0.1.0-standalone.jar Just download it and double-click. (I use clooj to develop clojure code every day at work.) You can look at the source code here: https://github.com/arthuredelstein/clooj clooj runs as a standalone application or you can embed it in other JVM programs. (See the README, below). This is an alpha release and I plan to continue further development. Feedback of all kinds and code contributions are much appreciated! :) Arthur Edelstein San Francisco -- clooj, a lightweight IDE for clojure --- the application clooj is a small, simple IDE (integrated development environment) for the clojure programming language. clooj is written entirely in clojure and uses a swing-based GUI. It is cross-platform (assuming Java 1.6 has been installed on your operating system), and runs as a standalone application or as a clojure editor embedded in another java or clojure application. The standalone version (containing the clojure core) is a single jar file that can be launched by double-clicking its file icon or by running java -jar clooj-XXX-STANDALONE.jar from the command line. To embed in java, call clooj.core.show(). --- the layout The clooj window contains three columns. The left-most column is a tree showing clojure projects and the source files they contain. The middle column is the source file editor. The right column displays inputs and outputs of clojure REPLs (read-evaluate-print loops). --- the source editor The source code editor offers a few simple things to make writing clojure code easier: * A non-traditional bracket-matching feature highlights in gray those brackets that contain the innermost form you are currently editing. * Mismatched or unmatched brackets are highlighted in pink. * TAB indents, and shift+TAB unindents. * Automatically comment-out (and un-comment-out) multiple lines. * When newlines are entered, the next line is automatically indented. * Press ctrl-ENTER to send either the nearest root form or the selected text to the REPL. * Source files are continuously saved in the background to prevent accidental loss of your work in the event of a crash. --- clojure projects Each clojure project corresponds to a project directory somewhere in the file system, containing a src directory. Inside the src directory is the source code hierarchy, composed of directories and .clj files. Note this directory structure is completely compatible with the lein and cake clojure build programs and you are encouraged to use one of these from the command line in conjunction with the clooj editor. Clicking different source files in the projects tree will automatically change the source file currently being edited, as well as switch the REPL to the appropriate namespace. --- read-evaluate-print loops The upper part of clooj's REPL display column shows the REPL history (inputs and outputs) and the lower part is a text area for inputting forms into REPL. Each project gets its own REPL environment: when a project is first selected, a new clojure REPL is created behind the scenes and becomes the REPL in use. By choosing Restart REPL you cause a new REPL to be created for the currently selected project and the old one to be discarded, if possible. If the project directory contains directories named lib and/or jars and there are any jar files inside, these jars will be included in the classpath whenever the project REPL is launched. You can subsequently add further jar files to the classpath by placing them in the lib or jars directory and restarting the REPL. --- more work needed clooj is a work in progress. Your suggestions, criticisms and code contributions are appreciated. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Yep, this is great! How about syntax highlighting? Thanks, good suggestion! I'm not a huge fan of most syntax highlighting -- what do you think would be helpful but unobtrusive? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
On Jul 18, 2:31 am, Shantanu Kumar kumar.shant...@gmail.com wrote: This is so cool. Any chance you can use Laurent Petit's Paredit?https://github.com/laurentpetit/paredit.clj Thanks, that's a very interesting idea. Perhaps, if Laurent doesn't mind! :) Any roadmap for features? Syntax highlight, autocomplete etc? I'm adding Issues to the github project now. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Florian, but somehow i can't save ... It always says Oops Unable to save file Sorry, you need to choose File New first, or open a project with existing source files. I will try to fix this issue soon. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Lee, Tab moves it to the right, shift-tab moves it to the left, but is there a way to say move it to the correct place A very good point -- added to the clooj github issues. - I just created a new project and I get a user prompt in the REPL pane but I can't type anything into that... so I can't actually try it... I click in there but I don't get a cursor there, and typing does nothing. In case it matters I'm running Mac OS 10.6.8 and java -version says: The REPL input is the lower right pane. I think I should add some labels on each pane. - How is one supposed to create a new .clj file and add it to the project? Use the File New menu. I think that a hello world example that walks one through the process of creating a new project, adding a new, empty src file, adding code to that file, and running the code, would clear this up. Maybe also a second simple example that also adds one library... or something like that. That's a good suggestion. Overall I'd like to make the user interface more self-explanatory -- any ideas on how to do this would be very helpful. - It would be nice if all of the basic editor functionality was discoverable via menu items. For example the indentation commands are mentioned in the instructions in the posting to the list, but since they're not in the menus a user may not realize they're there. (These in particular could be under the Source menu, but as a general rule it would be nice if all major features are *somewhere* in the interface.) A good point. Added to the github issues. - Longer term I agree with Shantanu that things like syntax highlighting and autocompletion would be great, and actually I'd put my all-time favorite feature even before those: arglist-on-space. I'm a total arglist-on-space fanatic and evangelist -- I think it's the greatest idea ever for supporting/speeding code editing and that it should be in every Lisp editor. AFAIK it is currently available for Clojure only in emacs and MCLIDE. If I were going to add one editor feature beyond robust auto-indenting it would be arglist-on-space. Another excellent suggestion (added to issues). I think you're right -- arglist-on-space is very cool. Where do you think the arglist should appear? I think there's a tension between wanting to display it near where the user is typing and the need to not obscure nearby code. Again, I love this project! I hope that the comments above are taken as constructive criticism. Absolutely! Thank you very much for taking the time to give me so much helpful feedback. Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
On Jul 18, 3:16 am, Florian Over florian.o...@googlemail.com wrote: Hmm, good idea but somehow i can't save ... It always says Oops Unable to save file When i'm at home i will give it another try. Hi Florian, There are two requirements: 1. You need to have a project open, in a writable directory. 2. You need to create a .clj file in your project, by choosing File New. Sorry this isn't obvious -- I now realize this weirdness is the first issue I need to fix. Thanks for the feedback! Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Tamreen, On Jul 18, 5:38 am, Tamreen Khan histor...@gmail.com wrote: It's a little confusing to see what's normally the text for the prompt, user=, be in the window that shows the result. Why can't both the prompt and the results be shown in the same area? That is a good point. I wanted a multi-line editor for the REPL input, so I put the REPL input and output in separate panes. But I agree it would be nice to have the prompt in the REPL input pane. I'm adding this suggestion to the issues. Thanks for the feedback! Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
The REPL input is the lower right pane. I think I should add some labels on each pane. Ah yes -- now I see it and that works fine. Thanks also to Adam Burry for pointing this out. As Tamreen Khan noted it's a little confusing that there's a prompt in the upper pane while input can only be given in the lower pane... I agree with Tamreen that the ideal thing would be for both to be in the same pane, so it's a normal REPL that takes input and also gives output, but if that's very difficult for some reason then I agree that pane labels would help. I see what you're saying. I made the REPL input and output separate to make an easy multiline editor for the input. But I do agree it would be nice to show the prompt in the REPL input. If I combine the panes, I'm concerned that it will be tricky for users to see where the cursor can go. For some reason I was missing this and only seeing the menu item for a new project... but now I think this was just me, and that I jumped too quickly to the conclusion that new files were to be created outside of clooj. Now I see it and it works very nicely. I do think that a hello world walkthrough doc would prevent others from missing this and generally help to orient newcomers to the environment. My next task is to make this requirement more obvious -- it's a very awkward behavior right now. In emacs and MCLIDE (and as far as I recall in other environments that I've used, mostly for Common Lisp) it appears in a mini buffer below the editing pane. I think that's a good solution, but anywhere else within view but out of the way would suffice. I wouldn't want to put this within the edit buffer itself, since it might then get in the way and there'd be a much higher premium on getting the information and the way that it's displayed exactly right. Part of the beauty of arglist-on-space is that it's often extremely helpful -- and I tend to rely on it rather than my memory if it's available -- but there are no bad consequences if it's not exactly perfect (e.g. because of complex argument lists or special cases that make it hard to display the right info). I think I can grab the arglist just the way the built-in doc macro does, so it should be relatively straightforward. Thanks again for the awesome suggestion! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Another kick-ass feature would be first-class integration with Leiningen (and likewise, with Cake) - you can discover the list of commands using the lein command without any args. Once you discover the command names you can display it in a menu. When a user clicks one of those menu items, pop a textbox for other arguments and execute the entire command on pressing Enter. That's definitely something I would like. I've added it to the issues. You may also consider building a plugin architecture for Clooj. For example, Leiningen support can be built by writing a plugin. That's an interesting idea. How do you envision a plugin architecture should work? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
One of my biggest complaints against larger IDE's is trying to get them to look at the lein classpaths. Getting the same result in my repl as I get by doing lein run would be awesome. That's more or less what I've been attempting to do, but I need to check carefully that I have covered the lein/cake classpath completely. Added to github issues. Great job! Thanks! :) And thank you for the feedback! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Not sure if I'm not misunderstanding the initial creating of a project, but it seems to me that I am using a file dialog box for a directory selection. As it wasn't entirely clear what it expected me to do at that point, I just typed in some name without knowing for sure if it was supposed to be a file name or a directory, and found out afterward that it was in fact a name that represented a directory. The file dialog for creating a new project is supposed to have the title Create a project directory. Is this visible on your OS when you choose Project New...? (If not, what OS are you using?) Thanks for the feedback, Lars! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Yes, it does say that now that I'm checking again, I must have missed it the first time around. I just confused it with a regular file dialog box. My feeling about a different style dialog box stands, Thanks for pointing it out; I'll try to fix that. I'm much, much more interested in a the automatic indent (first brought up by Lee in this thread) that I couldn't live without in Emacs (for any programming langauge..) Being able to hit tab wherever I happen to be in a line and have it do the right thing rather than simply inserting a tab at the cursor location is invaluable, along with reindenting a region or a whole file. So +1 from me for that feature, if there's a tally going on for the requests. ;) Tallied. :) What's your favorite keyboard shortcut for invoking smart indent? Is it TAB? I imagine it's still important to be able to indent and de-indent manually, but maybe I'm wrong. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
I use TAB. Just about the only file type I edit for which it doesn't do this are Makefiles. C/C++, Clojure/Lisp, O'Caml source files, etc, I use TAB in Emacs and expect it do make the current line indented appropriately, whether I'm at the beginning, end or in the middle of the line. I can't remember the last time I really felt I needed an actual tab character in a source file of mine. I should make clear, I don't allow tab characters in clooj at all. :) All indentation uses spaces. I guess my fear is that users will find it annoying if the TAB key is devoted to smart indentation and space and delete are the only tools for adjusting the indentation manually. But maybe manual indentation is a rare enough that it is better to use TAB for smart indentation. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Timothy, Thanks for your message. I don't know if it has been mentioned yet, but I'm not getting error-output in the REPL. If I type (println foo) then do CTRL+E I see the REPL spit out the lines I entered, then nothing... I don't know why are aren't getting an error message. When I do the same thing, in the REPL output pane I get (println foo) #CompilerException java.lang.Exception: Unable to resolve symbol: foo in this context (NO_SOURCE_FILE:1) What OS and java version are you using? Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Hi Shantanu, Just wanted to highlight that both Emacs Clojure-mode and Eclipse/ CounterClockWise use TAB to auto-indent the current line correctly. So, I guess the expectation would be likewise for the respective proportion of Clojure users. Though of course the key bindings should be re-mappable too IMHO. Very good points. The keyword here seems to be well defined global state properties, which could be hierarchical in order to be extensible. This makes sense to me. How should clooj plug in plugins? So, just to expand the scope - what kind of plugins should be possible: ... Wow, these are fantastic ideas and suggestions. Thanks for thinking all of this through! There's so much to do ... if you feel like undertaking any of these, I'll be very excited by pull requests! ;) Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
Thanks to everyone who downloaded clooj, and thanks especially to those of you who kindly provided feedback! I'm really grateful for your help. Since today's release I've made some bug fixes and improvements to tighten up the handling of projects and files, to address some of the issues people have brought up. Also added is an important bug fix from Steve Lindsay. New releases of clooj 0.1.1 (standalone app and embeddable jar) with these changes are at https://github.com/arthuredelstein/clooj/downloads This is also where downloads of future versions will be available. I have also started a Google group for anyone who wants to continue discussing clooj: http://groups.google.com/group/clooj - Arthur Edelstein On Jul 18, 12:03 am, Arthur Edelstein arthuredelst...@gmail.com wrote: Hi Everyone, I want to let you know about clooj, a small, simple IDE for clojure that I have been developing (in clojure). It's packaged as a single jar file (including clojure 1.2), here:https://github.com/downloads/arthuredelstein/clooj/clooj-0.1.0-standa... Just download it and double-click. (I use clooj to develop clojure code every day at work.) You can look at the source code here:https://github.com/arthuredelstein/clooj clooj runs as a standalone application or you can embed it in other JVM programs. (See the README, below). This is an alpha release and I plan to continue further development. Feedback of all kinds and code contributions are much appreciated! :) Arthur Edelstein San Francisco -- clooj, a lightweight IDE for clojure --- the application clooj is a small, simple IDE (integrated development environment) for the clojure programming language. clooj is written entirely in clojure and uses a swing-based GUI. It is cross-platform (assuming Java 1.6 has been installed on your operating system), and runs as a standalone application or as a clojure editor embedded in another java or clojure application. The standalone version (containing the clojure core) is a single jar file that can be launched by double-clicking its file icon or by running java -jar clooj-XXX-STANDALONE.jar from the command line. To embed in java, call clooj.core.show(). --- the layout The clooj window contains three columns. The left-most column is a tree showing clojure projects and the source files they contain. The middle column is the source file editor. The right column displays inputs and outputs of clojure REPLs (read-evaluate-print loops). --- the source editor The source code editor offers a few simple things to make writing clojure code easier: * A non-traditional bracket-matching feature highlights in gray those brackets that contain the innermost form you are currently editing. * Mismatched or unmatched brackets are highlighted in pink. * TAB indents, and shift+TAB unindents. * Automatically comment-out (and un-comment-out) multiple lines. * When newlines are entered, the next line is automatically indented. * Press ctrl-ENTER to send either the nearest root form or the selected text to the REPL. * Source files are continuously saved in the background to prevent accidental loss of your work in the event of a crash. --- clojure projects Each clojure project corresponds to a project directory somewhere in the file system, containing a src directory. Inside the src directory is the source code hierarchy, composed of directories and .clj files. Note this directory structure is completely compatible with the lein and cake clojure build programs and you are encouraged to use one of these from the command line in conjunction with the clooj editor. Clicking different source files in the projects tree will automatically change the source file currently being edited, as well as switch the REPL to the appropriate namespace. --- read-evaluate-print loops The upper part of clooj's REPL display column shows the REPL history (inputs and outputs) and the lower part is a text area for inputting forms into REPL. Each project gets its own REPL environment: when a project is first selected, a new clojure REPL is created behind the scenes and becomes the REPL in use. By choosing Restart REPL you cause a new REPL to be created for the currently selected project and the old one to be discarded, if possible. If the project directory contains directories named lib and/or jars and there are any jar files inside, these jars will be included in the classpath whenever the project REPL is launched. You can subsequently add further jar files to the classpath by placing them in the lib or jars directory and restarting the REPL. --- more work needed clooj is a work in progress. Your suggestions, criticisms and code contributions are appreciated. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please
Re: clooj, a lightweight IDE for clojure
This is a very helpful discussion -- I'm going to think about tabs on the hammock. On Jul 18, 8:06 pm, Ken Wesson kwess...@gmail.com wrote: On Mon, Jul 18, 2011 at 5:14 PM, abp abp...@googlemail.com wrote: Why is it necessary to press TAB at all? Couldn't auto-indent be the default for a line and only manually reindented lines opt-out until one opts in again using TAB or something? This is an interesting thought. On the other hand, when lines are merged or split, where does this status go? I'm thinking when a line is split the second of the two resulting lines should start out indented correctly relative to the first, and inherit the first's status; when two lines are merged, the status of the first of the two becomes the status of the merged line. This is consistent with the status being an invisible metacharacter at the start of the line that is deleted with the immediately preceding newline and cloned if enter is hit in the middle of that line. What about multi-line pastes? If the paste is of material cut or copied from inside clooj, the status of each line that was cut or copied would be stored OOB somewhere and used for the paste. (Actually using funny extra characters inline in the copied material has problems if material is copied from clooj and pasted into something else, such as a post to this list.) From outside clooj? Some sensible default, such as autoindent off (keep paste's formatting) or on (auto-fix to context). Maybe let the user choose either in an options screen. Saving the state across sessions also seems to need to be OOB. Putting it in the .clj file at the start of each line would gum up other tools, and adding clooj-internal comments to source files isn't much better. A clooj.dat file in the project root? Alternatively, avoid the mess and just always maintain structure-determined indent of all lines at all times. Does anyone really want fully user-controlled indenting outside of comments anyway? Spaces and tabs in the indent can just jump you to the start of the forms on the line, and self-insert normally in string literals and in ; comments, and single spaces normally anywhere (maybe turn tabs into spaces and tab or space next to a space just moves you to the right of the space). Or, the traditional thing: full control, but tab or something will reindent the current line, or all lines intersecting the selection if any, to structurally-correct positions based on all of the code above, if tab is hit outside a string literal or ; comment. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clooj, a lightweight IDE for clojure
But please, please, please DON'T ABANDON THIS PROJECT. I'll do my best to hang on. :) Thinking~~: - Maybe we need CLOOJ or something similar for .NET as well. David Miller's work should be rewarded with a CLOOJ of it's own. - A webstart version. - I hope that we don't start to see hundreds of conflicting setup instructions in blog posts (like those for Emacs). - I wish that Swing was prettier on the eye. I love nice GUIs. Me too. I think in the long run the coolest thing will be an in- browser clojure IDE for clojure-in-javascript, especially when multi- threaded javascript becomes available in web browsers. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
meta bytecode redundancy?
Hi Everyone, I have a question about an apparent redundancy in clojure's generated class files. Out of curiosity I was inspecting the core class files using the Java Decompiler JD-GUI. For example, here is the decompiled version of core$dec.class (the implementation of the dec function): package clojure; import clojure.lang.AFunction; import clojure.lang.IObj; import clojure.lang.IPersistentMap; import clojure.lang.Numbers; public final class core$dec extends AFunction { final IPersistentMap __meta; public core$dec(IPersistentMap paramIPersistentMap) { this.__meta = paramIPersistentMap; } public core$dec() { this(null); } public IPersistentMap meta() { return this.__meta; } public IObj withMeta(IPersistentMap paramIPersistentMap) { return new dec(paramIPersistentMap); } public Object invoke(Object x) throws Exception { x = null; return Numbers.dec(x); } } I noticed that every class file, corresponding to a function in the core, contains many of these same lines for implementing metadata storage, namely: import clojure.lang.IObj; import clojure.lang.IPersistentMap; final IPersistentMap __meta; public core$FUNCTIONNAME(IPersistentMap paramIPersistentMap) { this.__meta = paramIPersistentMap; } public core$FUNCTIONNAME() { this(null); } public IPersistentMap meta() { return this.__meta; } public IObj withMeta(IPersistentMap paramIPersistentMap) { return new FUNCTIONNAME(paramIPersistentMap); } It seems to me that this metadata storage functionality could be absorbed into the relevant abstract class(es), perhaps AFn. Could this change increase performance and cut down on the size of the bytecode? Best regards, Arthur -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en