Cameron Pulsford wrote:
Is there a way to do this? Besides cleaning up function signatures is
this a premature optimization to begin with?
(declare *macros*)
(defn macro-expand [tokens]
(map #(get *macros* % %) tokens))
(defn compile-op [op]
(macro-expand op))
(defn assemble
On Aug 9, 7:54 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hello everyone,
Just for educational purposes, I'm writing a simple lisp compiler and
am stuck on a small problem.
I'm trying to write a function called (compile-function), which will
take a function as input and compile it.
On May 31, 10:35 am, alux alu...@googlemail.com wrote:
[ ] A special form is what can be implemented by a macro.
That depends. My understanding is that a special form is something
that is fundamental to the language, that the evaluator handles as a
special case. That is, they need to be
On May 30, 12:32 am, Daniel Borchmann
daniel.borchm...@googlemail.com wrote:
The same happens if i goes up to 100, 1000, ... Is this a bug or is
this a fundamental misconception of mine?
You're using them wrong. Transients are not imperative data
structures. You need to capture the return
On May 18, 2:23 am, Base basselh...@gmail.com wrote:
(defn lazy-date-seq [d1 d2]
(let [start (- d1
(.dayOfMonth)
(.withMinimumValue))]
(lazy-seq
(cons start
(if (joda/before? start d2)
(lazy-date-seq (.plusMonths start 1)
On May 11, 11:18 am, Donell Jones alliwantisca...@googlemail.com
wrote:
Hi Team,
I am really interested in functional programming. But I am asking
myself, what if the project get bigger, like the software Runa realise
with Clojure. In OOP we got diagrams like UML to visualise this. But
what
On May 4, 10:40 pm, Bryce fiat.mo...@gmail.com wrote:
I have a macro, deriv, that produces an expression, and I'd like to
create another macro that turns this into a function. So far I have
(defmacro deriv-fn [fn-args exp v degree]
`(fn ~fn-args (deriv ~exp ~v ~degree)))
Which of
On May 2, 11:14 pm, Mike Meyer mwm-keyword-googlegroups.
620...@mired.org wrote:
On Sun, 02 May 2010 13:06:56 +1000
To get behavior similar to the vector constructs, you want to use
list, which works like vector, except returning a list instead of a
vector: (list 1 2 3 (print :hello)). It
On Apr 28, 5:00 am, Richard Newman holyg...@gmail.com wrote:
Opinions, thoughts, critiques, you're insanes, etc. welcome.
The patches look fine to me and the change is well justified since you
have a real use case. I don't think restricting deftype to final
classes would serve any real
*clojure-version*
{:interim true, :major 1, :minor 1, :incremental 0, :qualifier
alpha}
Looks like you have some old version of 1.1 prior to release. The
release version of 1.1 shouldn't have the alpha qualifier.
Try upgrading.
--
You received this message because you are subscribed to
On Apr 19, 1:17 pm, Joel Gluth joel.gl...@gmail.com wrote:
(def floatarray (make-array Float/TYPE 2))
(for [i (range (alength floatarray))] (aset floatarray i (float ([1 2]
i
You can just do (into-array Float/TYPE [1.0 2.0])
There is no need to explicitly cast the vector items as they
On Apr 16, 11:59 am, Bytesource stefan.rohlf...@gmail.com wrote:
Hi,
I am currently reading Programming Clojure but got stuck at the
destructuring done in the head-overlaps-body? function call that is
part of the snake game:
(defn head-overlaps-body? [{[head body] :body}]
(includes?
On Apr 16, 5:25 pm, Asim Jalis asimja...@gmail.com wrote:
It does conform to the pattern that the bound variable precedes the
value to bind in forms like let. A benefit of this ordering is that
destructuring patterns like {:keys [a b c]} are unambiguous.
Hi Per,
Could you explain the
Hopefully you can see that this syntax falls out of the direct construction
of maven Model object, unmediated by intermediate syntax or data structuring.
So there's a good reason for the way it looks.
Right. Thanks for the thorough explanation. It's not so bad if you
quote the vectors
On Apr 6, 8:16 am, Zach Tellman ztell...@gmail.com wrote:
Possibly this fall out from the latest commit requiring an explicit
'this' reference (ba6cc3b), I haven't checked any versions but the
most recent.
user (defprotocol Protocol (f [a b c]))
Protocol
user (def p (reify Protocol (f [a
On Apr 7, 12:25 am, Sophie itsme...@hotmail.com wrote:
Just curious
- what folks think of fixed-positional-keyword params
- whether it was considered for Clojure
I don't know for certain whether Rich ever considered smalltalk-style
parameters, but I doubt it.
I do like them, though; in
The def was for legibility (or I was going for legibility). Speaking
of redefing, is there a way to block a redef so I or someone else
doesn't monkey-patch a function?
You can set a validator on the Var to prevent accidents. However,
someone who really wants to redefine a function can just
Specifically, I prefer to define the important components of my
software as Java interfaces. Partly to see myself think, partly
because it just makes more sense to me. I then want to implement these
interfaces using gen-class and clojure functions and pass resulting
objects as function
On Mar 29, 1:26 am, strattonbrazil strattonbra...@gmail.com wrote:
Is this the common way to do it?
(def sister (assoc brother :name Cindy))
Please note that actually def'ing each value is not what you're
supposed to do :) def is reserved for global constants and dynamically
rebindable
On Mar 26, 8:53 am, Per Vognsen per.vogn...@gmail.com wrote:
It's not semantic nitpicking. There's a clear-cut difference a piece
of reusable code with a function that can be called to generate a
bundled Windows installer based on a set of arguments versus something
that only works as part
This looks neat. I probably won't find much use for it though, as my
input method already has this functionality, and even that doesn't get
much use due to the fact that I am horrible at writing kanji with the
mouse (I'm left-handed, but my mouse-hand is right.)
If you have no plans to try to
jfr wrote:
Hello,
I've just started to play a little bit with clojure to get a feel for
the language. It seems to be quite interesting (and it's a relief to
leave my clumsy IDE behind and use Emacs). Concerning immutable data:
Is the following code ok or should (must) I use transients as
On Mar 19, 6:53 pm, Andrzej ndrwr...@googlemail.com wrote:
I've been toying with various implementations of reduce-like
functions, trying to do something smarter than a simple iteration
over a collection of data. This hasn't worked out very well, my
implementation is a lot (~50x) slower than
On Mar 20, 1:52 pm, Glen Rubin rubing...@gmail.com wrote:
Hey all,
I am working through the problems on project euler. On question
number 11 (http://projecteuler.net/index.php?section=problemsid=11),
I was unable to come up with a solution, so I cheated and looked at
some other people's
On Mar 17, 1:17 am, Steven E. Harris s...@panix.com wrote:
Michał Marczyk michal.marc...@gmail.com writes:
a State-using programme builds up a stateful computation first, then
uses runState (or perhaps execState / evalState) to run it as a whole;
only at this final step does the initial
What would be lost by defining Clojure bind operator like this:
(fn m-bind-state [mv f]
(fn [s]
(let [[v ss] (mv s)]
(f v ss
Is there more to it than, Monadic functions must return monadic
values.
My first thought was that it would be problematic for the result
*facepalm* I should've known GG was just hiding the post from me.
--
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
Is there more to it than, Monadic functions must return monadic
values?
Any clarifying advice would be welcome.
Gah, I already wrote a reply, but looks like I lost it somehow. To
summarise:
I think one of the main benefits of the monad abstraction is the
uniformity of all monads. ie. all
On Mar 3, 7:47 pm, cageface milese...@gmail.com wrote:
I've been reading through the examples of OO in clojure using multi-
methods and they certainly seem very flexible and powerful. I'm
wondering, however, how people handle interface library design. If
people can implement objects as maps,
On Mar 1, 9:55 am, Richard Newman holyg...@gmail.com wrote:
(defn house-sale-profit
[house-sales-price house-sale-expenses]
(- house-sales-price house-sale-expenses))
I'd like to note that if you do this, you might just as well use the -
function directly. It's not as flexible
On Feb 28, 4:03 pm, Heinz N. Gies he...@licenser.net wrote:
How about reducing it?
Something along the limes of: (not tested)
(reduce (fn [lists number]
(update-in lists [
(if (odd? number)
(if (= 0 (mod number 5) :odd-5 :odd)
(if (= 0 (mod number
On Feb 28, 7:36 pm, reynard atsan...@gmail.com wrote:
Perhaps my choice of function names (abstract and concrete) for my
original post is not very appropriate. I did not mean to apply the OO
concept of abstract class, abstract methods, etc. Since it seems that
my original post did not
On Feb 27, 9:10 pm, reynard atsan...@gmail.com wrote:
This may be more about functional programming in general, rather than
clojure specific. However, since I mainly use clojure for learning
functional programming, I would like to discuss it here.
Basically, I can think of the following 2
On Feb 25, 12:17 am, joshua-choi rbysam...@gmail.com wrote:
When it comes to distinguishing certain types of symbols from other
things, should one use prefixes or suffixes?
Whichever makes more sense, of course. :)
Example: naming tests with clojure.test/deftest. If you distinguish
your
On Feb 23, 10:47 am, Alfred Tarski atar...@gmail.com wrote:
Hi,
I have this function:
(defn wrap [x]
(str % x %))
and I do
bf= (str boo hoo (map wrap [fdfd ggfs]))
boo hoo clojure.lang.lazy...@9e050eb0
This looks odd to me, but if the powers that be consider this to be
the right
But surely in this case you could do:
(defn print-info []
(let [[src dst] (dosync [...@source-account @dest-account])]
(println src)
(println dst)))
or maybe:
(defn print-info []
(let [[src dst] (dosync
(ensure source-account)
On Feb 16, 12:26 pm, alux alu...@googlemail.com wrote:
Hello,
the current state of Conway's Prime Machine is athttp://paste.lisp.org/+21BR
Instead of using a quoted list, a vector is more idiomatic in Clojure.
I'l go on learning. The next state should be seperation of print and
produce.
On Feb 16, 8:27 pm, Yaron ygol...@gmail.com wrote:
Sean and Richard perhaps I can address both of your mails in a single
go. Here is an example of one of the functions from my calculator:
(defn tax_deductible_expenses
The total expenses incurred in business month m that are
On Feb 15, 12:03 pm, Аркадий Рост arkr...@gmail.com wrote:
oh wait...I take a look on binding and with-binding*
realesation.http://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9a...
Why with-binding* function wasn't write like this:
(defn with-bindings*
[bindings f args]
On Feb 8, 3:22 am, Stuart Halloway stuart.hallo...@gmail.com wrote:
IMO Anything that implements IDeref should adhere to Clojure's vision
for identity, e.g. reads need to be thread safe, cheap, require no
coordination, and block no one.
Dereferencing futures or undelivered promises block
On Feb 1, 3:16 pm, Timothy Pratley timothyprat...@gmail.com wrote:
On 1 February 2010 09:32, Wardrop t...@tomwardrop.com wrote:
Could someone step me through the idea behind the -main function
(which I've also seen written as just main without the hyphen).
Is -main special in any way, or
You should really give paredit.el a go some time. It feels silly to
worry about matching parentheses nowadays.
That aside, I am supportive of any improvement in either compiler or
reader error messages.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
On Jan 24, 6:40 am, CuppoJava patrickli_2...@hotmail.com wrote:
Thanks for the reply. That seems to match well with how I thought they
were supposed to work.
I'm just a little confused by the
set!, with-local-vars, functions. What are they supposed to be used
for?
-Patrick
Vars are
On Jan 12, 11:08 am, Gabi bugspy...@gmail.com wrote:
What's the idiomatic Clojure way for extracting values/keys from a
binding form vector [key1 val1 key2 val2..] ?
I suppose that depends on what you want, but:
(apply hash-map keyvals) to make a map or
(map first (partition 2 keyvals)) (map
On Jan 6, 2:21 am, Mark Derricutt m...@talios.com wrote:
Is there likely to be a RELEASE version of clojure-contrib 1.1.0 in
the maven repo to match clojure 1.1.0 at all?
The lack of a release build prevents using the maven release plugin to
run with any project using it :(
Also - if
On Dec 11, 11:14 am, ngocdaothanh ngocdaoth...@gmail.com wrote:
Because of indents, my previous Clojure code lied to my eyes that x,
y, f, g are not at the same block level. This is my difficulty with
Clojure. In short, I can't see a rough algorithm from any Clojure code
any more just by
((comp negate inc) 6) - -7
Hm, I was sure negate existed... But seems like it doesn't.
Oh well. (comp - inc) works. :)
--
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
I just noticed that the API link on the clojure web site brings up
documentation for the master branch of Clojure instead of 1.0.0. I
can't find the 1.0.0 docs anywhere either.
This is obviously a problem for 1.0.0 users, since the docs refer to
features that don't exist.
I think it would be
Jeff Dik wrote:
The part Running code at read-time lets users reprogram Lisp's
syntax caught my attention. Is this talking about reader macros? I
believe I read that clojure doesn't have reader macros, so would it be
more accurate to say The whole language is there, _most_ of the
time?
On Dec 3, 6:15 am, lazy1 miki.teb...@gmail.com wrote:
Hello,
I'm trying to create a factory method for Java classes, however I'm
doing something wrong.
(import '(java.util Dictionary HashMap))
(def *containers* { :dict Dictionary :hash HashMap})
(defn new-container
[type]
(new
On Nov 19, 11:52 am, Gabi bugspy...@gmail.com wrote:
This would solve the holding to the head problem.
Many times, lazy-seq would be used without the need to get the same
cell twice.
In this case, avoiding cashing would both enhance performance and more
importantly would avoid
On Nov 14, 8:08 pm, gun43 bg-561...@versanet.de wrote:
Using r1366 under Win XP.
r1366? From Subversion? That's ancient. Clojure moved to git ages ago;
see
http://github.com/richhickey/clojure
A user defined function:
1:27 user= (defn plus2 [x] (+ x 2))
#'user/plus2
1:28 user= (plus2 5)
On Nov 13, 9:13 am, Krukow karl.kru...@gmail.com wrote:
I was thinking this may make syntax irregular. I suspect this is a
deliberate design choice to distinguish clojure protocols from java
interfaces? Is this the case?
As far as I understand it, in defprotocol's case, I suspect there is
no
On Nov 3, 2:03 am, CuppoJava patrickli_2...@hotmail.com wrote:
Thanks Brian.
For my own purposes, yes I have no need for a break or return
statement.
But I'm writing a DSL for others to use. People that don't have
experience with functional programming, and for them it's easier to
have a
But whilst this is useful, this doesn't really demonstrate why macros
are so powerful. Macros are useful because they automatically
rearrange your source code into something else. They're most similar
to the Ruby 'eval' function, but operate of data structures rather
than strings.
Nitpick,
On Oct 19, 5:52 pm, Peregrine stiebs...@gmail.com wrote:
Hey I am new to Clojure and I am doing some Project Euler problems to
help me get started with the language. I've run into a issue I cannot
seem to get past. I have this code:
(defn findFib
Find the sum of all the even-valued
On Oct 17, 10:32 am, Timothy Pratley timothyprat...@gmail.com wrote:
But name is multiply evaluated. This might be preferable:
Hi John,
Could you explain this a bit more for me? I can understand if the
condition is duplicated that is unnecessary calculation but don't
appreciate the issue
On Oct 16, 5:44 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote:
What's the rule of thumb for deciding whether a function name should
end with an exclamation point? I thought maybe it was when the
function modifies its first argument, but it seems there are functions
that do that and do not
On Oct 8, 5:01 am, Allen Rohner aroh...@gmail.com wrote:
Hello, I'd like to announce the availability of a new library, called
Scriptjure. It's a macro that generates javascript strings from
Clojure s-exprs. My initial use for it is in glue code for Clojure
webapps. For example:
(js (fn
On Oct 1, 9:18 pm, timc timgcl...@gmail.com wrote:
snip
(def prx (proxy [IX][]
(doit
([] (doseq [x someSeq] (doit x))
([y] (print y
When I tried something of this form, it looks like the call of the 1-
arg function from the 0-arg function can't be resolved.
Thanks in
On Sep 28, 12:13 pm, Michael Wood esiot...@gmail.com wrote:
Hi
2009/9/26 gerryx...@gmail.com gerryx...@gmail.com:
(defn float2 [f a b]
(f (float a ) (float b)))
(float2 + 1 2) = 3.0
(defmacro mfloat2 [f a b]
(f (float a) (float b)))
(mfloat2 + 1 2 ) = 2.0 ??? macro
On Sep 24, 11:01 am, Miron Brezuleanu mbr...@gmail.com wrote:
Hello,
I find that I tend to name struct instances like the struct. For instance,
(defstruct person :name)
and then
(let [person (struct person John)]
)
which breaks further use of (struct person ...) in that let.
Is
On Sep 22, 2:23 am, Jung Ko koj...@gmail.com wrote:
Hi,
Can someone teach me how I can override the toString method for a struct ?
Here's a code snippet that shows what I'm trying to do:
user (defstruct bookinfo :book :filename)
user (struct bookinfo hello world) = {:book hello,
On Sep 22, 3:58 pm, Roman Roelofsen roman.roelof...@googlemail.com
wrote:
Hi there!
Lets assume I have this map:
user= (def person {:name Father :childs [{:name Son :age 10}]})
Testing:
user= (- person :childs first)
{:name Son, :age 10}
Now lets filter the child map:
user= (def
On Sep 21, 4:38 pm, Roger Gilliar ro...@gilliar.de wrote:
I still have some problems to correctly understand the dosync
semantic. What happens exaclty if two threads try to modify the same
list:
Nitpick: you're not modifying any lists. :) The only mutating things
are the Refs
On Sep 21, 6:53 pm, patrickdlogan patrickdlo...@gmail.com wrote:
I expected a delay only to be forced by an explicit call to force.
instead it looks like, being a kind of IDeref, a delay will be forced
by the REPL.
e.g.
user= (def del (delay (println printed) (+ 2 3)))
#'user/del
user=
On Sep 18, 10:52 pm, Patrik Fredriksson patri...@gmail.com wrote:
Hi!
Could someone please help me understand why the following causes a
java.lang.OutOfMemoryError: Java heap space for large n:s (10
works fine, 100 does not).
(def integers (iterate inc 1))
(defn limited-reduce
On Sep 17, 7:33 pm, Gorsal s...@tewebs.com wrote:
Basically i need to redefine the meaning of a special form. While i am
willing to change the name for things like ns to defpackage, i am not
willing to change the name of forms like apply and defn to achieve my
goals. Instead, i would like
On Sep 15, 6:54 pm, Gorsal s...@tewebs.com wrote:
I was just wondering about the unwind-protect form, I've heard that it
doesn't protect against certain types of exits, but what exactly are
these exits? I've heard return, break, and continue statements said
but i can't seem to find these
On Sep 13, 2:43 am, jng27 jgran...@gmail.com wrote:
http://jng.imagine27.com/articles/2009-09-12-122605_pong_in_clojure.html
Neat. I have some suggestions though.
1) I think you use too many refs. the sx, sy, etc. could all be
replaced with a simple
(defstruct position :x :y)
(def
On Sep 4, 11:22 am, Krukow karl.kru...@gmail.com wrote:
I was thinking about the capability of changing production systems on
the fly. E.g. by having an accessible repl in a running production
system.
If you have a bug in a function, you can fix it by re-def'ing it -
that is great. However,
On Sep 3, 9:24 am, Miron Brezuleanu mbr...@gmail.com wrote:
Hello,
I'm a Clojure newbie (many thanks to Rich Hickey and everyone involved
- it's a great programming environment) and I have some trouble with
'eval'.
What I'm trying is:
$ java -cp clojure.jar clojure.lang.Repl
Clojure
On Sep 3, 3:42 pm, ngocdaothanh ngocdaoth...@gmail.com wrote:
Hi,
In Rails you can create a view like this:
my_view.erb:
%= hello + @name %
I'm new to Clojure. I want to create something like the above like
this:
(defn my-view []
(str hello name))
The point is:
* name is not
I'll submit a patch if it's wanted. This would fit in core, or maybe
contrib.duck-streams with a slightly different name.
This should be in core I think, so that it can work with with-open—
unless we're going to duplicate with-open in contrib. :/
--
Jarkko
On Aug 25, 1:47 pm, Dragan Djuric draga...@gmail.com wrote:
I needed a macro if I wanted to avoid ' in calls. It may seem as
nitpicking but (to-keyword name) is more readable and less error prone
than (to-keyword 'name) if I need to use it in lots of places.
If that's all you do, then the
On Aug 22, 5:56 am, jng27 jgran...@gmail.com wrote:
Took a shot at implementing PI in Clojure using a reasonably fast
algorithm.
So why is it so slow ? Is BigDecimal just that bad ? Would fixed point
arithmetic be better using BigInteger ?
Hmm, my impression is that the java boxed numbers
On Aug 22, 1:51 pm, jng27 jgran...@gmail.com wrote:
This updated version is 2x as fast as the previous version :
(import 'java.lang.Math)
(import 'java.math.MathContext)
(import 'java.math.BigDecimal)
(defn sb-pi [places]
Calculates PI digits using the Salamin-Brent algorithm
and
On Aug 16, 12:02 pm, botgerry botge...@gmail.com wrote:
Hello,all
I'm new to functional programming,want to know how to address nested
inner seqs in clojure
(def a [[1 2 3 4] [ ok metoo] [ 5 8 9 ]])
1: searching in a, if find one inner vector includes number 9 then
append it a number 13
Nicolas Oury wrote:
Dear all,
I try to write a program where I access a java array of non primitive
and realize aget is very slow.
(6x slower than the same program with clojure vectors instead of java
arrays access)
I tried a few combinations of type hints but can't manage to prevent mty
I'm in favour.
Though, I think that a def- would be redundant if the defvar macros
are promoted. Perhaps it would be sensible to keep def as a the
underlying special form and just move in defvar, defvar- and
defmacro-.
I'm not sure whether defonce is useful enough that it should be moved
to
On Aug 14, 10:51 pm, Sean Devlin francoisdev...@gmail.com wrote:
I'd start with you usage docs
;; usage:
;; (filter-collecting
;; (fn [x y] ( x y))
;; (fn [x y] (+ x y))
;; [1 7 3 9]
;; [5 5 5 5])
;; == (6 8)
;; usage:
;; (filter-collecting +
;; [1 7 3 9]
;; [5 5 5 5])
fft1976 wrote:
On Aug 13, 9:57 pm, Daniel Lyons fus...@storytotell.org wrote:
the code is open source and the techniques for adding
optimizations to compilers are well known. So marshall your impulses
for the good and we'll all benefit.
It does seem that the optimizations Andy
On Aug 10, 12:41 pm, fft1976 fft1...@gmail.com wrote:
I just uploaded to the group an implementation of the n-body benchmark
in Clojure (see nbody_init.clj)
http://shootout.alioth.debian.org/u32/benchmark.php?test=nbody〈=j...
My goal was to write a pure-functional version and to avoid any
On Aug 4, 11:08 am, Jonas jonas.enl...@gmail.com wrote:
Hi
I'm playing with the new transient/persistent! features in Clojure. I
have implemented quicksort as described on wikipedia (http://
en.wikipedia.org/wiki/Quicksort#Algorithm). Here is the code:
(defn swap-index! [v i j]
(let
Chad Harrington wrote:
I have a newbie question about anonymous functions. Why does the first form
below work and the second form does not?
user ((fn [] foo))
foo
user (#(foo))
; Evaluation aborted.
fn and #() are not interchangeable. In the first example, you simply
return foo.
On Aug 2, 2:12 am, Meikel Brandmeyer m...@kotka.de wrote:
(defmacro with-chosen-file
Opens a file chooser, binds the result the user chose to the given
variable name and executes the body. In front of the body there might
be two options given:
:directory is the initial
user= (macroexpand-1 '(let-coll [a b c] {:a 1 :b 2 :c 3} (println a b
c)))
(clojure.core/let [val-fn__23 {:a 1, :b 2, :c 3}
a (val-fn__23 :a)
b (val-fn__23 :b)
c (val-fn__23 :c)]
(println a b c))
On Jul 15, 1:54 pm, Jan Rychter j...@rychter.com wrote:
I've been looking for a function that would take a seq and create a list
(a real clojure.lang.PersistentList), but haven't found one. The closest
I got was:
(apply list my-seq)
Essentially, I'm looking for something similar to (vec)
On Jul 14, 6:58 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Namespace-wide fixtures (once-fixtures) are easy -- they should just
run around the top-level test function. That's something I can fix,
and it will be sufficient for your example.
But per-test fixtures (each-fixtures)
On Jul 14, 10:04 pm, bgray graybran...@gmail.com wrote:
I'm not sure if this is a binding issue or not.
user= (def a 1)
#'user/a
user= (binding [a 3] (filter #(= % a) '(1 2 3)))
(1)
user=
In this case, I was expecting a list with 3 in it.
This is a common gotcha. It's actually a
On Jul 13, 1:39 pm, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
Hi :
I would like to simulate a simple database with the STM of clojure.
The rules are
1. There can be many rooms, and each room has its own attirbute
2. One room contains many people, and each person has its own
On Jul 11, 6:01 pm, Robert Campbell rrc...@gmail.com wrote:
Hey guys,
I'm just curious why Christophe chose to return seq instead of a str
for Enlive for his template functions.
Example:
(deftemplate my-page-transformation index.html [message style]
[:style] (content style)
[:h1]
snip
Shawn Hoover wrote:
For example, Java doesn't have language support like C#'s using statement
for executing some block of code and deterministically cleaning up an object
at the end. You could implement that as a function (in many languages) and
call it like this:
(defn do-and-close [o
On Jul 6, 7:51 am, Timothy Pratley timothyprat...@gmail.com wrote:
Very glad that test is now part of clojure core.
I've run into 2 strange behaviours when trying to write tests where
threads are involved. My case is a little complex so here is a minimal
version which shows what I mean:
On Jul 6, 1:26 pm, philip.hazel...@gmail.com
philip.hazel...@gmail.com wrote:
On Jul 5, 10:31 pm, Mark Triggs mark.h.tri...@gmail.com wrote:
(defn bi-get-pixels
[#^BufferedImage bi]
(let [raster (.getData bi)
pixels (.getPixels raster 0 0 (.getWidth bi) (.getHeight bi)
On Jun 29, 6:14 pm, John D. Hume duelin.mark...@gmail.com wrote:
There may already have been a discussion about this in IRC, but I
would have loved to see the 'are' macro continue to support the old
syntax (maybe with deprecation warnings) as well as the new until
after 1.1 is released.
On Jun 28, 8:53 am, Handkea fumosa hfum...@gmail.com wrote:
(defn foo [z-r z-i c-r c-i bailout max-iters]
(let [G__12819 (double c-r)
G__12820 (double c-i)
G__12817 (double -1)
G__12818 (double 2)
mi (int max-iters)
b (double (* bailout bailout))]
On Jun 27, 3:23 am, _hrrld hhaus...@gmail.com wrote:
Hi,
I'm trying to use lazy-seq to implement a cool piece of functionality
I saw in the Factor programming language. Here is the documentation
for that
functionality:http://docs.factorcode.org/content/word-produce,sequences.html
I think
On Jun 27, 3:23 am, _hrrld hhaus...@gmail.com wrote:
Hi,
I'm trying to use lazy-seq to implement a cool piece of functionality
I saw in the Factor programming language. Here is the documentation
for that
functionality:http://docs.factorcode.org/content/word-produce,sequences.html
I
On Jun 25, 9:51 am, michael frericks michael-freri...@web.de wrote:
Hello,
i am a little bit lost about the roadmap of clojure 1.1. Is there
anywhere an (evolving) list available of
a) new features planned,
b) things that break Clojure 1.0
c) and maybe removed features?
You could take
1 - 100 of 112 matches
Mail list logo