Hi Gregg,
Gregg Williams writes:
> (ns genclassInteger
> (:gen-class
>:extends [java.lang.Integer])
> ;(:import (java.lang Integer)) ; < unnecessary, right?
> )
> -
>
> This returns the error:
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> [java/lang/
Gregg Williams writes:
> Now I'm working on
> the "Graph Editor" program described at
> http://www.piccolo2d.org/learn/grapheditor.html
> .
>
> In this sample program (which you don't really need to look at) I need
> to subclass a Piccolo2D class to create a class named GraphEditor ,
> but unlik
Windows 7
jre 1.6
command mode
error on getting started jline
C:\clojure-1.1.0>dir
Volume in drive C has no label.
Volume Serial Number is 303A-A5FF
Directory of C:\clojure-1.1.0
28.04.2010. 10:43 .
28.04.2010. 10:43 ..
28.04.2010. 10:2877 .gitign
On Apr 27, 7:45 pm, Sean Devlin wrote:
> However, there are still problems
> that require me to use an expensive operation.
Could you give an example of such a problem? There may be another way
of solving it you have not considered.
- James
--
You received this message because you are subscrib
On Apr 28, 5:00 am, Richard Newman wrote:
> Opinions, thoughts, critiques, "you're insane"s, etc. welcome.
The patches look fine to me and the change is well justified since you
have a real use case. I don't think restricting deftype to final
classes would serve any real purpose. I'd just go a
On Apr 27, 10:00 pm, Richard Newman wrote:
> Further to IRC conversations:
>
> I'm attempting to generate a JAX-WS service using Clojure. The main
> stumbling block was annotations; that's been removed, so I gave it a
> shot using deftype.
>
> My first strike works code-wise, so I sent it to
On Apr 27, 2010, at 2:45 PM, Sean Devlin wrote:
You're right, inserting into a vector is fundamentally slow.
Inserting into a list (must traverse elements) or String (Char Array)
isn't any better. I get why Clojure doesn't include certain
operations on certain data structures (e.g. assoc on a
Hi,
I wrote this code to redirect a repl to a JFrame.
I used the JConsole class from Beanshell
(def console (bsh.util.JConsole.))
(def frame (doto (javax.swing.JFrame.) (.add console) (.setSize 500
500) (.setVisible true) ))
(binding [*out* (java.io.OutputStreamWriter. (.getOut console))]
Can someone explain to me why this doesn't work:
(let [ p "Bill/"
sep (System/getProperty "file.separator")
]
(if (= (last p) sep)
(println "found separator")
(println "no separator")
)
The (= (last p) sep) always returns false. If I print
On Wed, Apr 28, 2010 at 9:30 AM, WoodHacker wrote:
> Can someone explain to me why this doesn't work:
>
> (let [ p "Bill/"
> sep (System/getProperty "file.separator")
> ]
>
> (if (= (last p) sep)
> (println "found separator")
> (println "no separator
On Apr 28, 4:30 pm, WoodHacker wrote:
> Can someone explain to me why this doesn't work:
>
> (let [ p "Bill/"
> sep (System/getProperty "file.separator")
> ]
>
> (if (= (last p) sep)
> (println "found separator")
> (println "no separator")
>
Hi,
On 28 Apr., 01:52, SpiderPig wrote:
> (.start (Thread. #(clojure.main/repl
bindings are thread-local. So your in/out bindings are not
valid in the new thread. Try the following:
(.start (Thread. (bound-fn [] (clojure.main/repl)))
Sincerely
Meikel
--
You received this message be
(last p) returns a char \/
(first p) returns \B)
so, use (= (str (last p)) sep)
-Rgds, Adrian.
On Wed, Apr 28, 2010 at 3:30 PM, WoodHacker wrote:
> Can someone explain to me why this doesn't work:
>
> (let [ p "Bill/"
> sep (System/getProperty "file.separator")
> ]
>
>
Depending on what you're trying to do with paths, you may want to construct
File objects and then get the paths from them. For example,
(let [home (File. "/Users/Bill")
bashrc (File . home ".bashrc")]
(.getPath bashrc))
I think that tends to be less cumbersome than stringing path compo
On Tue, Apr 27, 2010 at 10:21 AM, Miki wrote:
> Hello Andrew,
>
>> So, for people like me, can any of you suggest some transcribed
>> lectures, screencasts, books, blog posts, or other errata that discuss
>> the difference between program design in a language like Clojure and
>> an OO language lik
On Apr 28, 4:56 am, Marko Srepfler wrote:
> C:\clojure-1.1.0>java -cp jline-0.9.91.jar:clojure.jar
You need to separate your classpath entries with a semicolon, not a
colon.
- Chris Perkins
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to
On Apr 26, 5:25 pm, David McNeil wrote:
> I am experimenting with clojure.test and I encountered the following
> situation which I cannot explain.
>
> This code:
>
> (println (do
> (ns ns01
> (:use clojure.test))
> (deftest test1 nil)
> (run-tests)))
>
Brian,
Thanks for getting back to me :-)
I look forward to your changes making it into the mainline.
I'm going to register with Assembla and watch this ticket. If I find a
way to vote for it, I will do.
Jules
On Apr 27, 3:59 pm, Brian Hurt wrote:
> On Tue, Apr 27, 2010 at 9:10 AM, Jules wro
What are you going to do about:
default public constructor?
The JAX-WS tools don't really care if javac generates a default
constructor or if Clojure does. The deftype constructor with no fields
defined is:
public com.example.FooBarService();
which -- assuming it calls super() and ini
Hello,
What is the best way to read a property file in a path independent
way? I would like to be able to read the file and this regardless of
where my clojure program is called from (this must also work if my
program is bundled as a jar).
clojure.contrib.java-utils/read-properties is nice but it
On Wed, Apr 28, 2010 at 10:01 AM, K. wrote:
> I did try with ClassLoader/getSystemResourceAsStream :
>
> However this breaks with "lein swank" since lein swank uses its own
> classloader.
The problem with this is that it's using the System classloader. Try
using the thread's classloader:
(into {
Defining CLR2 in release on the new2 branch allowed me to compile
without issue.
I still have the several second delay, and from what little I kind
find around I suppose that is typical. Is that correct? Is there any
way to bring that down?
Thank you,
Joerthan
On Apr 23, 9:45 pm, dmiller wrote:
Several clojure.contrib.seq/seq-utils functions have been promoted
(with some modification) to clojure.core.
Here's the super-terse summary from the code comment:
;; moved to clojure.core: flatten, partition-all, frequencies,
;; reductions, shuffle, partition-by
;;
After review, several seq functions from clojure-contrib have been
promoted to clojure [1], [2], [3]. Hopefully the FAQ below will answer
the major questions you may have:
1. Is this a breaking change to Clojure?
No. Rich is super-careful to grow Clojure by expansion, not by
breaking change
On 2010 Apr 28, at 4:31 PM, Stuart Halloway wrote:
After review, several seq functions from clojure-contrib have been
promoted to clojure [1], [2], [3]. Hopefully the FAQ below will
answer the major questions you may have:
Cool!
3. Why did some of the fn names change?
...Similarly, includ
Hi,
On Wed, Apr 28, 2010 at 05:06:21PM -0400, Douglas Philips wrote:
> Wait, what? Why should seq-contains? be slower than contains? Isn't
> this exactly the kind of thing that protocols are supposed to be
> solving? Your nice video showed that very thing, right?
If you have a map or a set looki
On 2010 Apr 28, at 5:14 PM, Meikel Brandmeyer wrote:
If you have a map or a set looking up a key is fast. So contains? is
fast (read O(1) resp. something like O(log32 N)). seq-contains? does
a linear search through a sequence. That is O(N). Protocols cannot
change this.
How is having an optimiz
Hi,
On Wed, Apr 28, 2010 at 05:26:46PM -0400, Douglas Philips wrote:
> How is having an optimized version of seq-contains? for sets/maps
> any different from what Stuart showed in his video, where reduce can
> have a specialization that is faster on some types?
A faster reduce is still O(N). If
I have a Java API that retrieves "pages" of data from a database: you
specify the page number and the page size, it it retrieves row numbers
page-number*page_size through (page-number+1)*page_size - 1. I'd
like to construct a lazy sequence that gets its data using that Java
API. I'm using Clojur
On 2010 Apr 28, at 5:32 PM, Meikel Brandmeyer wrote:
On Wed, Apr 28, 2010 at 05:26:46PM -0400, Douglas Philips wrote:
How is having an optimized version of seq-contains? for sets/maps
any different from what Stuart showed in his video, where reduce can
have a specialization that is faster on so
(defn pages
([src size] (pages src 0 size))
([src start size]
(lazy-seq
(if-let [page (.getPage src start size)]
(cons page (pages src (inc start) size))
On Apr 28, 2:38 pm, ".Bill Smith" wrote:
> I have a Java API that retrieves "pages" of data from a database: you
> sp
Hi,
On Wed, Apr 28, 2010 at 05:39:37PM -0400, Douglas Philips wrote:
> Stuart's comment was to not use seq-contains? on maps or sets.
> There is no reason that it cannot be the same speed as contains? if
> a set or map is passed in.
Ah, ok. I misunderstood what you were saying. But I think it do
The "seq" in "seq-contains?" says "I want a sequential search."
Protocols *could* make this do something different, but that would
violate the contract of this function.
Another way to put it: If you wrote a protocol to pick a fast
implementation based on type, then seq-contains? would be t
On 2010 Apr 28, at 6:10 PM, Stuart Halloway wrote:
The "seq" in "seq-contains?" says "I want a sequential search."
Protocols *could* make this do something different, but that would
violate the contract of this function.
How would having it work faster if passed a set or map violate that?
Another way to put it: If you wrote a protocol to pick a fast
implementation based on type, then seq-contains? would be the fn
that the protocol would call if it couldn't find anything faster.
There have to be primitive things somewhere...
If so, then why isn't there a vector-first and a li
On 2010 Apr 28, at 6:55 PM, Stuart Halloway wrote:
Specializations are available where there is a clear use case, e.g.
contains?, peek (instead of last), disj, etc.
...
Tying to concrete types is limiting. *Never* having special purpose
fns that know about performance characteristics is also
On 2010 Apr 28, at 6:06 PM, Meikel Brandmeyer wrote:
Ah, ok. I misunderstood what you were saying. But I think it doesn't
change the argumentation. If seq-contains? was fast on maps and sets,
people would abandon contains? because seq-contains? is "always
right":
works on seqs, fast on maps and
On Wed, Apr 28, 2010 at 2:39 PM, Douglas Philips wrote:
> If some function I call uses seq-contains? (so that it can get all the
> wonderful seq-ness abstractness clojure offers) I should have to know that
> internal detail and not pass in a map or set? or worse, fail to get an
> optimization i
Unfortunately, group-by is a commonly used function name, used in both
Incanter and swank-clojure. I've renamed Incanter's group-by to group-
on, but the naming conflict of clojure.core/group-by and swank-
clojure.util/group-by is preventing swank from starting up using
either lein swank or the swa
Wow, and I thought this was a sore subject before, when there was no
seq-contains? and its absence was always a Top 5 FAQ. :-)
I'll wait for Rich to maybe chime in on seq-contains?. Other than seq-
contains? are people liking the new fns? Anybody having issues we
didn't anticipate?
Stu
O
On Wed, Apr 28, 2010 at 4:43 PM, liebke wrote:
> Unfortunately, group-by is a commonly used function name, used in both
> Incanter and swank-clojure. I've renamed Incanter's group-by to group-
> on, but the naming conflict of clojure.core/group-by and swank-
> clojure.util/group-by is preventing s
One option is to configure lein to use a specific timestamp instead of
snapshot. Then you can back off the edge a little.
Stu
Unfortunately, group-by is a commonly used function name, used in both
Incanter and swank-clojure. I've renamed Incanter's group-by to group-
on, but the naming confli
On Wed, Apr 28, 2010 at 4:50 PM, Stuart Halloway
wrote:
> One option is to configure lein to use a specific timestamp instead of
> snapshot. Then you can back off the edge a little.
Yeah, using Clojure version "1.2.0-master-20100426.160114-46" would
allow you to hold off on bringing in the change
On Apr 28, 2010, at 6:38 PM, Mark Engelberg wrote:
> 2. Rename contains? to contains-key? and make a function with the new
> semantics called contains? Disadvantage - breaks existing code.
You could also alias contains? to contains-key?, use seq-contains? (or some
other new name) for this new
You're brave being on the new2 branch. It's pretty raw development in
there. The current commit is okay, I try to mark the interim ones.
Yes, the CLR2 symbol needs to be defined. That flag became necessary
when they made some incompatible namespace changes in the DLR to
accommodate CLR 2 verus C
On Apr 28, 7:17 pm, Douglas Philips wrote:
> On 2010 Apr 28, at 6:55 PM, Stuart Halloway wrote:
>
> > Specializations are available where there is a clear use case, e.g.
> > contains?, peek (instead of last), disj, etc.
> ...
> > Tying to concrete types is limiting. *Never* having special purpo
Thanks Alex.
On Apr 28, 4:55 pm, ataggart wrote:
> (defn pages
> ([src size] (pages src 0 size))
> ([src start size]
> (lazy-seq
> (if-let [page (.getPage src start size)]
> (cons page (pages src (inc start) size))
>
> On Apr 28, 2:38 pm, ".Bill Smith" wrote:
>
>
>
> >
On 2010 Apr 28, at 7:38 PM, Mark Engelberg wrote:
But I think you're not fully appreciating the complexity of the
situation. This is not just about performance, but a question of two
different possible semantics for "contains?", which is why it can't
*only* be addressed with a protocol.
...
Hi,
On 29 Apr., 01:38, Mark Engelberg wrote:
> 1. Don't include seq-contains? The behavior you want can usually be
> achieved by using (some #{item} coll). Disadvantage - if you're
> testing to see if the collection contains nil, that won't work.
Not entirely correct. (some #(= % item) coll)
On 2010 Apr 28, at 11:04 PM, Rich Hickey wrote:
It is an important aspect of Clojure that, in general, performance
guarantees are part of the semantics of functions. In particular,
functions are not supported on data structures where they are not
performant.
Understood. That isn't the poin
Hi,
On 29 Apr., 01:43, Stuart Halloway wrote:
> I'll wait for Rich to maybe chime in on seq-contains?. Other than seq-
> contains? are people liking the new fns? Anybody having issues we
> didn't anticipate?
I was a little bit surprised about map-indexed and keep-indexed.
Why specialised func
Same error
I think the problem is that jline extract dll and load, probably
Windows 7 security dont allow this,
on windows 7 x64 with 64 bit java says error in jline.dll
C:\clojure>java -cp jline-0.9.91.jar;clojure.jar jline.ConsoleRunner
clojure.mai
n
Exception in thread "main" java.lang.ClassNot
On Wed, Apr 28, 2010 at 10:49 PM, Douglas Philips wrote:
> What is the purpose, goal, design-rationale of not making seq-contains? fast
> on maps or sets?
I think Rich's point is that if seq-contains? is sometimes fast and
sometimes slow, then it makes it harder to reason about a program that
use
53 matches
Mail list logo