zy and I'm not seeing it / working with it properly?
>
> Best,
> --Joseph
>
> On Friday, June 22, 2012 7:30:28 AM UTC-5, Walter Tetzner wrote:
>>
>>
>>
>> On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>>>
>>>
>>>
On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>
>
> (defn read-records
> "Read the data from the given reader as a list of strings, where
> each string is made up of multiple lines, separated by // on it's own
> line."
>
(defn read-records
"Read the data from the given reader as a list of strings, where
each string is made up of multiple lines, separated by // on it's own
line."
[reader]
(->> (line-seq reader)
(partition-by #{["//"]})
(filter (comp not #{["//"]}))
(map (partial apply str
On Friday, June 15, 2012 10:01:24 AM UTC-4, octopusgrabbus wrote:
>
> The reason why I asked this question is this code looks like it's using
> another csv library, so I'm confused.
>
That's because it is using another csv library:
https://github.com/clojure/data.csv.
clojure-csv: https://githu
> You could just do (vec (mc/find-maps "events")).
>
Also, to dissoc :_id from each item, do (vec (map #(dissoc % :_id)
(mc/find-maps "events"))).
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googleg
On Friday, June 15, 2012 9:54:37 AM UTC-4, Joao_Salcedo wrote:
> Is the right way?
>
You could just do (vec (mc/find-maps "events")).
Also, using def creates a top-level var. You probably wanted (let [items
(mc/find-maps "events")] ...) instead.
--
You received this message because you are s
On Thursday, June 14, 2012 8:09:50 AM UTC-4, Jim foo.bar wrote:
>
> It has to be 'do' instead of 'doto'...
>
Well, if you want to be able to use doto, you could do something like
(doto foo
(.bar x)
(.baz y)
(#(dotimes [i 10] (.zab % g
--
You received this message because you are sub
>
> Is there a philosophical difference underlying the syntax difference
> (doseq [elem coll] (f coll)) and (each f coll)?
>
`doseq' is the side-effecty version of `'for', not map. It lets you do
things like
user> (doseq [x (range 100)
:while (< x 20)
:when (even? x)]
On Wednesday, May 16, 2012 12:51:15 PM UTC-4, Jim foo.bar wrote:
>
> I guess what I'm asking is at which point does the array become an
> ArraySeq and why casting it back to a double array with 'doubles' doesn't
> work?
>
Can you post the whole stack trace?
-Walter
--
You received this mess
On Wednesday, May 16, 2012 12:34:08 PM UTC-4, Jim foo.bar wrote:
> ---
>
>
> (defn normalize
> [data high-end low-end]
> (let [norm (NormalizeArray.)]
> (do (. norm setNormalizedHigh high-end)
>
On Wednesday, May 16, 2012 9:16:29 AM UTC-4, Aaron Cohen wrote:
>
> Saying something is obvious and then using the word monad a paragraph
> later is contradictory. ;)
>
> What should happen on the else branch of the if-let; which bindings are in
> scope and what would be their values?
>
>
None of
>
> On Wednesday, May 16, 2012 9:01:49 AM UTC-4, Stuart Sierra wrote:How would
> multiple bindings for if-let or when-let work? Should every binding be
> testedd? Should they be and-ed together? Should it short-circuit if the
> first is false?
>
> I don't think there are obvious answers to thos
On Tuesday, May 15, 2012 3:41:58 PM UTC-4, Dan Cross wrote:
>
> My own personal opinion is that it makes sense in combination with 'and',
> but others may feel differently. E.g.,
>
> (when-let [a (allocate-thing) b (read-into-thing a) c
> (extract-something-from-thing b)]
> (do-somethi
On Tuesday, May 15, 2012 3:26:52 PM UTC-4, Aaron Cohen wrote:
>
> Does the principle of least surprise suggest that multiple bindings be
> combined with AND or OR?
>
>
For `when-let', I would expect it to work like nested when-lets:
(when-let [x (exp-1)
y (exp-2 x)
z (exp-
You could do this without adding anything to hiccup.
If you wrote a function that, say, used walk, you could have it go
through the vectors, and replace the custom tags with what they
represent. Then you could just call that before calling `html'.
(html
(transform
[:html
[:head
On Saturday, May 12, 2012 10:36:35 PM UTC-4, James Reeves wrote:
> That seems more complicated, IMO. Why require an custom macro system
> when normal functions do the same job? What's the advantage?
>
The same reason hiccup uses data structures to represent HTML instead
of using nested function
> Second thing is your (ns ..) declarations.
>
I've updated it to use :require instead of :use.
--
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 moder
On Saturday, May 12, 2012 6:28:14 PM UTC-4, Moritz Ulrich wrote:
>
> Have you seen the recent buzz about java.net.URL's hashCode depending
> on the state of the internet[1]?
> Can Exploding Fish do something about this annoyance?
>
> [1]:
> http://michaelscharf.blogspot.de/2006/11/javaneturlo
> It looks like you have written a little mini-library for creating and
> working with association lists. Why on earth would you use association
> lists instead of mas? The seq representation of a map is basically the
> same.
>
> user=> (seq {"foo" "bar"})
> (["foo" "bar"])
> user=> (into {} (seq
On Wednesday, May 9, 2012 9:35:57 AM UTC-4, Tassilo Horn wrote:
I don't think code-as-data contributes to code injection vulnerability,
neither positively nor negatively. Simply don't `eval` code/data from
sources you don't trust.
I think it does contribute through the reader. If y
On Wednesday, May 9, 2012 9:35:57 AM UTC-4, Tassilo Horn wrote:
> I don't think code-as-data contributes to code injection vulnerability,
> neither positively nor negatively. Simply don't `eval` code/data from
> sources you don't trust.
>
I think it does contribute through the reader. If you
>Provided examples look very much like
https://github.com/michaelklishin/urly. Does e-f handle
>relative resolution, parsing of broken (technically invalid) URLs?
Yes, it handles relative resolution, as well as normalizing paths:
user> (normalize-path "http://www.test.net/some/uri/../path/./her
I've written a URI library for Clojure, whose functions work on a
custom Uri type, java.net.URI, java.net.URL, and java.lang.String.
It's intended to make working with URIs less painful. It makes it easy
to get at the pieces of a URI, as well as doing functional updates. In
particular, it makes it
I've written a URI library for Clojure, whose functions work on a
custom Uri type, java.net.URI, java.net.URL, and java.lang.String.
The source and some documentation (in the README) can be found at
https://github.com/wtetzner/exploding-fish.
Example usage:
user> (scheme "http://www.example.com/
24 matches
Mail list logo