Oh, yeah. Silly me, I *can* do that.
Thanks a lot. It works like a charm now.
On Feb 8, 2:17 am, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 08.02.2009 um 00:40 schrieb samppi:
(defn conc* [tokens subrules]
(loop [subrule-queue (seq subrules), remaining-tokens (seq tokens
phase. What is the pattern for what is
allowed or prohibited in macros?
On Feb 13, 10:52 pm, Chouser chou...@gmail.com wrote:
On Fri, Feb 13, 2009 at 11:17 PM, samppi rbysam...@gmail.com wrote:
I'm trying to write a macro that expands from this:
(product-context [n rule0, m rule1)]
(rule
What would I do if I wanted this:
[[a0 a1 a2] [b0 b1 b2] ...] - [[a0 b0 ...] [a1 b1 ...] [a2 b2 ...]]
I could write a loop, I guess, but is there a nice, idiomatic,
functional way of doing this? I didn't spot a way in
clojure.contrib.seq-utils either.
While it's not the most important issue, I agree with CuppoJava about
Sequence vs Seq, while we're talking about names. This pair of
terms seems sort of arbitrary, and will probably cause a little
semantic pain and confusion to newcomers in the future. Is there a
better term than Sequence and Seq
, Feb 15, 2009 at 7:42 PM, David Nolen dnolen.li...@gmail.com wrote:
(map (fn [ rest] (apply vector rest)) [1 2 3] ['a 'b 'c] [cat dog
bird])
On Sun, Feb 15, 2009 at 7:16 PM, samppi rbysam...@gmail.com wrote:
What would I do if I wanted this:
[[a0 a1 a2] [b0 b1 b2] ...] - [[a0 b0
You can nest structs in structs like this:
(defstruct rect :height :width)
(defstruct colored-rect :color :shape)
(def subject (struct colored-rect :red (struct rect 50 30)))
(println subject) ; prints {:color :red, :shape {:height 50, :width
30}}
The defstruct macro takes a var and a bunch
Thanks a lot, everyone. Isn't
(reduce conj [] (apply map vector [[:a :b] [1 2] ['a 'b]]))
equivalent to
(into [] (apply map vector [[:a :b] [1 2] ['a 'b]]))
though?
On Feb 16, 3:55 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
And to get the enclosing vector:
(reduce conj [] (apply map
So I've downloaded the latest, lazier version of Clojure. But I'm
having trouble; there used to be a clojure.jar file in the folder, and
it's not there anymore. The distribution's readme.txt still says: To
Run java -cp clojure.jar clojure.lang.Repl, but I only see a
clojure.iml file.
Oh, of course. Thanks for the help.
On Feb 19, 2:22 pm, Vincent Foley vfo...@gmail.com wrote:
Run ant
On Feb 19, 4:00 pm, samppi rbysam...@gmail.com wrote:
So I've downloaded the latest, lazier version of Clojure. But I'm
having trouble; there used to be a clojure.jar file in the folder
For now, I do:
(dotimes [_ 3] (print Ho))
But I also think it would be a nice, natural addition.
On Feb 21, 3:07 pm, Timothy Pratley timothyprat...@gmail.com wrote:
+1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Allowing dissoc and select-keys to accept both keys as arguments and
as a collection would be nice, and backwards compatible. In any case,
ostensibly it should be consistent; otherwise, it's just an
idiosyncrasy in the language that people will have to deal with. I
wonder what the reasoning is
I see—that explains a lot.
On Feb 21, 5:01 pm, Rich Hickey richhic...@gmail.com wrote:
On Feb 21, 5:58 pm, samppi rbysam...@gmail.com wrote:
Allowing dissoc and select-keys to accept both keys as arguments and
as a collection would be nice, and backwards compatible.
Nope - Collections
A good summary is here: http://clojure.org/lazier
Note that all this has indeed been committed to the latest SVN of
Clojure. I think that most of clojure.contrib has been updated too.
On Feb 22, 1:32 pm, jim jim.d...@gmail.com wrote:
Is there a summary of the changes to Clojure that the lazy
It looks really nice. I have a question about those observers, though--
every time that a context-processing function is called, every
observer is called one by one, no matter what the context-processing
function was. This seems somewhat inefficient, more so than listeners
that listen to only
Yeah. Personally, I don't think they should stand out any more than a
struct basis needs to stand out.
(defstruct person :fname :lname)
(struct person Bob Joe)
(deferror parse-error {...})
(raise parse-error ...)
Defined errors are just variables in a namespace, whose siblings
include the
I like it; it's making me realize the existence of a bunch of
functions I've never considered before.
If it's practical, consider doing color-coding or somehow indicating
the types of the forms: special forms, macros, and functions. :)
On Mar 8, 6:30 pm, Mark Volkmann r.mark.volkm...@gmail.com
That's a great idea. I guess the easiest way to implement this is to
make it standard to include tags: at the top or bottom of a docstring:
(defn pmap
tags: parallel, map
Blah blah blah.
...)
(find-doc parallel)
---
(pmap ...)
tags: parallel, map
Blah blah blah.
That'd be a cool,
I wish I could do this:
(code...
Long error string that doesn't fit within 80 characters but is
descriptive, \
which is good, right?
...more code...)
(The string above would say, Long error string that doesn't fit
within 80 characters but is descriptive, which is good, right?)
-indent)
...more indented code)
On Apr 3, 11:35 pm, samppi rbysam...@gmail.com wrote:
I don't really want it so much for documentation strings—they're
already formatted in a standard way—than just being able to embed
large literal text in my code without making
Of course–it's good that Clojure does that. :) Along with the fact
that it's intuitive, docstrings are in a standardized style to print
nicely with (doc):
(defn foo
First line is wrapping around
and is indented by two spaces.
But this is only because (doc) allows for this,
indenting the
felt like using
in my program.))
This is a really long string
that I just felt like using
in my program.
-Stuart Sierra
On Apr 4, 11:26 am, samppi rbysam...@gmail.com wrote:
I see—perhaps using (str) would indeed be the best answer. I'll be
doing
In addition, it's a bad idea to have these two superficially similar
functions have the same name, file. If, in the end, both are to be
kept public, then I think they should at least be given different
names.
On Apr 6, 10:35 am, Victor Rodriguez vict...@gmail.com wrote:
Hello,
On Mon, Apr 6,
I've been whipping up a simple schema library for validating Clojure
data based on their tags, but I'm worried that what I'm doing might be
redundant with an already existing library. Is there something, such
as in clojure-contrib, that can do things similar to the code below
(note the
In this message (http://groups.google.com/group/clojure/msg/
d88d9319adfc41a6), Mr. Hickey mentioned a supported convention for
tagging, the :type metadata. I thought that this was the function of
the :tag metadata, though, which isa? and the hierarchy functions use.
What is the difference? Do
Let's say I have a sequence of integers:
(def a (3 9 1 5 102 -322 ...))
Is there a function for inserting an object—let's say :foo—after
elements that fulfill a certain predicate?
Furthermore, I mean inserting :foo after any block of elements that
fulfill it:
(mystery-function (partial 6)
Let's say I want to test if a Unicode character is within a certain
range, #x0-#x1F. What can I do?
(defn char-in-range? [minimum maximum testee]
???)
(def x \3)
(char-in-range? \u \u001F x) ; false
--~--~-~--~~~---~--~~
You received this message
Wonderful; thank you!
On Apr 25, 10:57 am, billh04 h...@tulane.edu wrote:
(defn char-in-range? [minimum maximum testee]
(let [int-testee (int testee)]
(and (= int-testee (int minimum)) (= int-testee (int maximum)
On Apr 25, 12:47 pm, samppi rbysam...@gmail.com wrote:
Let's
In the REPL:
Clojure
user= \u0032
\2
user= \u1
java.lang.IllegalArgumentException: Invalid unicode character: \u1
How would I embed the character as a literal in my Clojure code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed
I have a library called FnParse, and I'm wondering if I should rewrite
it using monads. (You can see FnParse's documentation at http://
wiki.github.com/joshua-choi/fnparse and its implementation at http://
github.com/joshua-choi/fnparse/blob/
Could someone give me a simple example of when
clojure.contrib.accumulators is useful? Its use seems to involve
collections (and numbers) that have the :clojure.contrib.accumulators/
accumulator type, and it has some general multimethods for adding and
combining, but what does it add that conj
Okay; thanks for the answer! I understand now.
On Apr 29, 11:52 pm, Konrad Hinsen konrad.hin...@laposte.net wrote:
On 29.04.2009, at 21:44, samppi wrote:
Could someone give me a simple example of when
clojure.contrib.accumulators is useful? Its use seems to involve
collections
I'm having trouble trying to create a macro that calls domonad with
one argument already filled in: (domonad parser-m rest-of-arguments).
parser-m is a monad defined in the same namespace. This is what I have
right now:
(defmacro complex
[steps product-expr]
`(domonad ~parser-m ~steps
30, 8:47 am, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 30.04.2009 um 17:39 schrieb samppi:
(defmacro complex
[steps product-expr]
`(domonad ~parser-m ~steps ~product-expr))
Just leave out the ~ in front of parser-m. And
I'm not sure how you want to handle product-expr
I know there's a core function that takes a predicate and returns its
opposite:
(defn mystery [predicate]
(fn [x] (not (predicate x
I'm having a lot of trouble finding the name of it in the docs,
though. Could anyone give me its name? Or does this function not exist
in the core?
Wonderful. I didn't think of searching for opposite. Thanks
everyone.
On Apr 30, 11:25 am, Stephen C. Gilardi squee...@mac.com wrote:
On Apr 30, 2009, at 1:50 PM, samppi wrote:
I know there's a core function that takes a predicate and returns its
opposite:
(defn mystery [predicate
Wow, I've never seen ~' before. But it works great. Thanks a lot.
On May 9, 5:41 am, Konrad Hinsen konrad.hin...@laposte.net wrote:
On 09.05.2009, at 03:50, samppi wrote:
I'm trying to use m-plus inside a macro like this:
(defmacro alt
[ subrules]
(with-monad parser-m
Is there a core Clojure function that does this:
(fn mystery [ subfunctions]
(fn [ args]
(some #(apply % args) subfunctions)))
...in other words, composing the functions with or. (mystery nil?
(partial = the)) would be equivalent to #(or (nil? %) (= the %)).
I'm having trouble using clojure.contrib.monads/m-seq in a macro.
Let's say that I just want to create a macro version of m-seq.
Clojure 1.0.0-
user= (use 'clojure.contrib.monads)
nil
user= (with-monad maybe-m (m-seq [1 2 3]))
(1 2 3)
user= (defn a [ xs]
(with-monad maybe-m (m-seq [1 2 3])))
konrad.hin...@laposte.net wrote:
On 11.05.2009, at 23:17, samppi wrote:
user= (defmacro b [ xs]
`(with-monad maybe-m (m-seq ~xs)))
#'user/b
user= (b [1 2 3])
java.lang.IllegalArgumentException: Wrong number of args passed to:
LazilyPersistentVector (NO_SOURCE_FILE:0)
So there's
)
java.lang.IllegalArgumentException: Wrong number of args passed to:
monads$m-PLUS-m-seq-PLUS-m (NO_SOURCE_FILE:0)
Trying both ~ and ~@ in this case gets me two kinds of errors.
Thanks for your patient help.
On May 12, 7:59 am, Konrad Hinsen konrad.hin...@laposte.net wrote:
On May 12, 2009, at 16:40, samppi wrote:
I
That works perfectly. I forgot about macroexpand-1...but I also didn't
think that the (1 2 3) list would be evaluated using 1 as a function
too.
Thanks both of you for the great help.
On May 12, 8:33 am, J. McConnell jdo...@gmail.com wrote:
On Tue, May 12, 2009 at 11:22 AM, samppi rbysam
I want to create a function that takes a variable of an error-kit
error type and inserts it into a handle statement, but when I try, I
get a strange error. What does the error mean, and is there a way to
pass a variable error type into a handle statement without resorting
to macros?
Clojure
Why does using a list with into and a map throw an exception, while
using a vector is fine?
Clojure 1.0.0-
user= (def a (list :a 1))
#'user/a
user= (into {} [a])
java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to
java.util.Map$Entry (NO_SOURCE_FILE:0)
user= (def b [:a 1])
I'd love to be able to do this:
(defstruct person-s :name :gender)
(def name-a (accessor person-s :name))
(def gender-a (accessor person-s :gender))
(def person-1 (struct person-s Jane :female))
(let [{name name-a, gender gender-a, :as person} person-1]
(println name gender person))
The idiom (into {} coll-of-entries) is often used to create a map from
a collection of entries or two-sized vectors. But what if I want to do
something like this:
(mystery-fn [[:a 1] [:b 3] [:b 5] [:c 1]]) ; returns {:a [1], :b [3
5], :c [1]})
The only way I can think of doing this is with a
Thanks everyone. They all seem to take less time than the filter way
too.
On Jun 23, 4:05 pm, Cosmin Stejerean cstejer...@gmail.com wrote:
On Tue, Jun 23, 2009 at 5:09 PM, samppi rbysam...@gmail.com wrote:
The idiom (into {} coll-of-entries) is often used to create a map from
a collection
Are keywords and symbols garbage-collected? If I generated a lot of
keywords or symbols, put them into a collection, and then removed
them, would they disappear and free up space? I'm wondering if they're
similar to Ruby symbols, which are never garbage collected.
Thanks for the answers. I need to generate symbols to distinguish them
from strings in a parser. It seems, then, that it's better to use
symbols rather than keywords in this case.
On Jun 24, 10:52 am, Stephen C. Gilardi squee...@mac.com wrote:
On Jun 24, 2009, at 1:30 PM, Four of Seventeen
Currently, if I want to do this: (mystery-fn [0 1 2 3 4] -1) - [-1 0
1 2 3 4]), I use vec and cons: (vec (cons a-vec obj-to-insert)). Is
there a better way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Clojure
Thanks for the replies, everyone.
@Mr. Gilardi, this is for a one-time only thing. I have a function,
called rep*, that builds up a vector from left to right. Another,
separate function, called rep+, calls rep*, but it needs to slip in an
element at the vector's beginning.
I'm considering
Thanks for the replies. Mr. Brandmeyer's solution is exactly what I
needed; I don't really want to change rep+'s return value from a
vector, which would sort of break backwards compatibility.
On Jun 26, 8:25 am, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 26.06.2009 um 17:09 schrieb samppi
I use Clojure's classes a lot in my multimethods. Is there any way to
abbreviate them; that is, is there a method to refer to
clojure.lang.APersistentList as APersistentList? I've tried (use
'clojure.lang) and (require ['clojure.lang :as 'c]), but neither seem
to work.
Wonderful. Thanks for the answers.
On Jun 28, 12:39 pm, Stephen C. Gilardi squee...@mac.com wrote:
On Jun 28, 2009, at 3:03 PM, samppi wrote:
I use Clojure's classes a lot in my multimethods. Is there any way to
abbreviate them; that is, is there a method to refer
clojure.xml/parse returns a PersistentStructMap. Is there a way to
refer to its struct template? I wish to create accessors for its keys,
such as :tag, :attrs, and :content, with the accessor function for
speed.
--~--~-~--~~~---~--~~
You received this message
Wonderful. Thanks for the answer.
On Jun 29, 2:47 pm, Rich Hickey richhic...@gmail.com wrote:
On Jun 29, 4:59 pm, samppi rbysam...@gmail.com wrote:
clojure.xml/parse returns a PersistentStructMap. Is there a way to
refer to its struct template? I wish to create accessors for its keys
-struct :a :b :c))
(keys (struct st))
(:a :b :c)
-Adrian.
On Tue, Jun 30, 2009 at 12:14 AM, samppi rbysam...@gmail.com wrote:
Wonderful. Thanks for the answer.
On Jun 29, 2:47 pm, Rich Hickey richhic...@gmail.com wrote:
On Jun 29, 4:59 pm, samppi rbysam...@gmail.com wrote
I'm new at Clojure, but I'm really liking it, though. I'm having
trouble with using map on a map, and turning the resulting sequence of
map entries into a new map.
In other words, how can you turn this:
([:a 2] [:b 3]) ...into... {:a 2, :b 3}?
Thanks in advance.
Is there a way to test an object if it's a certain kind of struct?
(defstruct person :name :age)
(def president (struct person Sam 30))
(struct? person president) ; true
Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are
Okay, I understand. Thanks for the answer.
On Oct 29, 12:01 pm, Graham Fawcett [EMAIL PROTECTED]
wrote:
On Wed, Oct 29, 2008 at 2:29 PM, samppi [EMAIL PROTECTED] wrote:
Is there a way to test an object if it's a certain kind of struct?
(defstruct person :name :age)
(def president
On the type chart (http://clojure.googlegroups.com/web/chart.png?
gda=ODsxtzsAAABoLitVpBTEcNIQc_NHg39S4VDJlSuqwy9lITiADmvt9Suq-
FEWrXmgYiTWWcOQKecGRdr3QrylPkw2aRbXD_gF), it indicates that ISeq
implements Sequential. So why is this false?
(isa? clojure.lang.ISeq clojure.lang.Sequential)
I see. Yes, I downloaded the latest release on SourceForge, version
20080916. I don't know how to use SVN so I can't get the bleeding
edge, but it's okay. I was just puzzled.
Thanks for answering!
On Nov 14, 8:09 am, Chouser [EMAIL PROTECTED] wrote:
On Fri, Nov 14, 2008 at 10:04 AM, samppi
Yeah, I surmised as much. The thing is, I'm writing a YAML library in
Clojure, and YAML allows circular recursion like that:
---
x
- 3
- 2
- 1
- *x
...So I'm wondering what I should do if a document like that were
loaded. Ah well, I'll worry about that later.
On Nov 14, 4:05 pm,
I'm trying to figure out how to do this:
(flat-map-seq {:a 3, :b 1, :c 2}) ; returns (:a 3 :b 1 :c 2)
...and vice versa:
(map-from-flat-collection {} [:a 3 :b 1 :c 2]) ; returns {:a 3, :b
1, :c 2}
Anyone have any idiomatic ideas?
--~--~-~--~~~---~--~~
You
, samppi [EMAIL PROTECTED] wrote: I'm trying to figure
out how to do this:
(flat-map-seq {:a 3, :b 1, :c 2}) ; returns (:a 3 :b 1 :c 2)
(defn flat-map-seq [m]
(if (empty? m) '()
(let [kv (first m)]
(lazy-cons (kv 0) (lazy-cons (kv 1) (flat-map-seq (rest m)))
...and vice
Excellent! I must remember about the apply function. Thank you very
much.
On Nov 14, 9:35 pm, Kevin Downey [EMAIL PROTECTED] wrote:
On Fri, Nov 14, 2008 at 8:33 PM, Kevin Downey [EMAIL PROTECTED] wrote:
On Fri, Nov 14, 2008 at 8:17 PM, samppi [EMAIL PROTECTED] wrote:
Yeah, I need
, that's fine, and for the flatten:
(interleave (keys m) (vals m))
Rich
On Fri, Nov 14, 2008 at 9:42 PM, samppi [EMAIL PROTECTED] wrote:
Excellent! I must remember about the apply function. Thank you very
much.
On Nov 14, 9:35 pm, Kevin Downey [EMAIL PROTECTED] wrote:
On Fri, Nov 14
Is there a way to make a lazy sequence whose sequential values are
derived from some function? I'm thinking about two ways:
(recursive-fn-seq f initial [n]) ; returns (initial (f initial) (f
(f initial)) ...) n or infinity times
(index-fn-seq f initial [n]); returns ((f i) (f (inc i)) (f
Is there a more concise way of expressing an optional parameter with a
default other than writing another entire definition?
That is, instead of:
(defn a-function ; two parameters, x and y, and y is 23 by default
([x] (a-function x 23)
([x y] ...))
...is it possible to do something
Ah! Thank you.
On Nov 17, 2:48 pm, Rich Hickey [EMAIL PROTECTED] wrote:
On Nov 17, 4:22 pm, samppi [EMAIL PROTECTED] wrote:
Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b...,
the following example was given:
(defn test1 [{x :x, y :y, :or {:y 3}}]
[x y
I'm trying to unit-test a library with which a user can define methods
on the library's multi-function to change its behavior. So I need to
be able to define lexically-scoped methods in each test. Is it
possible to use let to create a lexically-scoped method?
The problems I'm encountering are
Yes, but I meant creating methods rather than regular functions, in a
lexical scope. Is it possible to create methods using fn?
On Nov 18, 10:47 pm, Allen Rohner [EMAIL PROTECTED] wrote:
On Nov 18, 6:48 pm, samppi [EMAIL PROTECTED] wrote:
I'm trying to unit-test a library with which a user
I am not familiar with how Java's arithmetic works, but it seems from
http://hanuska.blogspot.com/2007/08/arithmeticexception-vs-nan.html
and http://www.concentric.net/~Ttwang/tech/javafloat.htm that dividing
a double or float by 0 should result in positive or negative infinity
(like
I'm just wondering—is there a way to match methods' dispatch-values
using a function other than isa?—such as with a macro. This is what
I'm thinking of:
(defmulti foo identity #(re-find %2 %1)) ; uses the last function
instead of isa? to match
(defmethod foo #xyzzy [x]
x))
(defmethod
Is it possible to create a MapEntry from scratch? The reason why I'm
asking is because I want to mess with sequences of two-sized vectors,
and it would be really cool if I could use the key and val functions
on them rather than (get % 0) and (get % 1):
(map #(str Key: (key %) Value: (val %))
Thank you very much.
On Nov 20, 10:07 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote:
On Nov 21, 2008, at 12:03 AM, samppi wrote:
Is it possible to create a MapEntry from scratch?
user= (def a (clojure.lang.MapEntry. 3 4))
#'user/a
user= (key a)
3
user= (val a)
4
user=
You can also
On Sat, Nov 22, 2008 at 7:32 AM, samppi [EMAIL PROTECTED] wrote:
I'm trying to unit-test a mutli-function's methods without resorting
to a separate test file. I can do this:
(defn foo
([x] (+ x 2))
{:test (fn [] (= (foo 3) 4))})
...but how do I do something like this?
; Does
(declare a2)
(defn a1 [x]
#(vector :a (a2 x) :e))
(defn a2 [x]
(if (coll? x)
#(apply vector (map a1 x))
x))
(defn a [x]
(trampoline a1 x))
(def b (a [[3 5] 1]))
(println b)
I'd like this program to print:
[:a [[:a [[:a 3 :e] [:a 5 :e]] :e] [:a 1 :e]] :e].
Instead, it
user= (.length )
0
user= (.isEmpty )
java.lang.IllegalArgumentException: No matching field found: isEmpty
for class java.lang.String (NO_SOURCE_FILE:0)
Why does .length, but not .isEmpty, work on Strings?
--~--~-~--~~~---~--~~
You received this message because
For any given collection [3 2 [3 5 1] 1 [3 4 1] 0], how may I get [3 2
3 5 1 1 3 4 1 0]?
Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email to
Wonderful, thank you!
On Nov 30, 9:42 pm, Brian Doyle [EMAIL PROTECTED] wrote:
As long as you have the clojure.contrib jar in your path you can do:
(use 'clojure.contrib.seq-utils)
(flatten [1 2 3 '(4 5 6)])
= (1 2 3 4 5 6)
On Sun, Nov 30, 2008 at 9:36 PM, samppi [EMAIL PROTECTED] wrote
I want to put the Clojure logo:
http://clojure.googlegroups.com/web/Clojure-logo.png?gda=y8lqvUIAAABoLitVpBTEcNIQc_NHg39S6iU75fHiOxnOGiH4bfPrlzZZL8wLBEcX9EgDZpMYxIxV4u3aa4iAIyYQIqbG9naPgh6o8ccLBvP6Chud5KMzIQ
...on Wikipedia's article on Clojure. What is the license of Clojure's
logo--is it a
Ah ha ha ha. Wow, my mistake. I'll make sure to spell it correctly.
I totally agree with cogfun, though—it's a really nice logo. Did you
make it yourself?
On Dec 4, 5:23 am, Rich Hickey [EMAIL PROTECTED] wrote:
On Dec 3, 11:30 pm, samppi [EMAIL PROTECTED] wrote:
I want to put the Clojure
On Dec 7, 8:51 am, Stuart Sierra [EMAIL PROTECTED] wrote:
2. Nested test contexts, as in RSpec and some other testing
frameworks.
I would wholeheartedly love if tests could be nested. Even if it was
as simple as appending a phrase to each nested test:
(defcontext str-starts-with?
(deftest
to various criteria.
What is the purpose of a nested test context in RSpec? Can a test
belong to more than one nested test context?
Bill
On Dec 7, 4:20 pm, samppi [EMAIL PROTECTED] wrote:
I would wholeheartedly love if tests could be nested. Even if it was
as simple as appending a phrase
PROTECTED] wrote:
On Dec 3, 11:30 pm, samppi [EMAIL PROTECTED] wrote:
I want to put the Clojure
logo:http://clojure.googlegroups.com/web/Clojure-logo.png?gda=y8lqvUIAAABo...
...on Wikipedia's article on Clojure. What is the license of Clojure's
logo--is it a free image? Or can Mr. Hickley give
Great article, but I'm not sure this part in the keyword section is
correct:
Keywords exist simply because, as you'll see, it's useful to have
names in code which are symbol-like but not actually symbols. Keywords
have no concept of being namespace qualified as they have nothing to
do with
Is there a way to turn this:
[\3 \5 \A \3]
...into this?
\u35A3
--~--~-~--~~~---~--~~
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
Let's say that I have a parser library--let's call it FnParse--that I
want to share with the world and let others use. If it requires
another library, say, clojure.contrib.test-is, is there a way for me
to indicate that that library is required? Or is the only thing I may
do is indicate it in the
Let's say I have a function, alt:
(defn alt [ functions]
(fn [tokens]
(some #(% tokens) functions)))
It creates a function from a bunch of sub-functions that accepts one
collection of tokens and figures out which sub-function returns a true
value when the tokens are plugged into it.
Is
.
-Stuart Sierra
On Jan 11, 4:44 pm, samppi rbysam...@gmail.com wrote:
Let's say I have a function, alt:
(defn alt [ functions]
(fn [tokens]
(some #(% tokens) functions)))
It creates a function from a bunch of sub-functions that accepts one
collection of tokens and figures out which
Thank you for the explanation; I understand it a lot better now. The
reason that I decided to use Delays was that I thought I would need to
change less. Now that I've actually changed everything to Delays, it
seems that they take much more time (the opposite of what I was trying
to do :(. But
I'm trying to get into more of how namespaces work. The refer function
refers to all the public variables of a library. What is the point of
refer-clojure, though? When would you use it? What variables of
clojure.core are not normally present in a new namespace?
sync and dosync's documentation seems to be virtually the same, except
for the unimplemented flags-ignored-for-now parameter of sync. What is
the difference in their functions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
I'm trying to learn Swing, so I'm writing the most robust Celsius
converter app that I can. I've separated the conversion work into a
separate SwingWorker thread, so this requires Java 6. Does anyone have
any suggestions?
(ns org.sample.play-with-swing.multithreaded-celsius-converter
?
On Jan 27, 9:08 am, Keith Bennett keithrbenn...@gmail.com wrote:
samppi -
I don't suggest using SwingWorker for this unless you just want to
practice using it for education's sake. The calculation time is
effectively zero in an application like this where actions are user-
triggered, so
:
samppi -
Typical Swing programs create a window with all its components and
event handlers in the main thread, and then launch the event handling
thread implicitly by calling setVisible(true) on the window (usually a
JFrame). I've always done it this way, and have never had a problem.
However
Name: fnparse
URL: http://github.com/joshua-choi/fnparse
Author: Joshua Choi
Tags: parsing, rules
Licens: EPL
Dependencies: clojure-contrib
Description:
fnparse is a library for creating functional parsers in the Clojure
programming
language. It presents an easy, functional way to create parsers
I want to test if a certain function prints a certain message to the
system's standard output. How may I go about doing this?
(defn printing-fn []
(print YES))
(deftest test-printing-fn
(some-context-that-switches-the-default-target-of-printing
(printing-fn)
(is (=
Awesome. Thanks for the answers, everyone.
On Feb 4, 3:07 pm, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 04.02.2009 um 23:01 schrieb Laurent PETIT:
this should work for you :
(binding [*out* (java.io.StringWriter.)]
(printing-fn)
(= (.toString *out*) YES))
There
I tried asking about this yesterday, but it seems like I expressed my
problem poorly. Anyways, here's another shot. :)
I have a little parser library. With its metafunctions, one can create
rules that accept tokens and spit out a result or nil if the tokens it
receives are invalid.
For instance,
1 - 100 of 182 matches
Mail list logo