> #!/bin/sh
> DP="${0%/*}"
> java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java -
> Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/
> waterfront/ide/plugins clojure.main ${DP}/clj/net/sourceforge/
> waterfront/ide/main.clj $*
I propose that we Clojure-using folks adopt CLOJURE_HOME as our
"standard" environment variable that can be used to find clojure.jar
and other interesting bits of Clojure. The proposed value of
CLOJURE_HOME is an absolute path to the top level of an svn checkout
or binary distribution of Clojure.
Scripts would use $CLOJURE_HOME/clojure.jar (or its equivalent on
Windows) as the path to the current environment's preferred clojure.jar.
The script above would become:
> #!/bin/sh
> DP="${0%/*}"
> java -cp $CLOJURE_HOME/clojure.jar:${DP}/clj:${DP}/java -
> Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/
> waterfront/ide/plugins clojure.main ${DP}/clj/net/sourceforge/
> waterfront/ide/main.clj $*
>
--Steve
I already use that so it would be fine with me!
--
R. Mark Volkmann
Object Computing, Inc.
> I propose that we Clojure-using folks adopt CLOJURE_HOME as our
> "standard" environment variable that can be used to find clojure.jar
> and other interesting bits of Clojure. The proposed value of
> CLOJURE_HOME is an absolute path to the top level of an svn checkout
> or binary distribution of Clojure.
I like the idea, but does this imply that clojure-contrib.jar should be
in the same directory? Or should it look in
$CLOJURE_HOME/../clojure-contrib/clojure-contrib.jar.
Can I also suggest that if CLOJURE_HOME isn't set that it defaults to
$HOME/src/clojure? This is what clojure-mode.el's M-x clojure-install
uses, and folks seem to find that useful.
-Phil
> I like the idea, but does this imply that clojure-contrib.jar should
> be
> in the same directory? Or should it look in
> $CLOJURE_HOME/../clojure-contrib/clojure-contrib.jar.
That would work in my setup, but it seems clumsy. Perhaps Rich would
consider blessing a standard location for contrib within the Clojure
top level directory. I just tried that locally and it seems to work
fine with svn--no interference between clojure, an svn checkout
directory for clojure and clojure/contrib, a separate svn checkout
directory for clojure-contrib.
I think:
$CLOJURE_HOME/contrib
would be a good standard location for clojure-contrib and if that
becomes common practice, then the contrib jar will be at:
$CLOJURE_HOME/contrib/clojure-contrib.jar
(If this flies, at some point it would be good to add "contrib" to the
svn-ignore list for Clojure's top level directory so it wouldn't even
show up as an untracked node.)
> Can I also suggest that if CLOJURE_HOME isn't set that it defaults to
> $HOME/src/clojure? This is what clojure-mode.el's M-x clojure-install
> uses, and folks seem to find that useful.
That seems like a great default. I like it.
--Steve
Am 25.02.2009 um 23:39 schrieb Laurent PETIT:
> No, please, don't mix projects directory hierarchies,
+1
Where is the problem to tell the people: "Set up a sane CLASSPATH
containing the clojure.jar and clojure-contrib.jar you want!" and then
just use that? Maybe there isn't even a "CLOJURE_HOME"? People
don't need the source installed....
Sincerely
Meikel
(If this flies, at some point it would be good to add "contrib" to the svn-ignore list for Clojure's top level directory so it wouldn't even show up as an untracked node.)
> Another way to do this is to add contrib as an svn external: http://svnbook.red-bean.com/en/1.0/ch07s03.html
> Set up like this, an "svn update" in the root directory would update
> both projects.
Very cool. I saw this kind of thing in action for the first time
yesterday when checking out Clozure Common Lisp via svn. I had no idea
how they did that.
I just tried it with clojure and clojure-contrib and it worked very
smoothly. One potential glitch is that the external reference for
contrib would presumably be:
contrib http://clojure-contrib.googlecode.com/svn/trunk/
However, for a member of clojure-contrib, the correct entry would be:
contrib https://clojure-contrib.googlecode.com/svn/trunk/
(https vs. http)
Have the svn folks come up with a neat solution for that case or would
a clojure-contrib member simply propedit his local clojure svn
checkout to give the correct URL for him?
Thanks for the pointer to the info about external!
--Steve
Kind regards,achim
What's wrong with just putting the jars in your CLASSPATH and not
requiring anything explicit in scripts? I just put all the jars I want
to use with Clojure in a single directory, clojure/jars, and they get
added automatically by my .bash_profile along with all the system
installed jars:
CLJ=$PROJECTS/clojure
CLJ_DIR=$CLJ/jars
CLJ_JARS=$(find $CLJ_DIR -name "*.jar" -exec printf {}: \;)
SYS_DIR=/usr/share/java
SYS_JARS=$(find $SYS_DIR -name "*.jar" -exec printf {}: \;)
export CLASSPATH=$CLJ_LIBS:$HOME/sw/java:$SYS_JARS:$CLJ_JARS:.
Seems to work pretty well.
-Jeff
> I've already answered to the external stuff in another message (and
> sorry for having been so crude, but I really think it's not a so
> good idea. In that particular case : clojure does not depend on
> clojure contrib. So clojure svn must not depend on clojure-contrib
> svn).
Thanks for the discussion. I understand your objections and in the
face of them I estimate the probability of any of these changes being
adopted to be 0. The status quo, where there is a complete separation
of clojure and clojure-contrib, is in some ways (perhaps many ways)
simpler than using a feature of svn to combine them. Simplicity is a
high value and I'm sure it will win the day. I have no objection to
that.
For my own education, I just re-read the documentation at red-bean and
there is nothing mentioned there in the externals section about
dependencies. What they talk about is keeping code that's logically
part of one thing in separate repositories (or separate locations
within one repository). That's exactly the case with clojure and
clojure-contrib.
It seems to me that the dependency scenario you describe is one use of
externals, but not necessarily the only one.
clojure-contrib is logically part of Clojure:
- The contrib namespaces live in a namespace under the "clojure."
umbrella.
- The licensing and contribution requirements are exactly the same.
- Code can (and has) flowed from clojure-contrib into clojure.
My understanding is that the primary reason contrib code was put in a
separate svn repository is that doing so provides a clean way to have
a few more committers for clojure-contrib than the one committer for
clojure. Another benefit of having them separate (which would be
preserved in a clojure/contrib setup) is that it's clear which parts
of Clojure have Rich's full support and which parts don't.
This external mechanism in svn looks like it would allow all the
benefits of keeping them separate while avoiding some of the minor
annoyances that come with them being separate--like knowing where
clojure is installed doesn't give you any info about where clojure-
contrib is installed.
> Concerning the https vs http problem, I haven't checked svn redbook
> recently (and I don't know exactly which svn version googlecode is
> running), but at some time in the past, it was tricky (if not
> impossible) to do edits and commits in an external.
Thanks for that info.
--Steve
> +1 on setting a sane CLASSPATH and not depending on other environment
> variables.
>
> Then there is no need to specify a custom -cp for every Clojure/Java
> program/script either...
The problem I see with using CLASSPATH this way is that it
(potentially) affects the classpath for every JVM instance you launch,
not just the ones associated with Clojure. It seems to me that it's
desirable for there be a more focused way to express/maintain the
concept of "When I deal with a Clojure REPL, these are the jars I want
to be available to it."'
My most recent effort along those lines is at clojure-contrib/
launchers/bash/clj-env-dir.
--Steve
> P.S. My very simple CLASSPATH setup detailed here:
> http://yusupov.com/blog/2009/basic-clojure-setup-part-1/
Cool! Thanks for writing that up.
--Steve
On Feb 25, 2009, at 6:50 PM, Telman Yusupov wrote:
+1 on setting a sane CLASSPATH and not depending on other environment
variables.
Then there is no need to specify a custom -cp for every Clojure/Java
program/script either...
The problem I see with using CLASSPATH this way is that it (potentially) affects the classpath for every JVM instance you launch, not just the ones associated with Clojure. It seems to me that it's desirable for there be a more focused way to express/maintain the concept of "When I deal with a Clojure REPL, these are the jars I want to be available to it."'
> This version is fully functional and so far I didn't encounter any
> bugs.
> I guess that over the course of the next few days, as people start
> using this version,
> a few issues may come up. I'd be glad to fix these.
>
> I also took Mike's suggestion, Waterfromt's main window is now using
> a side-by-side layout.
Hi Itay,
Very nice work on waterfront! I gave it a try on Mac OS X. It worked
well and showcases many cool ideas.
I had a couple of issues:
- when building on Mac OS X with Java 6 64-bit or Java 5 32-bit, I got
errors like this one:
[javac] Compiling 1 source file to /sq/ext/waterfront/waterfront/
bin
[javac] /sq/ext/waterfront/lab/src/net/sourceforge/waterfront/ide/
services/Main.java:92: method does not override a method from its
superclass
[javac] @Override
[javac] ^
[javac] 1 error
in every case where @Override was present in the waterfront source.
I was able to build successfully by commenting all of them out.
- When using waterfront on Mac OS X, it appears that the control
characters intended to trigger menu selections (e.g. ^E) are being
intercepted before they reach the menus. In the specific case of ^E,
it is being interpreted by the text input field as "move to end of
line" which is a common meaning for it in Mac OS X. I suspect there is
a way to trigger menu items using the "command-key" on the Mac (while
still using the control key on Windows) and people using waterfront on
Mac OS X would benefit from a change to using that mechanism.
Thanks very much for waterfront!
--Steve
You almost always want to use "$@" (including quotes) instead of $*.
See this thread for why:
You'll also run into trouble if ${DP} contains spaces, unless you
quote those arguments too:
#!/bin/sh
DP="${0%/*}"
java -cp "~/src/clojure/clojure.jar:${DP}/clj:${DP}/java"
-Dnet.sourceforge.waterfront.plugins="${DP}/clj/net/sourceforge/waterfront/ide/plugins"
clojure.main "${DP}/clj/net/sourceforge/waterfront/ide/main.clj" "$@"
--
Michael Wood <esio...@gmail.com>
> In Java6 @Override can also be attached to a method that overrides an
> interface-declared method. So, the code is not supposed to compile w/
> a Java5 compiler. As for the Java6 compiler, my guess is that your
> compile is configured to be Java5 complaint. So I would suggest to
> specify "-source 1.6" in the javac command line. Anyway, I will add it
> to the build.xml file.
Do you need Java 1.6 features? Clojure itself works fine with 1.5,
and there are still machines around for which there is no 1.6 (my PPC
Mac running MacOS 10.4, for example), so it would be nice if
Waterfront could work with Java 1.5 as well.
Konrad.
No I don't need Java6. My Eclipse is configured to be Java6-compliant
On Feb 26, 2:02 pm, Konrad Hinsen <konrad.hin...@laposte.net> wrote:
> On Feb 26, 2009, at 12:30, Itay Maman wrote:
>
> > In Java6 @Override can also be attached to a method that overrides an
> > interface-declared method. So, the code is not supposed to compile w/
> > a Java5 compiler. As for the Java6 compiler, my guess is that your
> > compile is configured to be Java5 complaint. So I would suggest to
> > specify "-source 1.6" in the javac command line. Anyway, I will add it
> > to the build.xml file.
>
> Do you need Java 1.6 features? Clojure itself works fine with 1.5,
> and there are still machines around for which there is no 1.6 (my PPC
> Mac running MacOS 10.4, for example), so it would be nice if
> Waterfront could work with Java 1.5 as well.
so it generates
It also has the ugly default swing L&F on my machine too. I'm using Linux / KDE.
I'm not at home right now but as soon as I return (should be Monday), I'll check
My guess is that it has to do with KDE being based on Qt. Java only
has a GTK+ look and feel for Linux so it probably consider it doesn't
have my native look and feel available and defaults to metal.
> Revision 148 is available for download at
> http://sourceforge.net/project/platformdownload.php?group_id=249246
> It addresses some of the requests that were raised in this discussion:
>
> * Changed default location of the divider
> * Fixed the "command-key" issue on Macs.
> * Java 1.5 compilance (prev. 1.6)
I still can't run it with Java 1.5:
java.lang.UnsupportedClassVersionError: Bad version number in .class
file (kit.clj:247)
Is there a simple way to recompile everything on my machine?
Konrad.
> If you pull trunk out of subversion you can build it locally with
> Ant. Would that do it?
Definitely, thanks! I pulled the latest revision and built it by
typing "ant". No compilation errors, but I can't run it either:
Can't load plugin custom-editor.clj. Reason:
java.lang.ClassNotFoundException:
javax.swing.filechooser.FileNameExtensionFilter (file.clj:171)
Can't load plugin context-menu.clj. Reason: nil
Can't load plugin file.clj. Reason: java.lang.ClassNotFoundException:
javax.swing.filechooser.FileNameExtensionFilter (file.clj:171)
Can't load plugin problem-window.clj. Reason: nil
Can't load plugin undo.clj. Reason: java.lang.Exception: LazySeq used
in 'if' (lexer.clj:0)
Can't load plugin comments.clj. Reason: java.lang.Exception: Unable
to resolve symbol: create-undo-transaction in this context
(comments.clj:48)
Can't load plugin line-column.clj. Reason: nil
Can't load plugin find.clj. Reason: java.lang.Exception: Unable to
resolve symbol: create-undo-transaction in this context (find.clj:117)
Can't load plugin indicator.clj. Reason: nil
Can't load plugin output-window.clj. Reason: nil
Can't load plugin check-syntax.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
Can't load plugin indent.clj. Reason: java.lang.Exception: Unable to
resolve symbol: create-undo-transaction in this context (indent.clj:125)
Can't load plugin paren-matching.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
Can't load plugin eval-as-you-type.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
java.lang.NullPointerException
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:26)
at net.sourceforge.waterfront.ide.plugins$set_font__1700.invoke(font-
observer.clj:20)
at net.sourceforge.waterfront.ide.plugins$set_fonts__1703.invoke
(font-observer.clj:26)
at net.sourceforge.waterfront.ide$dispatcher__550$fn__554.invoke
(ui.clj:85)
...
It looks as if my installation lacks parts of Swing, but there also
seem to be some lazy-seq-related bugs in Waterfront itself (my
Clojure is compiled with clojure.assert-if-lazy-seq=true).
Is anyone running Waterfront successfully on a Mac with Java 1.5?
Konrad.
> Alternatively hoping that this is the only Java6-only dependency in
> the code, you can also apply this patch to clj/net/sourceforge/
> waterfront/ide/plugins/file.clj (I didn't test is though - I am away
> from my machine, so no warranty...)
Thanks for the quick fix, it works!
I can now start Waterfront and work with it, but there are still some
error messages at startup concerning certain plugins:
Can't load plugin undo.clj. Reason: java.lang.Exception: LazySeq used
in 'if' (lexer.clj:0)
Can't load plugin comments.clj. Reason: java.lang.Exception: Unable
to resolve symbol: create-undo-transaction in this context
(comments.clj:48)
Can't load plugin find.clj. Reason: java.lang.Exception: Unable to
resolve symbol: create-undo-transaction in this context (find.clj:117)
Can't load plugin check-syntax.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
Can't load plugin indent.clj. Reason: java.lang.Exception: Unable to
resolve symbol: create-undo-transaction in this context (indent.clj:125)
Can't load plugin paren-matching.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
Can't load plugin eval-as-you-type.clj. Reason: java.lang.Exception:
LazySeq used in 'if' (lexer.clj:0)
I applied two fixes in lexer.clj that get rid of all these messages:
1) Replace first-is by
(defn first-is
{ :test (fn []
(assert-eq false (first-is \a (seq "")))
(assert-eq true (first-is :nothing (seq "")))
(assert-eq true (first-is \a (seq "a")))
(assert-eq false (first-is :nothing (seq "a")))
(assert-eq true (first-is \a (seq "ab")))
(assert-eq false (first-is :nothing (seq "ab")))
(assert-eq false (first-is \a (seq "ba")))
(assert-eq false (first-is :nothing (seq "ba"))) )}
[e es]
(if (seq es)
(= e (first es))
(= e :nothing) ))
2) Replace get-mate-from-pairs by
(defn get-mate-from-pairs
{ :test (fn []
(assert-eq [:match 4] (get-mate-from-pairs (compute-
paren-matching-pairs "01[3]5") 2)) )}
[pairs offset]
(let [pair (filter (fn [x] (= offset (second x))) pairs)]
(if (seq pair)
[(nth (first pair) 0) (nth (first pair) 2)]
nil )))
Konrad.
There are some bugs in your script. See my post in this thread from a
few days ago for details:
http://groups.google.com/group/clojure/browse_thread/thread/d5ce5ddb679cb8f9/79919526bf401a08?lnk=gst#79919526bf401a08
> P.S. - The text editor you are using for the shell script is encoding
> DOS style newlines and doesn't work on linux. I copied the text to a
> new file to get around it.
--
Michael Wood <esio...@gmail.com>