On 30/04/2010, at 3:46 PM, Gregg Williams wrote:
> Have you ever wanted to abandon a simple program with a bug that has
> been DRIVING YOU CRAZY because it's just got to be something SO
> simple, you'd be embarrassed to admit that you didn't see WHAT WAS
> STARING YOU IN THE FACE all along? Well,
Have you ever wanted to abandon a simple program with a bug that has
been DRIVING YOU CRAZY because it's just got to be something SO
simple, you'd be embarrassed to admit that you didn't see WHAT WAS
STARING YOU IN THE FACE all along? Well, this is mine:
(ns org.InfoML.genclassObject
(:gen-class
On Apr 29, 10:43 pm, David Nolen wrote:
> My rule of thumb is:
>
> use + :only
> require + :as
(inc *1)
--
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
leiningen reinstalled with self-install
labrepl cloned and lein deps run without any hickups
laprepl starts up with the following error and localhost:8080 does not
respond
kl...@feersum:~/projects/labrepl$ script/repl
Clojure 1.2.0-master-SNAPSHOT
java.lang.ExceptionInInitializerError (control.c
On Fri, Apr 30, 2010 at 1:32 AM, gary ng wrote:
>
>
> On Thu, Apr 29, 2010 at 9:11 PM, Meikel Brandmeyer wrote:
>
>>
>> c.c.string is not designed to be used like that. Use require plus an
>> alias: (require '[clojure.contrib.string :as s]). Then repeat is the
>> core repeat and s/repeat is the
On Thu, Apr 29, 2010 at 9:11 PM, Meikel Brandmeyer wrote:
>
> c.c.string is not designed to be used like that. Use require plus an
> alias: (require '[clojure.contrib.string :as s]). Then repeat is the
> core repeat and s/repeat is the string repeat.
>
> What would be the use case of 'use' then ?
Hi,
On Thu, Apr 29, 2010 at 08:32:12PM -0700, gary ng wrote:
> thanks. Though I found this behavior a bit annoying. What seems to be
> happening is that I need to exclude all the symbols that is excluded by
> c.c.string again if I use 'use ...' why would 'repeat' all of a sudden
> appear again if
On Thu, Apr 29, 2010 at 7:24 PM, ataggart wrote:
> user=> (defn repeat [x] x)
> java.lang.Exception: Name conflict, can't def repeat because
> namespace: user refers to:#'clojure.core/repeat (NO_SOURCE_FILE:1)
> user=> (ns my.ns (:refer-clojure :exclude [repeat]))
> nil
> my.ns=> (defn repeat [x]
Hi Matt,
Matt Culbreth writes:
> I'm using slurp to read data from a file and send it to a stream, but
> sometimes that's failing. I've got a theory that it has to do with
> slurp not reading binary data correctly. Is that true? Do I need to
> go down to the lower level Java classes and build
Hi,
On Fri, Apr 30, 2010 at 10:30, Matt Culbreth wrote:
> I'm using slurp to read data from a file and send it to a stream, but
> sometimes that's failing. I've got a theory that it has to do with
> slurp not reading binary data correctly. Is that true? Do I need to
> go down to the lower leve
Howdy,
I'm writing a very simple network server that needs to send a mix of
text and binary (usually image) data over a network stream.
I'm using slurp to read data from a file and send it to a stream, but
sometimes that's failing. I've got a theory that it has to do with
slurp not reading binar
user=> (defn repeat [x] x)
java.lang.Exception: Name conflict, can't def repeat because
namespace: user refers to:#'clojure.core/repeat (NO_SOURCE_FILE:1)
user=> (ns my.ns (:refer-clojure :exclude [repeat]))
nil
my.ns=> (defn repeat [x] x)
#'my.ns/repeat
On Apr 29, 6:08 pm, gary ng wrote:
> Cloj
Clojure 1.2.0-master-SNAPSHOT
user=> (use `clojure.contrib.string)
java.lang.IllegalStateException: repeat already refers to:
#'clojure.core/repeat
in namespace: user (NO_SOURCE_FILE:0)
By going through the source, I see c.c.s deliberately exclude certain
symbols but don't know how to do it in th
Hi,
On 29 Apr., 14:10, Stuart Halloway wrote:
> "In theory, you may be right about 'contains?.' In practice, Rich
> Hickey is right." - Stu Halloway. :-)
probably a little off-topic, but to me the most irritating thing about
contains? is, that it just returns nil (RT/F, that is) for lists. Th
Iterating through the pairs is useful. Asking if a given [k, v] is
included is not - you can just ask if (= (assoc k) v) instead.
It'd be nice if (contains-val) returned the key(s) as its true result,
but probably not useful enough to warrant the complexity of dealing
with false keys, explicit tr
> +1. I can't imagine any use case for looking up a whole [key, value] pair in
> a hash-map.
Actually this is quite useful when you want to do something for each
value and need to know the key as well - for example copy some
key/value pairs to another map
Boris
>
> --
> You received this message
Right...
Is there a way to force an agent thread to be evaluated in a certain
namespace?
You see, the current design accepts a string, and uses read-string to
parse it. i.e. I call a form like this a lot
(send test-query conj (read-string (get-input)))
Sean
On Apr 29, 4:40 pm, Laurent PETIT wr
On Apr 29, 2010, at 15:10 , Stuart Halloway wrote:
> "In theory, there is no difference between theory and practice. In practice,
> there is." -Yogi Berra (maybe).
...
> Also, AFAICT, there are *no* examples of using instance checks to select the
> right containment function. So the theoretical
Hello Sean,
You want
(def test-query
(agent
`[test-coll
(take 2)]))
to fully qualify test-coll (and also take, btw) because when passed to
eval on the agent's thread, who knows to which value *ns* will be
bound ?
(tested on my machine)
HTH,
--
Laurent
2010/4/29 Sean Devlin :
> I'm havi
On Apr 28, 10:06 pm, dmiller wrote:
> Startup times have crept up slowly with some of the recent changes in
> the compiler. I have a plan to simplify the loading process. I've
> been avoiding making too many ancillary changes in the compiler while
> I've been porting all the compiler changes th
I'm having a lot of trouble getting an app to work. I'm using agents
in a GUI app. For the sake of discussion I've got the following
things defined:
(def test-coll
[{:a 1 :b 2 :c 3}
{:a 4 :b 5 :c 6}
{:a 7 :b 8 :c 9}
{:a 10 :b 11 :c 12}
])
(def test-query
(agent
'[test-coll
> The REPL switches to the namespace ns-1 and the var my-namespace is in
> user !
I don't see that with CLJ 1.2 on Windows:
user=> (do (ns ns-1) (def my-namespace *ns*) my-namespace)
#
ns-1=> (ns user)
nil
user=> (println (do (ns ns-1) (def my-namespace *ns*) my-namespace))
#
nil
ns-1=> (var my-n
I think names such as vector and hash-map are ok precisely because
they are such fundamental types, and bindings typically use one-char
names; brevity matters. (And vec is just a special case of vector)
I'm not sure if there's some deeper nuance in the naming between the
make-* and create-* funct
Hi,
On Thu, Apr 29, 2010 at 12:09:06PM -0700, Gregg Williams wrote:
> Re: subclassing: Unless I'm missing something, I still want to
> subclass PCanvas because the class adds another method, updateEdge,
> which gets called within the drag event handler.
Maybe you can make it a normal clojure fun
Alex, thanks for your two posts and for taking the time to look at the
original source code. Some comments:
Re: Integer being final. Actually, I remembered that...and then
forgot. Tired? Clueless? You decide.
I'm going to fold your observations into a new test program to see
what happens; thanks.
On Apr 29, 9:57 am, Stuart Halloway wrote:
> Agreed: Rich's explanation is the more important bit.
>
> My point is that we may be wasting time arguing about something that
> nobody actually does. If idiomatic usage changes as the community
> grows, we *could* add a collection-generic contain
On Apr 29, 4:21 am, ataggart wrote:
> I know it won't matter, but for posterity if nothing else...
>
> Functions named contains-key? and contains-val? would make a lot more
> sense to me than the current contains? and new seq-contains?. Anyone
> looking at contains-val? should expect it to be O
On Apr 29, 2010, at 3:21 AM, ataggart wrote:
> I know it won't matter, but for posterity if nothing else...
>
> Functions named contains-key? and contains-val? would make a lot more
> sense to me than the current contains? and new seq-contains?. Anyone
> looking at contains-val? should expect it
Hi,
On 29 Apr., 15:34, Douglas Philips wrote:
> > did you also check some? I would use (some #{item} coll)
> > or (some #(= % item) coll) from core instead of sucking in
> > 3.5Mb contrib for includes?.
>
> Isn't your real beef/bug-report here that you won't use a meaning/
> intention conveying
Hello, interesting. Is this a bug??
Somehow the println seems to do strange things here.
If I evaluate in namespace user
(do
(ns ns-1)
(def my-namespace *ns*)
my-namespace)
The REPL switches to the namespace ns-1 and the var my-namespace is in
ns-1
If I evaluate in namespace user
(print
(send contains-val? inc)
On Apr 29, 9:06 am, Douglas Philips wrote:
> On 2010 Apr 29, at 4:21 AM, ataggart wrote:
>
> > Functions named contains-key? and contains-val? would make a lot more
> > sense to me than the current contains? and new seq-contains?. Anyone
> > looking at contains-val? shou
The final proposition in the other thread to rename contains? into
contains-key? and seq-contains? into contains-val? seems good, no ?
Don't you think they are better names ? (contains-key? indicates more
clearly that the coll is viewed as an associative thing ;
contains-val? implies it will work w
On Apr 29, 5:10 am, Stuart Halloway wrote:
> (There are a few calls to seq-contains? in the test suite for contrib,
> and I wrote all of them. If you write lots of unit tests you already
> know why such calls make sense there.)
For those of us who are newbies, would you mind being more expli
On Apr 29, 2:17 am, Mark Engelberg wrote:
> 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, th
Agreed: Rich's explanation is the more important bit.
My point is that we may be wasting time arguing about something that
nobody actually does. If idiomatic usage changes as the community
grows, we *could* add a collection-generic contains.
While I have no position on seq-contains?, I ques
On 2010 Apr 29, at 8:27 AM, Meikel Brandmeyer wrote:
did you also check some? I would use (some #{item} coll)
or (some #(= % item) coll) from core instead of sucking in
3.5Mb contrib for includes?.
Odd, isn't it, that there is a special function zero? when everyone
could just use #(= 0 %)
May
Beautiful! That is definitely it. I produce many many very big bignums in this
application.
Thanks so much!
-Lee
PS I noticed after I sent this that the subject line was wrong -- the error
wasn't from rand-int, it was from my avoiding rand-int. Clojure's rand-int does
the right thing.
On A
java -cp clojure.jar clojure.main
works nice on windows 7
On Apr 29, 3:03 pm, Chris Perkins wrote:
> On Apr 29, 2:05 am, Marko Srepfler wrote:
>
> > Same error
> > C:\clojure>java -cp jline-0.9.91.jar;clojure.jar jline.ConsoleRunner
> > clojure.main
> > Exception in thread "main" java.lang.Cla
On 23 April 2010 12:21, joshua-choi wrote:
> When it comes to naming factory functions—functions that create things—
> clojure.core gives four precedents:
>
> 1. Name it exactly what the new object is called. vector, hash-map,
> set.
> 2. Name it a shortened version of #1. vec.
> 3. Prefix #1 wit
On 2010 Apr 29, at 7:52 AM, Laurent PETIT wrote:
2010/4/29 Mark J. Reed :
I like this proposal. I'd make contains? an alias for contains-key?
with a deprecation warning, and just forget about seq-contains? in
favor of contains-val?
This makes a lot of sense to me.
(and have, as suggested by a
While I have no position on seq-contains?, I question this methodology, which
I've seen a few times now. It's early days for Clojure, you're sampling a very
small codebase, and there may be as yet unforseen idiomatic uses (such as you
point out for testing) which invalidates this argument. In ad
On 2010 Apr 29, at 4:21 AM, ataggart wrote:
Functions named contains-key? and contains-val? would make a lot more
sense to me than the current contains? and new seq-contains?. Anyone
looking at contains-val? should expect it to be O(n). The only
effective difference would be that the test value
On 24 April 2010 10:06, Rich Hickey wrote:
> I've started adding some support for Java annotations,
> Feedback welcome
Neato! I've been hoping for this - thanks :)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email t
On Apr 29, 2:05 am, Marko Srepfler wrote:
> Same error
> C:\clojure>java -cp jline-0.9.91.jar;clojure.jar jline.ConsoleRunner
> clojure.main
> Exception in thread "main" java.lang.ClassNotFoundException:
> clojure.main
Does it work without jline? eg: just "java -cp clojure.jar
clojure.main".
I'
On 2010 Apr 29, at 2:17 AM, Mark Engelberg wrote:
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
Hi Lee,
On 29 April 2010 22:31, Lee Spector wrote:
> The error that I get is:
>
> Caused by: java.lang.IllegalArgumentException: n must be positive
>at java.util.Random.nextInt(Random.java:250)
>
Hopefully this will give you the clue you need:
user=> (. thread-local-random-generator (ne
Good point, and no. There are several (but not dozens) of calls to
some. It appears that all of them are places where search is known to
be O(n) on small data, and (most importantly!) *none* of them include
an instance check to see if there is an associative collection
available.
Stu
Hi
I'm getting an error from clojure-1.1.0 (with Java 1.6.0_16 under linux) that
really has me scratching my head. Probably something obvious but I'm baffled
and would love it if someone could point out what's going on.
The error that I get is:
Caused by: java.lang.IllegalArgumentException: n mus
Hi,
did you also check some? I would use (some #{item} coll)
or (some #(= % item) coll) from core instead of sucking in
3.5Mb contrib for includes?.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email t
Thinking about this one.
I like this proposal. I'd make contains? an alias for contains-key?
with a deprecation warning, and just forget about seq-contains? in
favor of contains-val?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this
"In theory, there is no difference between theory and practice. In
practice, there is." -Yogi Berra (maybe).
The recent thread on the new seq functions spun off into a theoretical
discussion about whether about the merits of having contains? and seq-
contains? as separate functions. I would
2010/4/29 Mark J. Reed :
> I like this proposal. I'd make contains? an alias for contains-key?
> with a deprecation warning, and just forget about seq-contains? in
> favor of contains-val?
This makes a lot of sense to me.
(and have, as suggested by ataggart, contains-key? complain if passed a seq
I like this proposal. I'd make contains? an alias for contains-key?
with a deprecation warning, and just forget about seq-contains? in
favor of contains-val?
On Thursday, April 29, 2010, ataggart wrote:
> I know it won't matter, but for posterity if nothing else...
>
> Functions named contains-k
On Apr 29, 2010, at 1:57 AM, Meikel Brandmeyer wrote:
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 ab
Maybe juste the name ?
wouldn't with-open-close be a better reminder of how the bindings are
constructed ?
2010/4/29 Alex Osborne :
> ka writes:
>
>> Above I wrote a macro with-open-flexi! ... which I'm planning to use
>> in my app's API . .. please let me know if there are any bugs /
>> gotchas
ka writes:
> Above I wrote a macro with-open-flexi! ... which I'm planning to use
> in my app's API . .. please let me know if there are any bugs /
> gotchas / improvements etc...
>
> I didn't get any responses, so does it means there is something so
> obviously wrong that you can't even begin wh
I know it won't matter, but for posterity if nothing else...
Functions named contains-key? and contains-val? would make a lot more
sense to me than the current contains? and new seq-contains?. Anyone
looking at contains-val? should expect it to be O(n). The only
effective difference would be tha
Hi ppl,
Above I wrote a macro with-open-flexi! ... which I'm planning to use
in my app's API . .. please let me know if there are any bugs /
gotchas / improvements etc...
I didn't get any responses, so does it means there is something so
obviously wrong that you can't even begin where to start :)
58 matches
Mail list logo