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
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
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
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
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
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
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
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
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
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
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 "
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
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
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
*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
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
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
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
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
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
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
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
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
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
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
- 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
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
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
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
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
--~--~-~--~~--
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
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"
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
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.
>
(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
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
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
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
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
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
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))
--~--~-~--~--
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
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,
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
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
> "
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
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
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
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
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
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
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
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
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
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
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
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?
> >
>
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:
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/
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.
--~--~-~--~
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
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,
>
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
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//
> #
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
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
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
(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
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)])))
>
> >
>
--
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
(.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
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
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
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
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
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
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
(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
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
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
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
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:
>
>
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
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
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
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
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
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
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
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
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)]
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
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
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,
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
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)
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
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
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
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 - 100 of 522 matches
Mail list logo