gen-class can emit static methods, but one cannot leverage its
functionality at runtime.
But since compile-time is also a kind of runtime in Clojure, shouldnt't you
be able to dynamically create an appropriate .clj file with the ns form and
main- form, and have it compiled?
--
--
You
On Sunday, March 17, 2013 6:02:07 AM UTC+1, vemv wrote:
Ahhh I tracked it down - the class was not public. I thought .java files
had to define at least (and at most) *one* public class/enum/interface.
How much sense can it make to define a private class in its own file? :(
It makes perfect
Yeah I guess it could work, did you have in mind something like
programmatically running `lein compile`?
Can the JVM handle .class files written on the fly?
Anyway, for my particular problem I don't need runtime-compiled static
methods anymore.
On Sun, Mar 17, 2013 at 7:34 AM, Marko Topolnik
I need the ability to create one of a number of java classes which have
constructors taking a known list of parameters. There are a large enough
number of classes that having a set of conditions testing for each class
name would be unmanageable. The classes are from a third-party jar file so
I
Hello, everyone. I'm writing some code that utilizes the lazy sequence. But
I found something strange. Here is how:
The code is like:
(first (filter some-expensive-io urls))
The code is aimed to find the first result of the operations on the urls
that is not nil. However, it seems that the io
I'd guess that what you're seeing is related to chunked
sequences: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/
.
On Sunday, March 17, 2013 1:12:17 AM UTC-7, bruce li wrote:
Hello, everyone. I'm writing some code that utilizes the lazy sequence.
But I found something
You can make the clojure class loader by yourself:
(import '(clojure.lang RT))
(def class-loader (RT/makeClassLoader))
user= (.loadClass class-loader user.Foo)
user.Foo
2013/3/17 vemv v...@vemv.net
Most definitely :) But that something is hard/confusing should'nt be
enough reason to give
On Sunday, March 17, 2013 8:31:24 AM UTC+1, vemv wrote:
Yeah I guess it could work, did you have in mind something like
programmatically running `lein compile`?
Yes, just about, but even simpler: you just call *compile*, *load, load-file
* or similar while binding *compile-files* to true
Yep,it's chunked sequence,just like batch processing.
You can use the seq1 function in fogus blog.
2013/3/17 Evan Mezeske emeze...@gmail.com
I'd guess that what you're seeing is related to chunked sequences:
http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/ .
On Sunday,
This is one of the most frequenly-asked questions and a source of surprise
to practically every new Clojure user. An update to the official
documentation on lazy sequences would surely help a lot here.
-marko
On Sunday, March 17, 2013 9:18:05 AM UTC+1, Evan Mezeske wrote:
I'd guess that what
No built-in Java mechanism (such as Class/forName) relies on the context
classloader, that's just a mechanism that was supposed to help other
frameworks manage class loading. Every such framework would have to
explicitly getContextClassLoader to use it.
On Sunday, March 17, 2013 4:05:51 AM
Great! Many thanks.
Dave
On Sunday, 17 March 2013 08:18:27 UTC, dennis wrote:
Sorry,it's getDeclaredConstructor:
(- klassname (Class/forName) (. getDeclaredConstructor String int)
(.newInstance host port))
2013/3/17 dennis zhuang killm...@gmail.com javascript:
You can get the
Ah, it works. It is really chunked sequences. Thanks.
Having been using clojure for half a year, it keeps really bringing me
surprise and fun :)
2013/3/17 Marko Topolnik marko.topol...@gmail.com
This is one of the most frequenly-asked questions and a source of surprise
to practically every
There's the alternative signature Class.forName(String, boolean,
ClassLoader). I got the Java side to use that instead of a plain
Class.forName, passing it a custom ClassLoader (see my immediately previous
reply).
On Sun, Mar 17, 2013 at 12:38 PM, Marko Topolnik
marko.topol...@gmail.comwrote:
I have been doing stuff like (str type-as-keyword) to push values into HTML
forms, which leaves me with a string like :cities when the HTML forms are
submitted. I might fetch them like:
(let [this-item (get-in request [:params answers]))
If I then do:
this-item-as-keyword (keyword
On 17/03/13 18:42, larry google groups wrote:
(st/replace (str (:name item)) #: )
#(apply str (next %))
Jim
--
--
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
Use read-string.
user (read-string :cities)
:cities
On Sunday, 17 March 2013 14:42:38 UTC-4, larry google groups wrote:
I have been doing stuff like (str type-as-keyword) to push values into
HTML forms, which leaves me with a string like :cities when the HTML
forms are submitted. I might
aaa of course, if you do want to *read* the keyword in, use
read-string...there is no point in getting rid of the ':' and then
essentially re-inserting it!
Jim
On 17/03/13 18:51, JvJ wrote:
Use read-string.
user (read-string :cities)
:cities
On Sunday, 17 March 2013 14:42:38 UTC-4, larry
2013/3/17 JvJ kfjwhee...@gmail.com
Use read-string.
user (read-string :cities)
:cities
And if the input may be coming from untrusted sources, please use
clojure.edn/read-string
(Clojure 1.5+).
--
MK
http://github.com/michaelklishin
http://twitter.com/michaelklishin
--
--
You received
I'm happy to announce the release of core.logic 0.8.0. There are far too
changes, bug fixes, and enhancements to cover here. For the most part the
miniKanren portion of core.logic has been left unchanged from the
standpoint of the user. The biggest change is the inclusion of extensible
constraint
On Mar 16, 2013, at 9:24 PM, Rich Morin r...@cfcl.com wrote:
The cost of a taxi from Portland Intl. Airport (PDX)
to the Clojure/West hotel (Courtyard by Marriott) is
listed (by the hotel) as about $35 one way.
To save money, you can take the (TriMet) light rail:
* Walk to the Portland
Done!
On Sun, Mar 17, 2013 at 4:49 PM, Darrick Wiebe d...@xnlogic.com wrote:
On Friday, 1 March 2013 11:41:26 UTC-8, David Nolen wrote:
Now that Clojure 1.5.0 is out the door I'd like to make ClojureScript
depend on it. This would allow me to merge in the source map branch which
is a work
I'm having this problem again.
I start the repl with nrepl-jack-in. Also starting it on the command line
with 'lein repl' shows the same problem.
What is causing the JVM to lose the default locale settings (at least in
regard to number formatting)?
Thanks.
On Sunday, March 10, 2013 12:39:57
Thanks all. read-string seems obvious now that you all suggest it.
On Sunday, March 17, 2013 3:01:14 PM UTC-4, Michael Klishin wrote:
2013/3/17 JvJ kfjwh...@gmail.com javascript:
Use read-string.
user (read-string :cities)
:cities
And if the input may be coming from untrusted
It seems like 1.7 changed how default Locales are read from the host:
http://stackoverflow.com/questions/7107972/java-7-default-locale
http://blog.ej-technologies.com/2011/12/default-locale-changes-in-java-7.html
On Sunday, March 17, 2013 10:40:19 PM UTC, dabd wrote:
I'm having this problem
Python has a notation for raw strings
Python also has multiple inheritance :) what I want to mean is that some
features have dubious value, regardless of whether they made it to language
X or Y.
I'm working on a project right now where the lack of raw strings is
killing me.
Do
Hot on the heels of 0.8.0, 0.8.1! This is mostly to push out some nice
catches from Jonas Enlund (who works on the Clojure linter Kibit). One cool
addition is that featurec is now recursive so you can constrain extract
features of out nested maps with ease.
This is epic, and a long time coming! Thanks for the hard work David and
congrats to the other contributors, especially Nada and Jonas!
Thanks,
Ambrose
On Mon, Mar 18, 2013 at 3:50 AM, David Nolen dnolen.li...@gmail.com wrote:
I'm happy to announce the release of core.logic 0.8.0. There are
Hi
I'm happy to announce the first release of termito[1]. Termito is a term
rewriting library inspired by the kibit rule system. With termito you can
write declarative term rewriting rules like
(defrules zero-rules
[(* 0 ?x) 0])
(defrules identity-rules
[(* 1 ?x) ?x]
On Sun, Mar 17, 2013 at 6:07 PM, vemv v...@vemv.net wrote:
Reading a raw string stored in a file is already trivial :)
I'm aware that one can store a raw string in a file. But in many
instances, this would be absurd. For the kind of rapid interactive
development we have in Clojure, we don't
30 matches
Mail list logo