We use Clojure across several APIs and for data analysis at SmartBIM in
Atlanta, and we're hiring! Send me an email at stuart.hinson at the
company's domain if you're local and interested
On Thursday, June 13, 2013 5:07:07 PM UTC-4, Deepak Giridharagopal wrote:
>
> On Monday, June 10, 2013 3:47:
have to worry
about in Clojure.
Stuart
> Looks like the only synchronization is for lazy initialization of the
> instance of Random used by the static method:
>
> public final class Math {
>
>private static Random randomNumberGenerator;
>
>private
some spare time ...
but secretly I was hoping that this thread would goad someone else
into writing the tests and publishing their results. :-)
Stuart
> On Tue, Dec 2, 2008 at 3:05 PM, Stuart Halloway
> <[EMAIL PROTECTED]> wrote:
>>
>> nextDouble calls next, which accordin
>>> (48 - bits));
>}
>
> On Dec 2, 8:05 am, Stuart Halloway <[EMAIL PROTECTED]> wrote:
>> nextDouble calls next, which according to Java 5 docs is:
>>
>> synchronized protected int next(int bits) {
>> seed = (seed * 0x5DEECE66DL + 0xBL) &
t tests, where one
might say something like
(each-matches
[actual-value expected-value]+)
and have the match operator applied.
Stuart
> On Dec 1, 5:07 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
>> I am thinking about adding a match method to Clojure-contr
Hi Michiel,
eval is for form data, so I am more surprised that it works for
ArrayList than that it fails for StringBuffer.
Stu
> After playing around with macros, I ran into this problem with Clojure
> (the latest version from github). The following code throws an
> IllegalArgumentException:
Yes. doto is more general now. The . is needed to indicate Java
interop calls because doto can do other things which are not Java
interop calls:
(doto "double" println println)
double
double
-> "double"
Stuart
> Can someone tell me whether this change was inten
gensym-docs-default-to-match-impl.diff
Description: Binary data
--~--~-~--~~~---~--~~
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 thi
A few other details: the podcast is free, and fairly short (23 minutes).
Cheers,
Stuart
> I just noticed that there's a new Clojure podcast by Stuart Halloway
> on the Pragmatic Programmers site:
>
> http://pragprog.com/podcasts/show/24
>
> The blurb says:
>
>
Fixed, thanks.
-Stuart Sierra
On Dec 3, 12:36 pm, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> there is a missing # in the new trace code. Patch attached.
> One could think, that clojure-contrib uses clojure-contrib:
> there's defvar in clojure.contrib.d
ef629...
And I haven't forgotten about that, just haven't had time to work on
it. Anyone else who wants to tackle it is welcome.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure"
>".
That way your template can be a valid XML document. Yes, it's more
verbose, but PHP does it. Or, if you want, allow user-definable
delimiters.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
? In the
process, I separated the web-browser functions into a separate lib,
since those might be useful elsewhere.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to t
and foo then returned the result of the final expression 5.
Many languages work this way. In Ruby:
def foo
"evaluted and lost"
"return value"
end
Cheers,
Stuart
--~--~-~--~~~---~--~~
You received this message because you are subscribe
ow, I've never been a big fan
of functional languages and I laughed really hard when I realized ...
that I had implemented a functional language. The nature of the
problem simply dictated a particular solution."
Thanks, Rich.
-Stuart Sierra
--~--~-~--~~~---~--
I just pushed a fix.
-Stuart Sierra
On Dec 4, 9:33 am, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This morning after I "svn up" -ed Clojure Contrib, I could no longer
> build. It turns out that was 'cause I was still using Ant 1.6.2. But I
> looked
Yes, I realized what that reflector code was for after I sent the
message. Thanks,
-Stuart
On Dec 4, 3:45 am, "Christophe Grand" <[EMAIL PROTECTED]> wrote:
> Hi Stuart,
>
> That's very neat! Thanks! I'll apply your patch but I don't want to require
>
On Dec 4, 6:20 pm, Paul Mooser <[EMAIL PROTECTED]> wrote:
> However, I'm running out of heap space using the following function to
> filter my sequences:
...
> I know that filter is lazy, and I see that the documentation of lazy-
> cons says that lazy-conses are cached. Cached for what duration ?
Fixed. Thanks,
-Stuart Sierra
On Dec 5, 12:39 am, "Tchavdar Roussanov" <[EMAIL PROTECTED]> wrote:
> The attached patch fixes the compile error when in-case macro is used in
> different name space. The expanded code contains a private function from
> clojure
classes in the Java example, I don't
think it will ever be possible to write a competitive implementation
in pure Clojure. However, the advantage of having Java as a host
language is that you can use it for low-level operations like this.
-Stuart Sierra
--~--~-~--~~
On Dec 4, 8:02 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
> I've added a new reference type - atom.
I like it; it greatly simplifies a common use for Refs.
"Clojure. Sometimes you just need to mutate."
"Clojure. Mu
quot; programming using the different
transaction models.
-Stuart Sierra
--~--~-~--~~~---~--~~
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
On Dec 5, 11:17 am, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> You can (def is-even?) before your (defn is-odd? ...), which will allow
> it to compile.
The recently-added "declare" is for just this purpose:
(declare is-
doc-seq]
(filter my-filter doc-seq))
Does it still blow up?
-Stuart Sierra
--~--~-~--~~~---~--~~
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
If you have a space between "jar" and ";" that is a problem.
Stuart
>> Start by telling us precisely what you did to "run clojure."
>
> I have the below in my batch file
> SET CLASSPATH=/clojure/clojure/clojure.jar ;\
> /clojure/clojure/clojure-c
Hi Bill,
Cool idea. All my posts are tagged "clojure" on our blog, if that helps:
http://blog.thinkrelevance.com/tags/clojure
> Hi all,
>
> A lot of people are writing Clojure-related blog posts; however, I am
> often only interested in the Clojure posts they do and not the other
> posts. There
Hi Matt,
Clojure dynamically binds *agent* to the currently active agent on a
thread.
Stuart
> Hi all,
>I have a newbie question about Agents. I've been looking at the
> ants.clj file:
> http://clojure.googlegroups.com/web/a
lar expressions and "thrown-
with-msg?"
2. Nested test contexts, as in RSpec and some other testing
frameworks.
3. Adding test metadata to vars that are already defined elsewhere.
Peace, joy, and happy testing.
-Stuart Sierra
--~--~-~--~~~---~--~~
You
On Dec 7, 2:51 pm, Allen Rohner <[EMAIL PROTECTED]> wrote:
> One other feature idea: I'd like the ability to run individual tests.
> Once I've discovered a unit test failure, I want to be able to run the
> test by itself without the noise from other tests.
You can do that now with test-var, which
On Dec 7, 2:49 pm, Allen Rohner <[EMAIL PROTECTED]> wrote:
> An acceptable alternative would be to have a way to run all the tests
> in a namespace and all 'children' of a namespace. Then I could create
> a namespace like "test.functional.db.foo" "test.functional.db.bar" and
> then say "(run-tests
Hi all,
I have placed the sample code for _Programming Clojure_ on github, at
http://github.com/stuarthalloway/programming-clojure
. Most of the code samples now have unit tests, using Stuart Sierra's
test-is.
If you see an erratum in the book that you suspect was caused by
chang
most recent
is Beta 3.
Regards,
Stuart
>
> Hi All,
>
> It is working now. I found that I followed the instruction provided by
> the author blindly, it was not meant for the windows box(vista) I am
> using. The problem is on path separation, the book used forward slash
> inst
Hi Dave,
It looks like LockingTransaction.getRunning would need to be made
public. What do you plan to do with it?
As a workaround:
(defn in-tx? [] (try (ensure (ref true)) (catch
IllegalStateException e false)))
Stuart
>
> I gave a small talk on Clojure this afternoon to my tea
you don't. :) Just use "is" for now. I'll
consider making (is (and ...)) a recognized form, though.
I'm not certain about "are" yet, but I figured I had to offer at least
a little sugar. Maybe what it really needs is template-style
argument, l
On Dec 8, 3:53 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote:
> Great! Will the planned thrown-with-msg? support regex matching? I
> used something like that in clojure.contrib.test-clojure.evaluation,
> which was pretty handy.
Yes, that's where I
. It's going to change, either by specifying
the number of arguments, as Frantisek suggested, or with a template
expression. For now, I recommend just using "is".
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subsc
Over the last few weeks I have updated the examples in the Practical
Common Lisp -> Clojure blog series [1]. They should be up-to-date with
the changes to binding forms in Clojure, plus a few errata fixes.
Enjoy, and let me know if you find errors.
Cheers,
Stu
[1] http://blog.thinkrelevance
whole story. What are the counterarguments in
favor of non-lazy butlast?
Cheers,
Stuart
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojur
Hi folks,
I just committed a new contrib lib, an experimental tree walker for
Clojure. I'm hoping it will make it easier to write macros that need
to do transformations arbitrary code structures.
-Stuart Sierra
-
clojure.contrib.walk/walk
([f form])
Performs a
On Dec 9, 1:18 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> Here is where I am: If your function creates/returns only atoms or
> fixed size collections, loop/recur is fine. If it might return (or
> internally create) variable/huge/infinite collections, use lazy-*.
I a
Provides an error message like:
(compile 'com.thinkrelevance.Hello)
-> java.lang.RuntimeException: Unable to write to /some/bad/loc/
classes/com/thinkrelevance/Hello.class (Hello.clj:1)
I used a RuntimeException because the constructor for IOException did
not take a "cause" argument.
Cheers,
g.RuntimeException: java.lang.IllegalStateException:
Can't change/establish root binding of: *print-length* with set
Thanks,
Stuart
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send
Hi Steve,
Thanks for the info. Is this limitation of user.clj arbitrary, or
motivated by some concern that the average Clojure user should know
about? Is the a reason not to load the bindings first? Does user.clj
(in current form) do more harm than good?
Stuart
> user.clj is loa
//www.emacswiki.org/cgi-
bin/wiki/ParEdit> is a powerful combination. Paredit is like a
structured editor for Lisp expressions. There's a patch to handle
Clojure data structures: <http://github.com/jochu/clojure-mode/tree/
master/clojure-paredit.el>
-Stuart Sierra
--~--~-~--~-
+1. I would love to see a one-file story.
Stu
> On Dec 10, 2008, at 1:50 PM, Stephen C. Gilardi wrote:
>
>> - I think init.clj and repl-init.clj would be good additions to
>> what we have now. I'll be happy to write the code if it's welcome.
>
> Alternatively, we could make those hooks be func
ee an editor that goes all the way and abandons text
sources altogether.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.c
think what you want is:
(defn frequencies [coll]
(reduce
(fn [counts x]
(assoc counts x
(if-let [c (counts x)] (inc c) 1)))
{} coll))
user=> (frequencies [:a :a :b :a :b])
{:b 2, :a 3}
-Stuart Sierra
--~--~-~--~~~---
I've added a slightly modified version to clojure.contrib.seq-utils:
(defn frequencies
"Returns a map from distinct items in coll to the number of times
they appear."
[coll]
(reduce (fn [counts x]
(assoc counts x (inc (get counts x 0
{} coll))
Randall,
Well said, and I need to find a place to make this explanation in the
book prior to chapter 7. :-)
Stuart
> On Thursday 11 December 2008 13:37, Paul Barry wrote:
>> I've been reading the latest chapter from Stuart's book, Chapter 7:
>> Macros, an
I like the second form better, and may remove memfn from the book
entirely.
Stuart
> On Programming Clojure I read:
>
>> The method-as-function idiom is a common one, so Clojure provides
>> the memfn macro to wrap methods for you:
>
> (map (memfn toUpperCase) ["a&
Thanks, Perry. It's fixed now (SVN 292).
-Stuart Sierra
On Dec 8, 11:02 am, Perry Trolard wrote:
> In clojure.contrib.seq-utils, partition-by & group-by have docstrings
> following their arglists, so (doc parition-by) prints
>
> -
> clojure.con
ntrib directories, or can we safely delete them?
-Stuart Sierra
--~--~-~--~~~---~--~~
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 t
On Dec 11, 3:29 pm, "Aaron Cohen" wrote:
> Isn't it just asking for confusion?
It's useful to have it both ways:
(map :one-key bunch-of-maps)
(map one-map bunch-of-keys)
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message bec
On Dec 12, 2008, at 3:24 PM, Stuart Sierra wrote:
> It's been a month since Clojure rev. 1094 introduced the namespace-is-
> file change. Are people still using releases that require the old
> contrib directories, or can we safely delete them?
They're gone now as of SVN
mplement coll?) (tree-seq coll? seq x)))
Should maps be flattened in addition to "sequential things"?
But still (flatten2 nil) => (nil)
In general, you get weird results if the thing passed to flatten is
not a vector or a list:
(flatten "hello") => (&quo
Cool, thanks!
-S
On Dec 14, 4:47 pm, Chouser wrote:
> I've updated the Clojure classes graph (thanks for the push, R.
> Schulz!) The new version includes the newest classes as well as Java
> interfaces that are applicable. These latter are shown inside
> diamonds.
>
> A couple different .svg a
I expect it to do the
same, especially because:
(seq []) => nil
(flatten []) => nil
(seq nil) => nil
In the case of flatten, I think this is rarely going to make any
difference, but I'll patch it.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this me
You can do this:
(apply use (map symbol (list "clojure.contrib.str-utils"
"clojure.contrib.duck-streams")))
-Stuart Sierra
On Dec 15, 3:51 pm, "Brian Doyle" wrote:
> I have a seq of strings that are namespaces like,
> ("clojure.contrib.str-utils",
ib.condp (SVN rev. 304) for source & more comments. Hope
something here is useful, or at least interesting.
I'm going to use this to redefine "are" in clojure.contrib.test-is.
Later,
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message becau
Yep, it is:
(name symbol)
-Stuart Sierra
On Dec 15, 5:34 pm, Paul Reiners wrote:
> Is there anything in Clojure that is equivalent to Common Lisp's
> symbol-name function?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Thanks for the report, walterc. Fixed now -- I'd accidentally deleted
a big chunk of the macro.
-Stuart Sierra
On Dec 16, 1:18 am, walterc wrote:
> the template function is missing parameter binding part of a let
--~--~-~--~~~---~--~~
You received this
Fixed now (rev. 311), thanks for the report.
-Stuart Sierra
On Dec 16, 12:42 am, Allen Rohner wrote:
> In recent versions of test-is, it appears that exceptions are only
> caught inside of the 'is' macro, as opposed to during the whole test
> run. This is a problem when r
oms in addition to agents. Then
you can use all the regular ref functions instead of "alter-cell".
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this gr
Thanks, Lennart. That works, although it took me a few minutes to
figure out why. (For the record, tree-seq returns a copy of its
argument as the first item in the sequence.) This also means that
(flatten "string")
;=> (\s \t \r \i \n \g)
I've put in a patch.
-Stu
Hi Randall,
The syntactic sugar forms are reader behavior, and occur too soon: at
read time, not macro expansion time.
Macros need to expand to real forms, not reader shortcuts.
Stuart
> Hi,
>
> A couple of days ago I was having a lot of trouble getting the
> (ClassName. ctor-a
time.
Is that right?
Stuart
> On Dec 16, 2:32 pm, Stuart Halloway wrote:
>> Hi Randall,
>>
>> The syntactic sugar forms are reader behavior, and occur too soon: at
>> read time, not macro expansion time.
>>
>
> Actually, the dot sugar is not reade
x27;~ns)))
Use case: Writing tests with Fact [1]. Tests are named with gensyms,
and I want to reload a set of tests without continuing to run outdated
versions of the tests.
Does this already exist? It not, is it useful enough to deserve a home
somewhere?
Cheers,
Stuart
[1] http://groups.goog
I would find this useful; I've even tried writing it in the past.
Perhaps it could go in clojure.contrib.ns-utils.
A thought -- would it be more thorough to use "remove-ns"?
-the other Stuart (Sierra)
On Dec 16, 4:32 pm, Stuart Halloway wrote:
> Hi all,
>
> I some
Something flakey there. I clicked the star several times and nothing
happened. I then checked in Firebug that the star is backed by
JavaScript, and when I tried it again it worked. Odd.
Randall, let me know if you need anything else upvoted. :-)
Stuart
> On Wednesday 17 December 2008 06
ariable number of
arguments?
Answer: The variable arguments are actually just an array:
(.method object fixed-args... (into-array type variable-args...))
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&qu
, Enumerables, or some weird collection that doesn't
implement java.util.Collection, then all bets are off.
For code related to traversing a structure, look at clojure.core/tree-
seq and clojure.contrib.walk.
-Stuart Sierra
On Dec 17, 11:14 am, Itay Maman wrote:
> Hi,
>
> I am t
(testing.clj:4)
expected: (= (+ 2 2) 5)
actual: (not= 4 5)
Ran 3 tests containing 7 assertions.
1 failures, 0 errors.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" gro
t's a good FAQ suggestion, Kev. With the latest release, it's even
shorter!
1. Download clojure_20081217.zip
2. Run java -jar clojure.jar
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
&quo
FYI, I noticed that the readme.txt in the release still says to run
with clojure.lang.Repl, when all you need now is:
java -jar clojure.jar
-Stuart Sierra
On Dec 18, 8:46 am, Rich Hickey wrote:
> I've cut a new release, 20081217, which is available from Google Code:
Make sense? This is roughly equivalent to
(map (fn [x y] (is (< x y))) [[5 7] [8 10]])
but it happens at compile time.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" grou
surprised me.
Should assert return its value? If not, what should I name the
function that works just like assert but returns its value?
Stuart
> At the moment assert macro accepts only a single argument - a test. If
> the test fails (is false), an exception is thrown. But th
most of the rest of the day (East Coast US) if
anybody wants to discuss testing Clojure and Contrib.
Cheers,
Stuart
[1] http://code.google.com/p/clojure-contrib/source/detail?spec=svn317&r=317
--~--~-~--~~~---~--~~
You received this message because you
side effect [2].
Should macros written by ordinary mortals follow PG's rule? If not,
should this be listed as a difference from other Lisps at [3]?
Stuart
[1] http://www.paulgraham.com/onlisp.html. Free download, see
discussion in 10.3.
[2] http://paste.lisp.org/display/72406
[3] http://c
-S
On Dec 19, 2:05 pm, Stuart Halloway wrote:
> According to Paul Graham's On Lisp, macroexpanders should be purely
> functional, and you should not count on how often a macro gets
> expanded. This seems like a reasonable restriction for Clojure too.
> However, Chouser poste
/clojure/classes"
And it doesn't obey the system property used by clojure.lang.Compile:
java -Dclojure.compile.path="/tmp/classes" -cp /tmp/
classes:clojure.jar clojure.main
Clojure
user=> *compile-path*
"/Users/rich/dev/clojure/classes"
-Stuart Sierra
--~--~-
(ns foo.bar
(:use my.little.lib)
(:require clojure.contrib.duck-streams)
(:import (java.io File InputStream))
(:refer clojure.set))
":require" also allows aliasing, like this:
(ns foo.bar
(:require [clojure.set :as set]))
Now you can write the symbol "clojure.set/union"
#x27;t compile if it's not in tail position, so you know
you're doing it right.
Leaving that aside, I actually find loop/recur more intuitive than
Scheme-style "helper functions." It really gets down to the essence
of what a loop is.
-Stuart Sierra
--~--~-~--~~---
ing them access to everything used/imported in the top-
level "ns".
I forgot whether the arguments to (:load ...) need slashes at the
beginning. Either way, they're inside CLASSPATH.
Ok, that was a lot; I hope some of it made sense.
-Stuart Sierra
--~--~-~--~~-
explicit recur, given the alternatives.
Cheers,
Stuart
> On Dec 20, 3:20 pm, verec
> wrote:
>> Though I wonder how complicated it would be to "coalesce" any such
>> set of mutually recursive functions into a single "JVM method" where
>> such &quo
Whoops, looks like contrib.enum doesn't work with the new AOT-
compilation. I wrote it, so I'll take a look, but for the mean
time... don't use it. :)
-Stuart Sierra
On Dec 21, 12:56 am, Andrew Baine wrote:
> Any help is much appreciated:
>
> user> (require :ve
Hi Bill,
I think "compile" calls "load-lib", or something like that, so it
assumes there's a source file somewhere.
-Stuart Sierra
On Dec 21, 3:19 pm, ".Bill Smith" wrote:
> Is this a valid thing to do from the REPL?
>
> $ java -jar clojure.jar
&
l dispatch correctly?
Yeah, I love (expt 2 64) as a Common Lisp parlor trick. I've thought
about trying to write a Clojure "pow", but I don't know enough about
the algorithms involved. How do you compute something like 25/9 to
the power of 3/2?
-Stuart Sierra
--~--~
a name,
which is a symbol.
"Symbols and keywords have two parts: a namespace part, which may be
nil or a string; and a name part, which is a string."
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
n. Try this:
user=> (doseq [word (list "one" "two" "three")] (println word))
one
two
three
nil
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" gro
m setting up Clojure,
clojure-contrib, SLIME, swank-clojure, clojure-mode, and paredit.
Step 1: prepare a space
cd /Users/stuart/Projects
mkdir clj
cd clj
Step 2: get the latest sources of everything
svn checkout http://clojure.googlecode.com/svn/trunk/ clojure
svn che
On Dec 23, 6:30 am, Konrad Hinsen wrote:
> > Or change
>
> >
>
> > to
>
> >
>
> Thanks, that works fine. Is there a reason not to apply this change
> to clojure-contrib?
Fixed in SVN rev. 328. Also changed fr
it's not followed consistently. Go with what feels
good. :)
> Is there a way I could prevent them from being changed later?
Not really, you can always re-def.
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscr
If you guys can get these changes sorted out quickly (next few weeks)
I would love to cover them in the book. No pressure. :-)
Thanks,
Stuart
> On Mon, Dec 29, 2008 at 9:12 PM, Larrytheliquid
> wrote:
>>
>> This is what I'm thinking, let me explain: http://gist.gith
e compiler.
One last thing: it seems to be often overlooked that the "is" macro
can take a second argument, a doc string:
(is (= 4 (+ 2 2)) "two and two make four")
That doc string will be included in failure reports. If I add doc
str
FAIL in (my-tests) (NO_SOURCE_FILE:1)
Arithmetic with integers should work
expected: (= 5 (+ 2 2))
actual: (not= 5 4)
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
nil
user>
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are
-male (h-female (dec n))
(def h-male (memoize h-male))
(def h-female (memoize h-female))
(def h-male-seq (map h-male (iterate inc 0)))
(def h-female-seq (map h-female (iterate inc 0)))
Stuart
--~--~-~--~~~---~--~~
You received this message because you are subsc
Java arrays are mutable. If you pass them around, everything in
Clojure that relies on the assumption of immutability stops working.
How big is your array? Does the Java API continue to hold on to it?
Stuart
>> From http://clojure.org/java_interop#toc27 :
>
> "Clojure supp
finedInInterface [this arg1 arg2 ...]
...)
Note: defn names for functions defined in the interface begin with
"-". Remember every method takes an extra "this" argument.
To generate the .class file, use "(compile my.cool.library)" or
clojure.lang.Compile.
-Stuart Sierra
Since there has been so much back-and-forth about the Clojure snake, I
decided to write one [1]. Like Mark, my goal is to create a readable
version, but the details are quite different.
I plan to use this as the code example for the Swing section in the
book. Feedback welcome.
Stuart
[1
On Mon, Jan 5, 2009 at 11:37 AM, Christophe Grand wrote:
> Stuart,
>
> Do you think rec-cat, rec-cons and reductions belong to seq-utils?
>
> Christophe
>
Find by me. I won't claim ownership over seq-utils or str-utils. As
far as I'm concerned, any contrib committe
1 - 100 of 2322 matches
Mail list logo