So im trying to do some extremely simple AOT. However, when i run the
following code i get an error which i swear ive seen before but i dont
quite remember how to fix it!
(ns console.TheConsole
(:gen-class
:extends org.eclipse.ui.console.IOConsole
:constructors {[] [String
org.eclipse.jface.
I have a question. When you do a gen-class and specify incorrect
constructor arguments, is an error supposed to be produced? Currently,
in the eclipse clojure plugin, clojure silently doesn't create the
class.
(gen-class
:name "NAME"
:init init
:post-init post-init
:construct
Looking at this again, i notice that ViewPart is an abstract class.
Can we extend these ?
--~--~-~--~~~---~--~~
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
N
Im having difficulties using gen-class in some cases
(clojure.core/gen-class
:name rcp.MyView
:extends org.eclipse.ui.part.ViewPart
:prefix "MyView362" :init init)
(clojure.core/defn MyView362init [] [[] []])
(clojure.core/defn MyView362createPartControl [this parent]
(println "HI"
My environment is enclojure on netbeans. Ive compiled all of the code
for swank-clojure. However, when i call a function which produces a
certain error (in a new case, attempting to call some invalid java
method on a java object) i get the no source file thing. So im
guessing that somehow i have t
Oh, my actual question was to ask why the general NO_SOURCE_FILE would
appear and how to fix it, the specific error message was just an
example.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post
Sorry. I was just compiling everything and changing some code so it
broke. Where it actually came from is probably irrelevant, i have
gotten the phrase 'NO_SOURCE_FILE' when compiling before.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Often , i get error messages like
#http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---
Thx. That 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
Sweet! So that worked. However, even though unlikely, i would like to
avoid symbol collision. So i tried something like this
(ns ide.handlers
(:use clojure.contrib.with-ns))
(defmacro new-handler-class
[classname-sym event & body]
(let [hinted-this (with-meta 'this {:tag classname-sym})]
I just realize i wasn't putting those functions in an ns . So
(defmacro new-handler-class [n event & body]
`(do
(ns ~n
(:gen-class :extends
~'org.eclipse.ui.commands.AbstractHandler :init ~'init))
(binding [*ns* (find-ns '~n)]
(defn ~'-init [] [[][]])
(defn ~
Im attempting to create a named class inside another namespace like
this:
(ns ide.handlers
(:import [org.eclipse.ui.commands AbstractHandler]))
(defmacro new-handler-class [n event & body]
`(do
(ns ~n
(:gen-class :extends
~'org.eclipse.ui.commands.AbstractHandler :init ~'init))
Thanks. Now i know to also use doc :)
--~--~-~--~~~---~--~~
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 - plea
So i've been trying to find two equivalents to keywords in java. The
first one is synchronized. is there any syncrhonized keyword in
clojure?
More importantly, however, ive been trying to do somethign like this
(proxy [AbstractHandler] []
(execute [~var]
~...@body))
What is the equival
I would like to know if the following way is the only method to
introduce global bindings which affect a new thread one starts.
(let [global-var *global-var*]
(with-thread nil
(binding [*global-var* global-var]
)))
Just wanted to make sure there wasn't anything easier:)
--~--~--
I would like to know if the following way is the only method to
introduce global bindings which affect a new thread one starts.
(let [global-var *global-var*]
(with-thread nil
(binding [*global-var* global-var]
)))
Just wanted to make sure there wasn't anything easier:)
--~--~--
According to this thread
http://www.velocityreviews.com/forums/t142870-inputstream-and-selector.html
the channel produced from at least the InputStream of system.in is
always blocking . probably the same here. oh well...
--~--~-~--~~~---~--~~
You received this messa
So, ive been trying this out and it hasn't quite been working out.
First, im getting a inputstream from a Process. Then i'm getting a
channel from it
using Channels/newChannel. This gives me a ReadableByteChannelImpl
which claims to implemen tInterruptibleChannel
http://www.docjar.org/docs/api/jav
I was just idly wondering: even after searching google, i haven't seen
the once-only macro+clojure pop up any results. Its easy to
implement, but I was wondering if there was some reason people weren't
using this to avoid multiple evaluation in macros. Is something else
used?
--~--~-~--~-
Yep, thats exactly it. Merci!
--~--~-~--~~~---~--~~
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 pa
I'm trying to unintern a function i accidently defined in a namespace
which collides with another function i'm importing . i can't seem to
find an unintern, or undef, or anything to do this? How do i achieve
this?
Thanks~~
--~--~-~--~~~---~--~~
You received this me
Yep, dual core machine.
--~--~-~--~~~---~--~~
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
oh, and jprint is basically equivalent to print
--~--~-~--~~~---~--~~
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 modera
I'm trying to redirect the input i receive from a BufferedInputStream
to the repl. I'm trying something like this:
(defmacro with-thread [nm & body]
`(let [thread# (Thread. (fn [] (do ~...@body)))]
(if ~nm (.setName thread# ~nm))
(.start thread#)
thread#))
(defn redirect-stream [nm
I'm trying to redirect the input i receive from a BufferedInputStream
to the repl. I'm trying something like this:
(defmacro with-thread [nm & body]
`(let [thread# (Thread. (fn [] (do ~...@body)))]
(if ~nm (.setName thread# ~nm))
(.start thread#)
thread#))
(defn redirect-stream [nm
Thanks. I think now that i recall i have made that mistake before. I
must differentiate - fn and #()!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googl
So now that the future is working, I'm attempting to print from an
actual java thread. Like this
(defmacro with-thread [nm & body]
`(let [thread# (Thread. #(fn [] (do ~...@body)))]
~@(if nm `((.setName thread# ~nm)))
(.start thread#)
thread#))
(with-thread nil (println "Hasdfasd
lo, never looked at the bottom. I shall do that next time! Thanks!
--~--~-~--~~~---~--~~
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
I was wondering how to used the java keyword synchronized in clojure?
--~--~-~--~~~---~--~~
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
Hey, is there any way to separate the out view from the repl view so i
don't have to switch back and forth?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@
Thanks, this works.
--~--~-~--~~~---~--~~
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
All right, so this is probably way off topic, but what software was
used to create the clojure cheat sheet?
http://clojure.org/cheatsheet
I really like the format and would like to make one for my own
utilities so that I can actually remember what general utility
functions i have written!
--~--~--
Now that I think about it im guessing ant is used. Though if i don't
want to compile the clojure files, i guess i might be able to use
lancelet to simply define a series of loading? Perhaps...
--~--~-~--~~~---~--~~
You received this message because you are subscribe
I'm attempting to use the function future to start something in
another thread. However, in the netbeans enclojure plugin, when i type
it into the repl, it becomes non-responsive. Is this just a bug in the
enclojure plugin or would this be normal?
(future
(let [input-stream (:input-stream *li
Coming from lisp, i am used to an asdf like functionality. Recently I
have been reorganizing my code and placing all my general utilities
under one package, utils. Under it i have a file for each time of
utility, string, macro, etc. Then i have a package.clj file.
Basically, I want the user to be
That's very slick. I'm going to use this:)
--~--~-~--~~~---~--~~
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 -
Dang, you're ri ght, I didn't even notice. This is a nice feature,
separating everything. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegrou
I just tried this on the eclipse clojure repl, it works. So i guess it
is an enclojure thing! (.println System/out "HI") also doesn't work on
the netbeans repl, but does on the enclojure. I'll ask on the
enclojure mailing group. Thanks for the help!
--~--~-~--~~~---~--~
I'm not using emacs. I'm using netbeans and the enclojure plugin. What
normal clojure repl are u using?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@goog
Well, i should say, no print output occurs in the repl, which i assume
is where it is supposed to appear?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@go
Hmm.. This doesn't appear to work.
When i go
(wa-debug-make) and then
(wa-debug-print "HI") it returns
#
The agent has been logged with the value "HI", but no print output
occurs. I'm using the netbeans enclojure plugin, btw.
--~--~-~--~~~---~--~~
You received this
How am i supposed to print to the output from another thread?
I want, for example,
(future (println "HI")) to print hi. It doesn't.
Merci!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to thi
I was just wondering if there was some code walkers for clojure out
there, sort of like arnesi for common lisp. In arnesi, it would parse
all of the code into objects. A free variable would be a free-variable-
reference and a bound variable would be else, and a function form
would be an applicatio
Yes, that would work. I keep forgetting the try finally acts like
unwind-protect. Even if the thread is killed the finally process will
execute. Ehh...
On Sep 17, 5:50 pm, John Harrop wrote:
> On Thu, Sep 17, 2009 at 6:15 PM, Gorsal wrote:
> > Or maybe i could simply push to the globa
, 5:12 pm, Gorsal wrote:
> Thanks for the replies!
> Before I start doing something silly, I would like to ask another
> question. The eventual goal of all of this is to establish bindings
> which also affect the same global variable in other namespaces (these
> other namespaces wil
Thanks for the replies!
Before I start doing something silly, I would like to ask another
question. The eventual goal of all of this is to establish bindings
which also affect the same global variable in other namespaces (these
other namespaces will 100% have the same global variable). In other
wo
Oh. And just as a quick other question, do global bindings affect
threads which are started in the same ns?
Like
(binding [*global* 2]
(with-thread
(print *global*) ;;prints 2???
))
On Sep 17, 11:33 am, Gorsal wrote:
> Basically i need to redefine the meaning of a special form. Wh
Basically i need to redefine the meaning of a special form. While i am
willing to change the name for things like ns to defpackage, i am not
willing to change the name of forms like apply and defn to achieve my
goals. Instead, i would like to redefine them for my own needs. Of
course, i will be us
Ah, I thought there was a contrib out there for unwind-protect . I
guess its so trivial that no one wrote it. lol.
On Sep 15, 12:25 pm, Joost wrote:
> On 15 sep, 18:19, Jarkko Oranen wrote:
>
> > Unwind-protect? Isn't that a Common Lisp thing? Sounds like you got
> > the wrong mailing list :)
>
I was just wondering about the unwind-protect form, I've heard that it
doesn't protect against certain types of exits, but what exactly are
these exits? I've heard return, break, and continue statements said
but i can't seem to find these statements in clojure. Any examples?
--~--~-~--~---
Hello !
I need to rewrite a swank implementation which is in java for the Cusp
plugin. Looking around, I saw swank-clojure. I thought i would ask
more knowledgeable people than me whether it is what i'm looking for
(crosses fingers!).
(1) The plugin currently starts a lisp implementation and load
Hello. I'm trying to use (class String) to get the class object for
the String class. However, nomatter what class typ ei pass, i always
get java.lang.Class back. Is this the way its supposed to work?
Thx!
--~--~-~--~~~---~--~~
You received this message because yo
ons of
> the functions, as well as the body.")
>
> Your maybe doing a similar error in other parts of the code where the
> implementation detail are closer to the public API, and that may explain
> your error ?
>
> 2009/9/8 Gorsal
>
>
>
> > # > (G__1852 2)
(set! *print-level* 8) ;;so you can see all of macroexpand-1
;;MISC Utilities
;;
;;
(defn mklst [item] (if (list? item) item (list item)))
(defn lassoc [item lst]
(first (filter #(= (first (mklst %)) item) lst)))
(defmacro llet [bind & body]
`(let ~(vec
(mapcat #(if-no
#
So, I'm porting Paul Grahm's condlet macro to clojure. I've done it
except when i evaluate it it gives me the above error. However, when I
macroexpand-1 it it evaluates fine.
The only difference between evaluating the macroexpansion vs the other
way is that the (gensym) vars are now regular var
(script.env/def-ns script.ParenMatcher
(:gen-class
:implements [org.eclipse.jface.text.source.ICharacterPairMatcher]
:state state
:init init
:methods [[setPainter
[org.eclipse.jface.text.source.MatchingCharacterPainter] void]])
(:use script.genutils)
(:import
(org.eclipse
Heh, I've always wanted one of these. Anyways, I think that instead of
emulating loop , you should try to somewhat emulate iterate. You would
need a code walker, though, because you probably wouldn't want to use
brackets for all the special case loop constructs. Is there one for
clojure? I don't k
I am trying to add clojure code to an eclipse plugin. To do so, the
code i compiled into class files via the clojure-dev plugin. I have a
generate class, ParenMatcher, which i use ever so often. This class
has a function which i would like to change dynamically while
debugging it. In other words,
Hello! I was just wandering if it was possible to import all from a
java package . For example, in java i can do
import org.eclipse.jface.text.*;
And i can use IDocument, which is contained under
org.eclipse.jface.text.IDocument;
In clojure, I try
(ns ParenMatcher
(:gen-class
:implements
59 matches
Mail list logo