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 free
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
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?"
(d
tains.
> With that foundation, you could define functions that create and
> populate the test container according 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 D
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
> > logo:http://clojure.googlegroups.com/web/Clojure-logo.png?gda=y8lqvUIAAABo...
>
> > ...on Wikipedia's article on Cl
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 names
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 fro
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 t
" is already lazy, so you may not need to change anything at
> all. You might also be able to use "filter", which will not do
> anything until you consume the output sequence.
> -Stuart Sierra
>
> On Jan 11, 4:44 pm, samppi wrote:
>
> > Let's say I have a
Awesome—thanks for everyone's answers; I think I'll go with delay/
force. What I'm a little worried about is the caching. After a calling
of "alt" finishes, what happens to all those Delay objects and their
cached values? Are they garbage-collected, or will they remain
indefinitely? Should I worry
Recently, I asked how to make a function evaluate its arguments lazily
(http://groups.google.com/group/clojure/browse_thread/thread/
cd01ef39c2b62530), and I was given a good solution: use Delay objects
(with the delay and force functions).
I wanted to do this for the efficiency of a functional p
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 when
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
(:impo
r to invokeLater in the main thread?
On Jan 27, 9:08 am, Keith Bennett 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 th
7;t I just use (.setEnabled button false)? I'd think that the
GUI should always be able to respond to the user, or else it would
seem frozen.
I guess it'd be bad with multiple modal dialogs. I think maybe I
should just try to avoid those. :)
On Jan 27, 4:38 pm, Keith Bennett wrote:
&g
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 f
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 (= the-standard-out
Awesome. Thanks for the answers, everyone.
On Feb 4, 3:07 pm, Meikel Brandmeyer 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"))
>
> The
Let's say I want to make a small parser for a small language. The
language is made up of values of two kinds: arrays and bits. An array
can only be of the form "[x,y]", where x and y are values. A bit can
only be of the form "0" or "1". In other words, the language's strings
can look like this:
-
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,
Thanks for the reply. I've tried delays, but it seemed to make my
functions much slower. I think I'm going to go with var-quoting—it
seems to be the least intrusive option, and it definitely works. My
nightmare is finally over. :)
I wonder if there's a way to make a macro make even this unneeded
Perfect. This is exactly what I need. Thank you. :)
I wonder, is it customary to append an * to the names of functions
that do the grunt work of corresponding macros?
On Feb 6, 10:03 am, Christophe Grand wrote:
> samppi a écrit :
>
> > Thanks for the reply. I've tried delays,
Let's say I have a macro:
(defmacro foo [& args] ...)
I want to do something equivalent to this:
(defn bar-fn [factor arg]
(apply foo (replicate factor arg)))
...but since I can't take values of macros, I have to do something
like this, right?
(defmacro bar [factor arg]
`(foo ~@(replicate
r do you have a concrete use case we could try to help
> you with ?
>
> 2009/2/7 samppi
>
>
>
>
>
> > Let's say I have a macro:
>
> > (defmacro foo [& args] ...)
>
> > I want to do something equivalent to this:
> > (defn bar-fn [factor arg
19 am, James Reeves wrote:
> On Feb 5, 6:03 am, samppi wrote:
>
> > user=> ((array) (seq "[0,0]")) ; This works as intended:
> > [[\[ \0 \, \0 \]] nil]
> > user=> (value (seq "[0,3]")) ; This should return nil, but a weird
> > argument exception i
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 wrote:
> Hi,
>
> Am 08.02.2009 um 00:40 schrieb samppi:
>
>
>
> > (defn conc* [tokens & subrules]
> > (loop [subrule-queue (seq subru
I'm trying to write a macro that expands from this:
(product-context [n rule0, m rule1)]
(rule-maker2 (+ n m)) rule3))
Into this (assume that conc-fn and conc-products are functions):
(fn [tokens]
(if-let [[remainder# n m] (conc-products [rule0 rule1] tokens)]
(conc-fn [(rule-maker2 (+
,
and vec during the macro phase. What is the pattern for what is
allowed or prohibited in macros?
On Feb 13, 10:52 pm, Chouser wrote:
> On Fri, Feb 13, 2009 at 11:17 PM, samppi wrote:
>
> > I'm trying to write a macro that expands from this:
>
> > (product-context [n rul
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" an
t;cat" "dog" "bird"]])
>
> On Sun, Feb 15, 2009 at 7:42 PM, David Nolen wrote:
> > (map (fn [& rest] (apply vector rest)) [1 2 3] ['a 'b 'c] ["cat" "dog"
> > "bird"])
>
> > On Sun, Feb 15,
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 of
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 wrote:
> And to get the enclosing vector:
>
> (reduce conj [] (apply map vector [[:a :b] [1 2
My impression is that if you build and compile whatever application
you're making and deploy it using something like Java Web Start, the
user usually doesn't have to do anything with regards to manually
getting other libraries like Jambi; it would download it automatically
or something. And there
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 wrote:
> Run ant
>
> On Feb 19, 4:00 pm, samppi 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
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 wrote:
> +1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To
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 beh
I see—that explains a lot.
On Feb 21, 5:01 pm, Rich Hickey wrote:
> On Feb 21, 5:58 pm, samppi wrote:
>
> > Allowing dissoc and select-keys to accept both keys as arguments and
> > as a collection would be nice, and backwards compatible.
>
> Nope - Collections can be
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 wrote:
> Is there a summary of the changes to Clojure that the lazy sequences
> require
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 cert
Small questions on error-kit—which I love and think that all clojure-
contrib libraries should use—why do defined errors such as *error*,
*number-error*, etc. have names surrounded by asterisks? According to
this thread—http://groups.google.com/group/clojure/browse_thread/
thread/65d98eda2d1154b2—
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 wrote:
> I made an attempt
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,
When I created fnparse, I had no idea about the existence of Parsec; I
just knew about the concept of passing sequences of tokens around. Of
course, since Parsec has apparently been around for a long time, the
algorithms it uses would be tried, true, and fast. Unfortunately, I
can't read Haskell a
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?")
P
s, as long as they
do this—that is, as long as they make the code more readable.
I suppose I could put those long strings inside Java resource bundles,
since they're intended for the end user anyway, but is that really
necessary for a script? :(
On Apr 3, 11:02 pm, Laurent PETIT wrote
;
[detected-indent n])
detected-indent)
...more indented code)
On Apr 3, 11:35 pm, samppi wrote:
> I don't really want it so much for documentation strings—they're
> already formatted in a standard way—than just bei
e; unless you're
> printing multi-line messages in a tight loop, I can't imagine it
> having any effect on your program's performance whatsoever.
>
> On Apr 4, 1:35 am, samppi wrote:
>
> > I don't really want it so much for documentation strings—they
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
between them."
> (apply str (interpose separator strings)))
>
> user> (println (bigjoin "\n" "This is a really long string"
> "that I just felt like using"
> "in my program."))
> This is a really long stri
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 wrote:
> Hello,
>
> On Mon, Apr 6, 2009 at 10:06
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 make-schema
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 t
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 because
Wonderful; thank you!
On Apr 25, 10:57 am, billh04 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 wrote:
>
> >
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
t seems to return (\? \?).
On Apr 26, 6:22 pm, "Stephen C. Gilardi" wrote:
> On Apr 26, 2009, at 7:47 PM, samppi wrote:
>
> > user=> \u1
> > java.lang.IllegalArgumentException: Invalid unicode character: \u1
>
> > How would I embed the character as
I have a library called FnParse, and I'm wondering if I should rewrite
it using monads. (You can see FnParse's documentation at and its implementation at .) It implements a bunch of "rule functions" that consume
tokens:
Sequence of tokens -> [a new product from the consumed tokens,
remaining to
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 and
Okay; thanks for the answer! I understand now.
On Apr 29, 11:52 pm, Konrad Hinsen 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 (an
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 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
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" 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
> > o
I'm trying to use m-plus inside a macro like this:
(defmacro alt
[& subrules]
(with-monad parser-m
`(fn [state#]
((m-plus ~...@subrules) state#
Unfortunately, I get the error:
No such var: my-namespace.fnparse/m-plus
I've been trying various ways, and I think that
Wow, I've never seen ~' before. But it works great. Thanks a lot.
On May 9, 5:41 am, Konrad Hinsen wrote:
> On 09.05.2009, at 03:50, samppi wrote:
>
> > I'm trying to use m-plus inside a macro like this:
>
> > (defmacro alt
> > [& subrule
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])))
rad Hinsen 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:
> > L
maybe-m (m-seq ~...@xs)))
#'user/c
user=> (c 1 2 3)
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 wrote:
>
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" wrote:
> On Tue, May 12, 2009 at 11:22 AM, samppi wrote
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 1.0.0
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])
#'u
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))
...ins
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 com
Thanks everyone. They all seem to take less time than the filter way
too.
On Jun 23, 4:05 pm, Cosmin Stejerean wrote:
> On Tue, Jun 23, 2009 at 5:09 PM, samppi wrote:
>
> > The idiom (into {} coll-of-entries) is often used to create a map from
> > a collection of entries or
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" wrote:
> On Jun 24, 2009, at 1:30 PM, Four of Seventeen wrote:
>
>
>
> > O
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" gr
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 changi
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 wrote:
> Hi,
>
> Am 26.06.2009 um 17:09 s
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" 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
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 becaus
Wonderful. Thanks for the answer.
On Jun 29, 2:47 pm, Rich Hickey wrote:
> On Jun 29, 4:59 pm, samppi 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,
> > s
t; (def st (create-struct :a :b :c))
> (keys (struct st))
> (:a :b :c)
>
> -Adrian.
>
>
>
> On Tue, Jun 30, 2009 at 12:14 AM, samppi wrote:
>
> > Wonderful. Thanks for the answer.
>
> > On Jun 29, 2:47 pm, Rich Hickey wrote:
> > > On Jun 29, 4:59
I'm pleased to announce FnParse, a monadic functional parsing library
for Clojure, half a year in the making. I started on FnParse in
December as my first Clojure project, and now it has matured to
something that I believe is very and immediately useful. Currently,
I'm writing a YAML parser using
need to parse a bunch on JSON files on Monday :) good
> work
>
> Sent from my iPhone
>
> On Jul 4, 2009, at 3:16 PM, samppi wrote:
>
>
>
>
>
> > I'm pleased to announce FnParse, a monadic functional parsing library
> > for Clojure, half a year in the m
In clojure.contrib.def, I'd love to have a defmemo macro that acts
just like defn, only with memoize. I'm planning to change a lot of
functions to use memoize, and I'm not looking forward to changing
nice, clean defns with docstrings to (def {:doc docstring} function
(memoize (fn ...)))s. Would th
Excellent. This will be a lifesaver—thanks a lot.
On Jul 9, 8:21 am, Chouser wrote:
> On Jul 8, 11:53 pm, samppi wrote:
>
> > In clojure.contrib.def, I'd love to have a defmemo macro that acts
> > just like defn, only with memoize. I'm planning to change a lot of
3:55 am, Wilson MacGyver wrote:
>
>
>
> > Thanks for the tip on looking at clojure.contrib. I keep forgetting to
> > check there.
>
> > On Jul 5, 2009, at 4:20 PM, samppi wrote:
>
> > > If you need a JSON parser, there's already a good one included w
Is there a function in clojure.core or clojure.contrib so that:
(and (mystery-fn '(a b c d) '(a b))
(not (mystery-fn '(a b c d) '(a b d
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
T
Awesome, thanks for the quick answer. I think that it'd be a useful
thing to add to seq-utils or something. :)
On Jul 17, 1:41 pm, Mark Engelberg wrote:
> On Fri, Jul 17, 2009 at 1:32 PM, samppi wrote:
>
> > Is there a function in clojure.core or clojure.contrib so that:
>
I've just discovered the clojure.templates library [1], and I'm
wondering what's the difference between its function and that of
regular functions:
(apply-template '[x] '(+ x x) '[2])
((fn [x] (+ x x)) 2)
[1]
http://github.com/stuarthalloway/clojure/blob/6ee62ec1d88383e1caadb8b93a19fd389c001
1 - 100 of 211 matches
Mail list logo