Re: quote on side effects

2009-01-05 Thread kevin
I don't know if he was the first, but I heard it from Simon Peyton Jones first: In an interview around 3:15: http://channel9.msdn.com/posts/Charles/Simon-Peyton-Jones-Towards-a-Programming-Language-Nirvana/ When answering a question around 10:40: http://oscon.blip.tv/file/324976 Kevin O

Re: quote on side effects

2009-01-05 Thread kevin
guage-Nirvana/ Kevin Krouse On Jan 5, 12:48 pm, "Mark Volkmann" wrote: > I'm trying to recall where I heard a quote that goes something like this. > > "If none of your functions have side effects then all you're doing is > heating up the processor." > &g

Re: Improving clojure.jar/clojure-contrib.jar compression (ClassLoader alternatives)

2009-04-18 Thread kevin
ses. http://scala.sygneca.com/code/compressed-executable-jar Kevin On Apr 17, 7:37 pm, Stuart Sierra wrote: > On Apr 17, 7:36 pm, "Dimiter \"malkia\" Stanev" > wrote: > > > Is there any alternative (ClassLoader?) to store the .class files in a > > different comp

RE: mvn clojujure:repl - no keyboard echo

2010-03-22 Thread Kevin
airly complex package, but it looks like there's still a bug its setup somewhere. Cheers, Kevin Kelley -- 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 fro

RE: mvn clojujure:repl - no keyboard echo

2010-03-23 Thread Kevin
hat way. But I don't know why I'd need jline: nothing tells me if it does anything more than command-history, which windows shell already has. So anyway. My impression now is that jline doesn't do any good on XP, but that isn't the answer to alux's "mvn clojure:r

RE: labrepl, making Clojure more accessible

2010-03-24 Thread Kevin
That gives a 1.1-version, standalone leiningen, size around 10MB, can be run with no other dependencies. After that setup, I've been into both the Incanter example from earlier, and this labrepl; so it appears to be working. Cheers, Kevin Kelley -- You received this message because you are

RE: ANN: labrepl, making Clojure more accessible

2010-03-24 Thread Kevin
t's doing a lot of background stuff but doesn't give the feel of "hidden magic" -- it's clear what's going on, defaults work, etc. Cheers, Kevin Kelley -- You received this message because you are subscribed to the Google Groups "Clojure" group. To p

RE: Getting started with open source Clojure projects

2010-03-30 Thread Kevin
pendency management. Download the project, look for the project.clj file, run 'lein deps' in that directory, and you get all needed dependency jars loaded into a 'lib' subdirectory. cheers, Kevin Kelley -- You received this message because you are subscribed to the Google

RE: Newbie question re. calling Java from Clojure

2010-04-02 Thread Kevin
o World") > aLayer (.getLayer aCanvas)] > (. aLayer .addChild aNode) Too many dots: see http://clojure.org/java_interop for Java method call ref. That last line should be: (.addChild aLayer aNode) I think. Good luck! hope to see some neat Piccolo

RE: create static inner Java class with constructor argument

2010-04-12 Thread Kevin
27;m guessing you'll want javax.sound.sampled/Line$Info Hope that helps, Kevin Kelley -- 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

RE: Java interop question: proxy or gen-class?

2010-04-17 Thread Kevin
I hadn't taken the time to go into it. Putting it together with Clojure, and having a nice little sample of it to try out, brings it closer to the front of the line for me. Much appreciated! Kevin Kelley -- You received this message because you are subscribed to the Google Groups "

Contract Clojure Developer Position (Mandarin Fluency) in Santa Clara, CA

2017-05-11 Thread Kevin
Distributed System/Clojure Senior/Staff Software Engineer (Contract to possible hire) The main requirement for this position is strong experience with Clojure and Java on Linux. Must be fluent in Mandarin for technical communication (written and verbal). May consider limited Clojure experience

Re: Contract Clojure Developer Position (Mandarin Fluency) in Santa Clara, CA

2017-05-12 Thread Kevin
If you are interested, you can reply to me at kevin.degraaf at huawei.com as well as here... -- 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

Clojure JD in San Jose, CA

2018-01-25 Thread Kevin
Must Have: -- 1 to 3 years hands, production on experience in Clojure or another Lisp based language Strong functional programming background Minimum 1 year experience in Java Hands on experience with leiningen and git Hands on experience in API Experience in Scrum and CI Nice to have

[JOB] Clojure Developer for smart lighting IoT platform

2018-02-05 Thread Kevin
*Clojure Developer* Work with highly scaling back-end smart lighting IoT platform. The group is a startup purchased by a large corporation (6-12+ contract through HCL), so you get the best of both worlds. Must Have: -- 1 to 3 years hands, production on experience in Clojure or another

Re: [JOB] Clojure Developer for smart lighting IoT platform

2018-02-06 Thread Kevin
Note that this is position is located in San Jose, CA. -- 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 your first po

Re: Problem Running ClojureScript on OpenJDK

2011-07-21 Thread Kevin
I just saw this thread and that (use of internal class) does seem to be the problem. I submitted a pull request for this problem a little while ago: https://github.com/clojure/clojurescript/pull/1 On Jul 20, 9:45 pm, db wrote: > I had the same problem with open jdk on ubuntu.  It looks like op

Re: Alan Kay talk

2012-04-26 Thread Kevin
t the source code isn't always easily built externally. Their only repository of putting everything together is at http://tinlizzie.org/dbjr/ Kevin. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: How to go about finding a Clojure job

2012-06-16 Thread Kevin
Send me your resume. I may have something fulltime involving Clojure, javascript and maybe some Ruby on Rails opening up soon. I am on Seattle, WA, but my company is in Michigan, California, and elsewhere and telecommute is fine. Kevin. -- You received this message because you are

Self-referential proxies

2008-09-27 Thread Kevin
Hello, I had some difficulty writing the following java code in Clojure: Runnable runnable = new Runnable() { public void run() { animate(); display.timerExec(TIMER_INTERVAL, this); } }; display.timerExec(TIMER_INTERVAL, runnable); For the moment I have

Re: Self-referential proxies

2008-09-27 Thread Kevin
Thanks, that's handy to know and a lot cleaner. --~--~-~--~~~---~--~~ 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

Re: xml/parse

2008-12-11 Thread Kevin Downey
your problem is ' ' makes xml/parse a symbol and stops evaling it to a function symbols are callable like keywords so if you have a hash with symbols as keys you can ('a {'a 1 'b 2}) -> 1 so ('xml/parse "/Users/me/correct/path/to/my.xml") is trying to lookup 'xml/parse in "/Users/me/correct/path/t

Circular Require Change?

2008-12-17 Thread Kevin Martin
I unfortunately ran into circular requires today. In previous versions of Clojure a circular require was answered with an exception. The text of this was something along the lines of "Cannot load 'a' because already loading 'a'. It looks as though this was changed with svn revision 1131 Sun No

Re: Circular Require Change?

2008-12-19 Thread Kevin Martin
n Dec 17, 12:43 am, Kevin Martin wrote: > > > I unfortunately ran intocircularrequires today.  In previous > > versions of Clojure acircularrequirewas answered with an > > exception.  The text of this was something along the lines of "Cannot > > load 'a

clojure and clojure-contrib github projects updated

2008-12-27 Thread Kevin O'Neill
Hi all, I've updated the github svn clones to pull from google code. I've also pushed the 20081217 branch so it's now accessible from git. Any problems please let me know. -k. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Possible minor bug in gen-class: method name character escaping?

2009-01-16 Thread Kevin Downey
- is not a "Java letter or digit" so it is not allowed in java method names. http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.8 user=> (Character/isJavaIdentifierPart (int \-)) false user=> On Fri, Jan 16, 2009 at 9:56 AM, Greg Harman wrote: > > I think I may have found a

Re: Macros in interaction with Functions

2009-01-16 Thread Kevin Downey
and is also written as a macro to short circuit evaluation: clojure.core/and ([] [x] [x & rest]) Macro Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it re

Re: Possible minor bug in gen-class: method name character escaping?

2009-01-16 Thread Kevin Downey
On Fri, Jan 16, 2009 at 12:22 PM, Greg Harman wrote: > >> > 2. If I want the Clojure functions that underlie the methods in the >> > generated class used directly by my Clojure code as well (which I do), >> > then I'm stuck having to either violate standard Clojure/Lisp function >> > naming conve

Namespace/Classpath Question

2009-01-16 Thread Kevin Albrecht
lojure.jar clojure.lang.Script foo/bar/ alpha.clj I get this error: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: get-stuff in this context (alpha.clj:4) I am relatively new to the Java world, so I'm sure I'm missing something regarding the classpath or the name

Printing Strings in Lists

2009-01-23 Thread Kevin Albrecht
Below are two operations that print (1 2 3 4). How can I do something similar to print ("1 2 3" 4) to standard out? (println '("1 2 3" 4)) -> (1 2 3 4) (def x "1 2 3") (println `(~x 4)) -> (1 2 3 4) --Kevin Albrecht --~--~-~--~~--

Re: Printing Strings in Lists

2009-01-23 Thread Kevin Downey
prn On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote: > > Below are two operations that print (1 2 3 4). How can I do something > similar to print ("1 2 3" 4) to standard out? > > (println '("1 2 3" 4)) > -> (1 2 3 4) > > (def x &qu

Re: Printing Strings in Lists

2009-01-23 Thread Kevin Albrecht
Ah, exactly what I was looking for, thanks. On Jan 23, 11:15 am, Kevin Downey wrote: > prn > > On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote: > > > Below are two operations that print (1 2 3 4).  How can I do something > > similar to print ("1 2 3"

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Kevin Downey
instead of using binding and eval, you can generate a (fn ) form, eval it, keep the result function stuffed away somewhere and apply it instead of calling eval all the time On Fri, Jan 23, 2009 at 1:10 PM, Zak Wilson wrote: > > It does seem like a legitimate use for eval, at least at first glanc

Re: Simple lisp like idiom in clojure, call function and keep the result

2009-01-23 Thread Kevin Downey
there is when-let, if-let, etc, that combine conditionals and lexical binding On Fri, Jan 23, 2009 at 1:31 PM, BerlinBrown wrote: > > What is an idiom to call a function and also retain the result. For > example, I see myself doing this a lot, but it seems to more code than > would be needed. >

Re: Length of Sequence

2009-01-28 Thread Kevin Downey
(doc count) - clojure.core/count ([coll]) Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps nil On Wed, Jan 28, 2009 at 11:15 AM, Peter Wolf wrote: > > Here's a dumb question, but I can

Re: Alternatives to contains?

2009-01-29 Thread Kevin Downey
actually rhickey showed up on irc and pointed something out: 15:23 rhickey : user=> (.contains [1 2 3] 2) 15:23 rhickey : true 15:23 rhickey : user=> (.contains '(1 2 3) 2) 15:23 rhickey : true 15:23 rhickey : what contains debate? :) so because seqs, vectors, etc are java collect

Re: Distributed Clojure

2009-01-29 Thread Kevin Downey
have you looked at the available java frameworks like hadoop? there is also some kind of java interface to erlang instead of reinventing the wheel again... On Thu, Jan 29, 2009 at 6:15 AM, Greg Harman wrote: > > One of Clojure's big selling points (obviously) is the support for > concurrent prog

Re: Distributed Clojure

2009-01-29 Thread Kevin O'Neill
the topic, a few are hinted at) when it comes to > distributing some of Clojure's concurrency data structures in the > shared-memory approach. > > Kevin: > > I hadn't heard of Hadoop before, but at first glance it's exactly what > I'm looking for. (Thanks!) The p

Re: purpose of clojure-slim.jar

2009-01-29 Thread Kevin Downey
clojure-slim.jar lacks compiled clojure code. The java code is compiled, so clojure-slim.jar is still completely usable as clojure, it just have to compile things like core.clj when it loads them. On Thu, Jan 29, 2009 at 4:56 PM, kkw wrote: > > Hi folks, > >I noticed that when I run 'ant' t

Documenting Clojure Code

2009-01-30 Thread Kevin Albrecht
How are people generating HTML or text documentation from their Clojure code? --~--~-~--~~~---~--~~ 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 unsubscri

Re: Documenting Clojure Code

2009-01-30 Thread Kevin Albrecht
Using #^{:doc ...} documents the code, but are there any tools out there for creating HTML API documentation from the documented code? Stephen C. Gilardi wrote: >         (def >           #^{:doc "a nice description here"} >           myvar >           (hash-map :a 1 :b 3)) --~--~-~--~--

Re: What is "defn-"

2009-02-03 Thread Kevin Downey
as a namespace is to a java package, defn- is to private, and defn is to public On Tue, Feb 3, 2009 at 8:19 PM, Terrence Brannon wrote: > > What is the significance of the dash after defn? How does it differ > from defn? > > Source: > http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_i

Re: Tools for parsing arguments

2009-02-06 Thread Kevin Downey
you can also use map destructuring. (defn x [{:keys [a b c]}] [a b c]) user=> (x {:a 1 :b 2 :c 3}) [1 2 3] On Fri, Feb 6, 2009 at 7:52 AM, Jeffrey Straszheim wrote: > That is remarkably simple and elegant. > > On Fri, Feb 6, 2009 at 10:20 AM, Stuart Sierra > wrote: >> >> On Feb 6,

String/valueOf on char array

2009-02-06 Thread Kevin Albrecht
Why is this happening? (def cs (make-array Character/TYPE 1024)) (apply str cs) -> "" (String/valueOf cs) -> "[...@42880d" Shouldn't these return the same value? --Kevin --~--~-~--~~~---~--~~ You received this message because y

Re: Am I "holding on to the head" here ?

2009-02-08 Thread Kevin Downey
I am not sure exactly how preduce differs from normal reduce, but reduce is not a lazy operation, so it will result in the realization of a lazy seq passed to it. On Sun, Feb 8, 2009 at 2:13 PM, Jeffrey Straszheim wrote: > I have this piece of code: > > (defn- run-work-elements-in-parallel > "

Re: anonymous functions

2009-02-10 Thread Kevin Downey
fn has an implicit (do ...) #(do ...) behaves the same way. #(a b c) expands to (fn [] (a b c)) if you put in multiple forms you get #((a b)(c d)) expands to (fn [] ((a b) (c d))) note the (a b) in the operator position. On Tue, Feb 10, 2009 at 8:09 PM, Mark Volkmann wrote: > > Just checking my

Naming Conventions for Functions that Modify State

2009-02-11 Thread Kevin Albrecht
transaction (and therefore has a side effect): (defn beta [] (dosync (ref-set foo 10))) 3. Function that needs to be in a transaction: (defn gamma [] (ref-set bar 42)) --Kevin Albrecht --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Naming Conventions for Functions that Modify State

2009-02-12 Thread Kevin Albrecht
If no one knows of any existing conventions, does anyone have ideas for conventions? --~--~-~--~~~---~--~~ 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 un

Specifying files with spaces in the name to clojure.contrib.command-line

2009-02-14 Thread Kevin Albrecht
ot; When they should be this: "/Users/smith/src/no_spaces.txt" "~/file with spaces.txt" --Kevin Albrecht P.S. Also, unrelated to this problem, the following line in the example code in command_line.clj is missing the vector surrounding the bindings of the doseq: :else

Re: Specifying files with spaces in the name to clojure.contrib.command-line

2009-02-14 Thread Kevin Albrecht
Ah, this was the problem, thanks. Michael Wood wrote: > java -server -cp "${CLASSPATH}" clojure.main "${script}" "$@" > > The quotes are necessary around the $@, otherwise you will get the > symptoms you are seeing. --~--~-~--~~~---~--~~ You received this message b

Re: Concurrency and file writing

2009-02-14 Thread Kevin Downey
http://www.exampledepot.com/egs/java.io/CreateTempFile.html On Sat, Feb 14, 2009 at 4:38 PM, Mark H. wrote: > > On Feb 14, 6:48 am, James Reeves wrote: >> I've been having some difficulty coming up with a scheme for writing >> to files in a thread-safe manner. The files are named with the hash

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-19 Thread Kevin Albrecht
I can vouch for using SWT with Clojure. There is also no need to compile you application to distribute it. I posted a little example program on my blog here: http://kevinoncode.blogspot.com/2009/01/creating-clojure-gui-application-with.html -- Kevin Albrecht http://www.kevinalbrecht.com

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-20 Thread Kevin Albrecht
d application without > > compiling it? > > > On Feb 19, 6:51 pm, Kevin Albrecht wrote: > > > I can vouch for using SWT with Clojure.  There is also no need to > > > compile you application to distribute it.  I posted a little example > > > program on m

Re: exclamation point at end of function names

2009-02-22 Thread Kevin Albrecht
I am also interested in the reasoning behind this. See my related question here: http://groups.google.com/group/clojure/browse_thread/thread/b04d49784c895030 --Kevin Albrecht On Feb 21, 5:47 am, Mark Volkmann wrote: > If I understand correctly, ending a function name with an exclamat

Re: alternate syntax

2009-02-23 Thread Kevin Downey
You might be interested in my pet macro: pl http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj#L94 it does transformations on code using zippers. for example: (pl inc $ inc $ 0) expands to (inc (inc 2)) pl is just a toy but it might be worth lo

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-24 Thread Kevin Albrecht
application context pattern and I am going to take a look at it for incorporation in my design. Thanks, Kevin Albrecht On Feb 24, 6:04 am, Itay Maman wrote: > I've been silently following Clojure (and this group) for several > months now.Somewhere around December I started working o

Re: Flatten a list

2009-02-24 Thread Kevin Downey
filter, http://clojure.org/api#filter On Tue, Feb 24, 2009 at 7:38 PM, Sean wrote: > > I've got the following list > > (:a nil nil :b :a) > > I want to call a "nil-killer" function, and get the following list > > (:a :b :a) > > How do I go about this?  Could someone post a quick example? > > >

Re: unbean

2009-02-25 Thread Kevin Albrecht
It occurs to me that the "unbean" function could be very useful when writing tests for code that calls Java objects. Anyone have thoughts on its use in this way? On Feb 24, 9:18 pm, ".Bill Smith" wrote: > > I tend to associate "bean" with Java beans, so the naming seems to be > > reversed IMHO:

Re: Extensive use of let?

2009-02-25 Thread Kevin Downey
You should look at "->" it lest you take (op3 (op2 (op1 input))) and write it as (-> input op1 op2 op3) there is also "comp" which composes functions, and partial for partial application. some example comp usage: http://github.com/hiredman/clojurebot/blob/297e266b0badf0f301a556e95771b940a80016e7/

Re: unbean

2009-02-26 Thread Kevin Albrecht
Thanks. I will definitely be using this function... keep me up to date on any changes. Bill wrote: > > It occurs to me that the "unbean" function could be very useful when > > writing tests for code that calls Java objects. > > Yes, that is exactly the use I have in mind. --~--~-~--~

Re: Unicode, accented characters

2009-03-06 Thread Kevin Downey
Jline is known to have issues with unicode. On Fri, Mar 6, 2009 at 2:58 PM, max3000 wrote: > > I'm getting similar results without jline.ConsoleRunner. Also as I > mentioned I use RT.loadResourceScript and get the same results. > > However, I'm using the clojure release from 2008-12-17 (the only

Re: transposing a small java class in clojure

2009-03-10 Thread Kevin Downey
I don't know how many arguments the method you are overriding with onLogin takes, but the function you define should take one more argument then the method you are overiding, the first argument being an explicit reference to an instance On Tue, Mar 10, 2009 at 12:16 PM, rb wrote: > > HI Chris, >

Re: Request: Can clojure.contrib.walk provide a reduce type operation?

2009-03-11 Thread Kevin Downey
if your walk pushes the items into a Queue, you can just reduce across the Queue On Wed, Mar 11, 2009 at 9:24 AM, Jeffrey Straszheim wrote: > Currently the clojure.contrib.walk code provides a nice way to perform a > depth first map operation on trees.  However, I need to fold across a tree. > I

Re: Slash mystery

2009-03-18 Thread Kevin Downey
this came up on irc starting: http://clojure-log.n01se.net/date/2009-02-18.html#23:49 and the solution: http://clojure-log.n01se.net/date/2009-02-19.html#0:30 On Wed, Mar 18, 2009 at 11:03 AM, Konrad Hinsen wrote: > > Consider the following session: > > user=> / > # > user=> clojure.core// > #

Re: Slash mystery

2009-03-18 Thread Kevin Downey
Symbols starting and ending with "." are reserved. see http://clojure.org/reader the section on Symbols On Wed, Mar 18, 2009 at 12:58 PM, Michael Wood wrote: > > On Wed, Mar 18, 2009 at 8:22 PM, Kevin Downey wrote: >> >> this came up on irc starting: >> http

Re: lazy-cons

2009-03-18 Thread Kevin Downey
the api doc documents the latest release of clojure, which is the pre-lazy release from back in december I believe. On Wed, Mar 18, 2009 at 3:59 AM, Notfonk wrote: > > Hey > > i'm not sure this is the right place to post that > > Could you please remove lazy-cons from the api doc ? I'm a newbie

Re: Help with the dot operator special form

2009-03-21 Thread Kevin Downey
you want defmacro not definline. the result of a macro is a data structure. that data structure is then evaluated in place of the call to the macro. definline (I think?) behaves similar to a function, so if it returns a data structure, you just get that data structure (the data structure is not th

Re: Mapping a function over a map's values

2009-03-22 Thread Kevin Downey
(defn mapmap [fn m] (into {} (map #(vector (first %) (fn (second %))) m))) On Sun, Mar 22, 2009 at 1:10 PM, Jon Nadal wrote: > > I often need to map a function over the values of a map while > preserving keys--something like: > > [code] > (defn mapmap [fn m] >  (let [k (keys m) >        v (m

Re: Mapping a function over a map's values

2009-03-22 Thread Kevin Downey
ooh for On Sun, Mar 22, 2009 at 9:27 PM, Jeff Valk wrote: > > On 22 March 2009 23:14, Timothy Pratley wrote: > >> Golf time! >> >> (defn mapmap [f m] >>     (into {} (map (fn [[x y]] [x (f y)]) m))) > > Ah, golf... :-) > > (defn mapmap [f m] >  (into {} (for [[k v] m] [k (f v)]))) > > > > --

Re: keyword misspelling

2009-03-28 Thread Kevin Downey
something like this came up on irc the other day. this is a good opportunity for someone to write some macros that allow you to specify a validator function for structs similar to refs and agents. On Sat, Mar 28, 2009 at 2:20 PM, mikel wrote: > > > > On Mar 28, 4:05 pm, billh04 wrote: >> I am

Re: introspect namespace ?

2009-04-05 Thread Kevin Downey
(.toString *ns*) On Sun, Apr 5, 2009 at 12:39 PM, Stephen C. Gilardi wrote: > > On Apr 5, 2009, at 3:23 PM, dysinger wrote: > >> I need coffee - too many typos.  I meant to say "I am trying to avoid >> _typing_ 'x.y.z' twice" >> >> (str (the-ns 'user)) is is even more human-error prone than just

Re: Question about metadata on map keys

2009-04-10 Thread Kevin Downey
I think you misunderstand, I don't think he is expecting to being able to use :foo as a key twice with different metadata. I think he wants something like: (def x {[:a] 1 [:b] 2}) then (meta (first (keys (assoc x (with-meta [:a] {:x 1}) 2 ;(-> (assoc x (with-meta [:a] {:x 1})) keys first m

Re: java.lang.String cannot be cast to [Ljava.lang.CharSequence;

2009-04-16 Thread Kevin Downey
I would be interested in seeing a full stack trace and some pastbined code. there are no clojure strings, just java strings, and java strings are charsequences. On Thu, Apr 16, 2009 at 11:25 AM, prhlava wrote: > > > Hello, > > I am trying to use a java library ( http://code.google.com/p/webdrive

Re: IFn?

2009-04-18 Thread Kevin Downey
ifn? returns true for things that implement clojure.lang.IFn, IFn is the interface for things that can be put in the operator position in a s-expr: functions vectors maps sets keywords symbols ...? fn? returns true for just functions On Sat, Apr 18, 2009 at 9:37 PM, tmountain wrote: > > Sorry f

Re: areduce flaw

2009-04-27 Thread Kevin Downey
no, the syntax is not the same. user=> (macroexpand-1 '(.foo bar)) (. bar foo) On Mon, Apr 27, 2009 at 2:51 PM, Boris Mizhen wrote: > > Hi Meikel, thanks for the answer. > > I wonder if someone could explain or point me to the explanation about > *why* a Java static fn can't be passed just li

Re: Git with Google Code

2009-04-29 Thread Kevin O'Neill
no you have that the wrong way around. windows sucks :) if you dont want to (or can't) use git-svn i maintain a mirror on git hub (http://github.com/kevinoneill/clojure/tree/master). -k. On Wed, Apr 29, 2009 at 6:36 AM, Rayne wrote: > > Git still sucks on windows :\ > > On Apr 28, 11:04 am, St

Re: Git with Google Code

2009-04-29 Thread Kevin O'Neill
Baring server hickups it checks for updates once an hour. -k. On Thu, Apr 30, 2009 at 7:20 AM, Cosmin Stejerean wrote: > On Wed, Apr 29, 2009 at 3:57 PM, Kevin O'Neill wrote: >> >> no you have that the wrong way around. windows sucks :) >> >> if you dont

Re: constructing maps

2009-05-04 Thread Kevin Downey
(into {} (apply map vector '((cars bmw chevrolet ford peugeot) (genres adventure horror mystery {ford mystery, chevrolet horror, bmw adventure, cars genres} On Mon, May 4, 2009 at 4:03 PM, Michel S. wrote: > > > > On May 4, 5:07 pm, Christophe Grand wrote

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-06 Thread Kevin O'Neill
me > using http). > > I'm not convinced I've removed all of the kinks from the script, but it > seems to be working, though I'd like to iron out any remaining kinks. > The script as it stands with some brief instructions on it's use can be > found her

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-06 Thread Kevin O'Neill
Branches and tags are now being mirrored. -k. On Thu, May 7, 2009 at 1:41 PM, Kevin O'Neill wrote: > I'll look into it. I mirror branches for other projects and i'm sure > this will be fairly straight forward. > > -k. > > On Tue, May 5, 2009 at 9:05 PM, Rick M

Re: Can "for" be enhanced to not have to take a binding?

2009-05-07 Thread Kevin Downey
user=> (doc take-while) - clojure.core/take-while ([pred coll]) Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects. nil user=> On Thu, May 7, 2009 at 2:11 PM, CuppoJava wrote: > > I'm trying to acco

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-08 Thread Kevin O'Neill
yeah ... tags a a bit of a pain as the tags revision can move underneath me. i took the conservative (and lazy) approach and update them during the refresh cycle. i might look into improving this a little over the weekend. -k. On Sat, May 9, 2009 at 4:28 AM, Phil Hagelberg wrote: > >

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-08 Thread Kevin O'Neill
Tags should now be stable and generate new revisions only when/if the subversion revision changes. -k. On Sat, May 9, 2009 at 6:44 AM, Kevin O'Neill wrote: > yeah  ... tags a a bit of a pain as the tags revision can move > underneath me. i took the conservative (and lazy) approach

Re: Help with Type Hint

2009-05-14 Thread Kevin Downey
so I took a look at with this code: http://gist.github.com/111935 output: :original "Elapsed time: 369.683 msecs" :redux-1 "Elapsed time: 11672.329 msecs" :redux-2 "Elapsed time: 74.233 msecs" as to why there is such a huge difference between your code and redux-2 I am not sure. I would defin

Re: The thread ring problem

2009-05-29 Thread Kevin Downey
http://gist.github.com/120289 using queues and Threads instead of agents On Fri, May 29, 2009 at 4:11 PM, Laurent PETIT wrote: > > Hi, > > here is a second attempt, partly inspired by clojure's agents page, > that looks better (true direct ring of agents, not just indirect ring > via vector), an

Re: Using (into {} ...) on a sequence of lists vs. vectors

2009-06-01 Thread Kevin Downey
two element vectors implement MapEntry, (into {} x) x needs to be something that seq can be called on and will return a seq of MapEntrys On Mon, Jun 1, 2009 at 10:39 AM, samppi wrote: > > Why does using a list with into and a map throw an exception, while > using a vector is fine? > > Clojure 1

Re: New and stuck ??

2009-06-07 Thread Kevin Downey
the new entry point is clojure.main java -cp clojure.jar clojure.main ;no slash, with the corrent jar name java -cp clojure.jar clojure.main --help will print a nice help message On Sun, Jun 7, 2009 at 8:20 AM, darrell wrote: > > OK, embarrassing > > Thanks, I was caught wishing to see a wow

Re: The "->" & "." nested usage

2009-06-08 Thread Kevin Downey
you need to pass something in. example: => (-> "foo" String. String.) "foo" => (macroexpand '(-> String. String.)) (new String String.) => (macroexpand '(-> "foo" String. String.)) (new String (clojure.core/-> "foo" String.)) => (macroexpand '(-> "foo" String.)) (new String "foo") String. is o

Re: The "->" & "." nested usage

2009-06-08 Thread Kevin Downey
gt; (String. (String.)) > "" > user=> (macroexpand (String. (String.))) > "" > user=> (macroexpand `(String. (String.))) > (new java.lang.String (java.lang.String.)) > > Nesting is a must :) > Thank you both for your helpful reply > > On Jun

Re: Thoughts on bags?

2009-06-09 Thread Kevin Downey
On Tue, Jun 9, 2009 at 7:49 PM, Richard Newman wrote: > > Thanks, Konrad and Andrew, for chipping in! > >>> There's an outline of an implementation of multisets (I think that's >>> the same as your bags) at: >>> >>>        http://code.google.com/p/clojure-contrib/source/browse/trunk/src/ >>> cloju

Re: EDT interaction

2009-06-13 Thread Kevin Downey
On Sat, Jun 13, 2009 at 2:02 PM, Wrexsoul wrote: > > Now I'm working on some Swing code and came up with these, which are > obviously going to be useful: > > (defmacro do-on-edt [& body] >  `(SwingUtilities/invokeLater #(do ~...@body))) > > (defmacro get-on-edt [& body] >  `(let [ret# (atom nil)]

Re: EDT interaction

2009-06-13 Thread Kevin Downey
On Sat, Jun 13, 2009 at 2:55 PM, Meikel Brandmeyer wrote: > Hi, > > Am 13.06.2009 um 23:29 schrieb Meikel Brandmeyer: > >> (defmacro get-on-edt >>  [& body] >>  `(get-on-edt* (fn [] ~body))) > > Of course ~...@body instead of ~body... > > Sincerely > Meikel > > I know you (Meikel) already fixed i

Re: EDT interaction

2009-06-13 Thread Kevin Downey
ext foo "bar"))) On Sat, Jun 13, 2009 at 5:23 PM, Aaron Cohen wrote: > > Isn't this a case of wrapping a Java API needlessly? > > What's so bad about: (SwingUtilities/invokeLater my-func) ? > -- Aaron > > > > On Sat, Jun 13, 2009 at 5:59 PM, Kevin Dow

Re: Primitive char Type

2009-06-13 Thread Kevin Downey
user=> (def s (StringBuilder. "aaa")) #'user/s user=> (. s setCharAt 0 \b) nil user=> s # user=> (. s setCharAt (int 0) (char \b)) nil user=> (. s setCharAt (int 0) (char \e)) nil user=> s # user=> works for me On Sat, Jun 13, 2009 at 7:28 PM, tmountain wrote: > > I'm writing some simple code,

Re: Rebinding functions?

2009-06-16 Thread Kevin Downey
you can use apply to avoid in-lining: user=> (binding [+ -] (apply + '(5 3))) 2 On Tue, Jun 16, 2009 at 11:16 AM, Michel S. wrote: > > > > On Jun 16, 1:42 pm, Paul Stadig wrote: >> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote: >> >> >> >> > It's currently not possible to dynamically reb

Re: Adding type hint causes compiler error

2009-07-05 Thread Kevin Downey
On Sun, Jul 5, 2009 at 5:18 AM, philip.hazel...@gmail.com wrote: > > Hi, > > The following code works as expected: > > (import 'javax.imageio.ImageIO 'java.io.File > 'java.awt.image.BufferedImage) > (defn bi-get-pixels >  [bi] >  (vec (.. bi (getData) (getPixels 0 0 (.getWidth bi) (.getHeight bi)

Re: ArithmeticException with doubles

2009-07-10 Thread Kevin Downey
On Fri, Jul 10, 2009 at 1:00 PM, Daniel Lyons wrote: > > > On Jul 10, 2009, at 12:24 PM, Sean Devlin wrote: > >> >> A quick java program: >> >> public static void main(String[] args) { >>    System.out.println(1.0/0.0); >> } >> >> Infinity >> >> >> On Jul 10, 11:08 am, John Harrop wrote: >>> This

Re: list vs. vector as input to (into {} ...) ?

2009-07-11 Thread Kevin Downey
two element vectors implement MapEntry, two element lists do not On Sat, Jul 11, 2009 at 9:09 AM, Stuart Halloway wrote: > > Is there a reason these work differently? > > (into {} [(list 1 2) (list 3 4)]) > -> java.lang.ClassCastException: java.lang.Integer cannot be cast to > java.util.Map$Entry

Re: Clojure vectors

2009-07-13 Thread Kevin Downey
the sequence functions operate on sequences. if you pass in something that is not a sequence, like a vector, they call seq on it internally. so what you get back from filter or map is a sequence. conj has consistent behavior across types, you just get a different type out of map/filter/etc then wh

Re: another binding issue?

2009-07-14 Thread Kevin Downey
closures capture lexical scope, binding creates dynamic scope. lexical scope is where a closure is defined, dynamic is when it is called. because filter is lazy, the closure is called outside the dynamic scope created by binding On Jul 14, 1:07 pm, Aaron Cohen wrote: > I'm a little unclear on w

  1   2   3   4   5   6   >