Hi Glen, Everybody seems to have their own approach. I use a run-slime
wrapper emacs function discussed here:
http://groups.google.com/group/clojure/browse_thread/thread/855804aa6fdd74a1/0969640bc5637bd7)
Here is the emacs code I use:
(defun reset-swank ()
"Because changing swank-clojure-extra
Phil, that's useful advice about unpacking jar files to a project's
dependency directory versus dropping jar files in there. That would be
a good candidate for a FAQ regarding how to add dependent jars during
development without restarting your REPL. And it decreases questions
about the deprecated
Thanks Phil. I'll try it out. It's about time I started learning about
Maven anyway.
--~--~-~--~~~---~--~~
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
To u
Correction:
(defun reset-swank ()
"Because changing swank-clojure-extra-classpaths is not enough
to force a new instance of slime to use it."
(interactive)
(setq slime-lisp-implementations
(assq-delete-all 'clojure slime-lisp-implementations))
(add-to-list 'slime-lisp-implementati
Using something like this run-slime wrapper to start slime may be
useful to others. It helps me avoid some issues when moving from
project to project without restarting emacs. Assuming jar files reside
in each separate project's own "lib" directory, Clojure source in its
"src" directory, and compi
OK, I understand. When you want separate Clojure functions that
execute different code for same arity/different signature case, you
must use the method demonstrated by Christophe. The code I showed was
only useful when you don't care about the type. You could use the
multi-arity function and manua
I guess I don't understand. In the Clojure code below, the double
arity method does in fact override all three of the methods from the
superclass (two of which have the same name and same arity). Isn't
that what you're looking for? Try it out.
|-- build.xml
|-- go.clj
|-- src
| `-- expmeth
|
Both my method (multi-arity) and Christophe's method (overridden
method names contain arguments) do work. I tested them both with the
code posted.
-Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" grou
On Feb 13, 9:59 am, Laurent PETIT wrote:
> Your example code below is not complete (where's helloSuper definition ?),
Yes, it is complete. See :exposes-methods under (doc gen-class).
"helloSuper" is the exposed name for the hello method in the
superclass. Clojure creates that method for you.
-C
Christophe, you're right. I tried it and that method also works. I
didn't know about that secret feature.
(ns expmeth.TestMe
(:gen-class
:extends expmeth.ClassA
:exposes-methods {hello helloSuper}))
(defn -hello [this]
(.helloSuper this)
(println "hello from clojure!"))
(defn
I just tried it out to be sure. Overloaded methods with the same arity
work as expected. Clojure picks the right method to call via
reflection.
package expmeth;
public class ClassA {
public void hello() {
System.err.println("hello from Java!");
}
public void hello(int x) {
Have a look at how the clojure-contrib project is compiled. The
build.xml file will help.
--~--~-~--~~~---~--~~
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
For the benefit of others, since this took me a while to understand...
When using gen-class to extend or implement a superclass with
overloaded methods, use a single multi-arity function to override the
overloaded methods in the superclass:
expmeth/ClassA.java:
package expmeth;
public class Clas
Thanks Stuart. Since the clojure-contrib.jar you built in step 3 does
include both clj and class files, I think you can reduce
(setq swank-clojure-extra-classpaths
(list "/Users/stuart/Projects/clj/contrib/src"
"/Users/stuart/Projects/clj/contrib/classes"))
to
(set
Name: clojure.contrib.server-socket.clj
URL:http://code.google.com/p/clojure-contrib/
Author: Craig McDaniel
Category: net
License: ECL
Description: An enhancement of Rich's original socket-server example
that keeps track of client connections, closing them when the go away.
It also inc
Thanks Steve. I'm going with your suggestion to use the var itself
rather than the symbol as the key. It simplifies things.
-Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this gro
Make that http://github.com/kreg/traceme/tree/master to just view the
project.
--~--~-~--~~~---~--~~
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
To unsubscr
Anyone have a better method to go from a symbol to a namespace
qualified symbol? I'm using this ugly kludge now:
(symbol (.substring (.toString (resolve sym)) 2))
I'm keeping a map of currently traced functions and the key is the
namespaced-qualified symbol of the function. See
git://github.com
git://github.com/kreg/traceme.git
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
clojure
> I wonder if it wouldn't be a good idea to move the call to binding
> fromsocket-replinto accept-fn. It seems like a reasonable default to rebind
> *in* and *out* for the duration of the accepting function; the example
> uses this as does my application.
I'm not sure that rebinding *in* and *ou
On Jan 19, 11:45 am, Phil Hagelberg wrote:
> I noticed that very little of this code is specific to the REPL; the
> bulk of it is just dealing with creating and doing things with server
> sockets. Perhaps it could be included in clojure-contrib as a
> generalized server-sockets library if instead
I am a registered contributor...even though I haven't contributed
anything so far. I opened an issue on clojure-contrib and attached the
file. Let me know if that is not the correct procedure.
-Craig
--~--~-~--~~~---~--~~
You received this message because you are
Well, somehow that link points to an old version. I guess the delete
and rename functions in Google groups do some strange things. Just
look for the file in the Files section.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
On Jan 19, 9:55 am, "Stephen C. Gilardi" wrote:
> Would you be up for including this in clojure-contrib? If so, and if
> we hear no objection here, could you please put on the appropriate EPL
> license header and your copyright notice (see other contribs for
> examples) and I'll be happy t
Correction: http://clojure.googlegroups.com/web/socket-repl+(2).clj
--~--~-~--~~~---~--~~
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
To unsubscribe from t
In case this is of use to anybody else, I thought I'd share my version
of a socket REPL: http://clojure.googlegroups.com/web/socket-repl.clj
Unlike the socket repl on the Wiki Example page, it does the
following:
- uses the repl from clojure.main
- keeps track of connections, closing the sockets
Getting back to Phil Hagelberg's comment that maintaining a project's
classpath in both a SLIME config and shell script for each project/
application is a "Don't Repeat Yourself" violation, there is a way to
avoid that:
Don't bother with swank-clojure-extra-classpaths. Instead, include /
path/to/
Here is a minor update to what I posted previously (but this time as
an attachment). This is just a small library that allows you turn on
tracing for all functions in a namespace all at once, or toggle
tracing for individual functions.
--~--~-~--~~~---~--~~
You rece
Correction: http://paste.lisp.org/display/71656
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send emai
I'd like to submit a new tracing library to clojure.contrib. Please
try it out and let me know if it is suitable.
The existing clojure.contrib.trace macros allow you to explicitly
trace any expression or redefine a function with deftrace so that it
is traced. But deftrace doesn't work with functi
o ago that you can't use -jar
> together with -cp. That means you can't get around specifying the name
> of the main class you want to run.
>
>
>
> On Wed, Dec 3, 2008 at 9:05 AM, Craig McDaniel <[EMAIL PROTECTED]> wrote:
>
> > The classpath specified on
The classpath specified on the command line seems to be ignored for
case #3 (using SVN Rev 1142):
1. Using clojure.lang.Repl
java -cp /home/kreg/src/clojure/trunk/clojure.jar:/another/class/path
clojure.lang.Repl
Clojure
user=> (.getProperty System "java.class.path")
"/home/kreg/src/clojure/tru
Never mind about my unloaded/reloading servlets comment. Checking for
a swank exception as in the original example would work fine.
-Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to
Make sure you're using the latest versions of clojure (SVN version,
not dated release), and swank-clojure as well.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to
Since release 1127, you can now do this instead:
$ cat src/mypkg/HelloServlet.clj
(ns myapp.HelloServlet
(:gen-class
:extends javax.servlet.http.HttpServlet)
(:import (java.io PrintWriter)
(java.util.logging Logger Level))
(:require swank clojure.main))
(defn- -init [this con
Thanks for the explanation. I just wanted to report it in case it
might be a bug.
--~--~-~--~~~---~--~~
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
To unsu
Testing the new (ns ... :genclass ...), I copied Rich's example from
http://paste.lisp.org/display/70665:
(ns my.hello
(:gen-class
:extends javax.swing.DefaultCellEditor
:constructors {[Integer] [javax.swing.JCheckBox]}
:factory makeone
:methods [[mymax [int] int]]
:init init
9, 7:31 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 9, 2008 at 7:21 PM, Craig McDaniel <[EMAIL PROTECTED]> wrote:
>
> > Without including gen in the classpath, the following exception is
> > reported:
>
> This may have something to do with the last few
9, 1:45 pm, Craig McDaniel <[EMAIL PROTECTED]> wrote:
> Previously, I could run clojure with:
>
> java -cp clojure.jar clojure.lang.Repl
>
> After building clojure.jar from a more recent SVN version (1092) that
> includes AOT and generated classes, it looks like I have to now
>
Previously, I could run clojure with:
java -cp clojure.jar clojure.lang.Repl
After building clojure.jar from a more recent SVN version (1092) that
includes AOT and generated classes, it looks like I have to now
include the generated classes in the classpath (running from trunk
directory):
java
This works for me:
(add-to-list 'load-path (expand-file-name "~/src/slime"))
(require 'slime)
(add-to-list 'load-path (expand-file-name "~/src/clojure-mode"))
(require 'clojure-auto)
(add-to-list 'load-path (expand-file-name "~/src/swank-clojure"))
(setq swank-clojure-jar-path (expand-file-name
also from Atlanta, Georgia
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED
This site provides a nice search index for those Java API docs:
http://gotapi.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
To unsub
Yes, I'd like to see *err* added too. I did my own *err* for a custom
REPL and was surprised it wasn't already part of the environment just
like *out*.
On Sep 29, 9:24 am, Thorsen Eric <[EMAIL PROTECTED]>
wrote:
> I would love to see this change as well.
>
> Eric
>
> On Sep 28, 2008, at 1:28 PM,
> What are you doing with Clojure?
I work in a fairly conservative environment where they probably
wouldn't approve of my using a language in an alpha state, much less a
variant of Lisp! But since I love the language and the interactive
environment with Emacs, I decided it's easier to beg forgive
The "Hello Servlet" post from yesterday does that.
On Aug 27, 4:56 pm, "Kevin Downey" <[EMAIL PROTECTED]> wrote:
> I am interested in using the gen-class related stuff to generate a
> class file to load and run my clojure code from a jar file. Does
> anyone have any example code for this they can
Here is a simple "hello world" servlet project that runs under
Tomcat. It may be useful to others. Note: This code works with the
20080612 Clojure release, but doesn't seem to find the doGet method
when using the current SVN release.
*** Instructions ***
1. Edit build.properties in user home to
47 matches
Mail list logo