I am using Clojure 1.10.0
Basic example for the issue is:
(let [x 42] :clojure.spec.alpha/invalid)
This will result in the following exception:
2. Unhandled clojure.lang.Compiler$CompilerException
1. Caused by clojure.lang.ExceptionInfo
Call to clojure.core/let did not conform to spec.
#:cl
Hi Everyone,
I am using spec for a while (currently on the version shipped with Clojure
1.10). This post is intended to be a kind-of status report, focusing on a
particular issue I am facing at the moment. To explain it in detail, please
have a look on this following macro I wrote, which is an
Hi everyone,
I have ran into an issue with spec, and suspect it is a bug.
The following code throws an error:
(clojure.spec.alpha/conformer :foo)
The error is a java.lang.Exception and says: Unable to resalve spec; :foo
This is unexpected because I intend to use the keyword as a conformer
fu
> (hash-map :a 1 :a 2)
> java.lang.IllegalArgumentException: Duplicate key: :a
>
> > (defn my-zipmap [s1 s2] (apply hash-map (interleave s1 s2)))
> #'sandbox10223/my-zipmap
> > (my-zipmap [:a :b :c] (range))
> {:a 0, :c 2, :b 1}
> > (my-zipmap [:a :b :
multiple times. It would be definitely a human-friendly
addition to log some warning when a key is to be defined multiple times,
especially if it can avoid impact on performance.
Cheers,
D.
On Friday, 29 July 2016 17:07:14 UTC+1, Daniel Dinnyes wrote:
>
> Hi All,
>
> This post is just t
Hi All,
This post is just to mention my recent experience with one of the
clojure.core/zipmap, by witch I was burned badly recently. Consider the
following example code
(def ks [:a :b :c :d :e :f :b :c :d])
(def m (zipmap ks (range)))
(get m :b)
> 6
Of course the "ks" in my case was like 10
> I understood David's comment differently, that the current threading
> macros exist so that explicit bindings for each threaded form are not
> needed for they very specific cases they intend to simplify. I'm not saying
> your macro is dumb, I just don't find the sugar particularly tasty. ;-)
HUGE benefit, the reason why all the threading
macros exist. Beside that restriction, this fine macro above won't struggle
to take away any of the `let` goodies, unlike ->, ->>, as->, or anything.
I need a beer.
On Friday, July 19, 2013 3:18:15 PM UTC+1, Daniel Dinnyes wrote:
Ugh. What a pointless thread. Someone could have just said:
>>>
>>> ---
>>> It's already in clojure 1.5. The form you are looking for is called
>>> as->.
>>> Your original example would be written like this:
>>>
>>> (as->
On Monday, July 15, 2013 11:53:09 PM UTC+1, Jeremy Heiler wrote:
>
> On July 15, 2013 at 6:30:28 PM, Daniel Dinnyes
> (dinn...@gmail.com)
> wrote:
>
> Hmm, good point, especially the `let` one... What is `as->`? I can't find
> anything about that.
>
&g
Yeah, seemingly I am still a newcomer here. As long as no one minds me
coming up with "great ideas", I don't mind looking stupid either... it will
improve hopefully :)
On Friday, July 19, 2013 9:38:48 AM UTC+1, MichaĆ Marczyk wrote:
>
> On 19 July 2013 10:24, Daniel Dinnyes
Hi,
This will sound strange from me, but are these macros really to be added to
the core?
Firstly, I don't see they extend the language in any way new. Instead they
ease some very special cases, which could have been done with the
combination of existing core functions/macros just as well, and
->> is good for functions expected/designed to be partially
applied. Is that correct?
Cheers,
Daniel
On Sunday, July 14, 2013 5:39:18 PM UTC+1, Jeremy Heiler wrote:
>
> On Sat, Jul 13, 2013 at 10:49 PM, Daniel Dinnyes
> >
> wrote:
> > (->>> "test-strin
Hey guys, I just came up with some good shit, check this out!
(defmacro ->>>
([x] x)
([x alias form]
`(let [~alias ~x] ~form))
([x alias form & more]
(let [y `(->>> ~x ~alias ~form)]
`(->>> ~y ~@more
(->>> "test-string-with-lots-of-dashes"
x (s/split x #"-")
/questions/4290665/does-concat-break-the-laziness-of-line-seq
http://stackoverflow.com/questions/16194841/clojure-lazy-sequences-in-math-combinatorics-results-in-outofmemory-oom-error/16270113#16270113
On Sunday, July 14, 2013 2:33:56 AM UTC+1, Daniel Dinnyes wrote:
>
> Hiya, check this code ou
Hiya, check this code out guys:
(defn point [x y]
(println "x:" x "y:" y)
[x y])
(defn gen-data [n m]
(for [i (range n)]
(for [j (range m)]
(point i j
(def data (apply concat (gen-data 100 100)))
(nth data 5)
"The output was the following:"
"x: 0 y: 0
x: 0 y: 1
x: 0
Hiya,
There the main arguments are 99% of the times the first or the last ones.
> So -> or ->> will work.
>
Just made a quick search on `main arguments` on both Google and Wikipedia.
Do you mean the arguments in `public static void main (String[] args)`? If
not please provide some definition wh
exception handling or something.
On Sunday, July 14, 2013 12:58:51 AM UTC+1, Daniel Dinnyes wrote:
>
> Looks promising though. Pomegranate is significantly more complex, and I
> could never remember the name of the function which dynamically loads the
> libs.
>
> On Sunday, July 14
Looks promising though. Pomegranate is significantly more complex, and I
could never remember the name of the function which dynamically loads the
libs.
On Sunday, July 14, 2013 12:55:55 AM UTC+1, Daniel Dinnyes wrote:
>
> Well, that's the most convenient way it should work anyway,
Well, that's the most convenient way it should work anyway, just a list of
key, value, key, value, key, value argument list. Easy to implement.
Accepting brackets is criminal.
On Saturday, July 13, 2013 6:13:21 PM UTC+1, Steven Degutis wrote:
>
> I think it also works with just: lein try clj-tim
Hi,
I am trying to navigate an XML structure using the
clojure.contrib.zip-filter.xml library, but for some strange reason I
receive the following exception:
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
clojure.zip/node (zip.clj:67)
Here is an example which demo
ce for
the value-mapper is as an optional parameter for `group-by` itself.
What do you think?
Cheers,
Daniel
On Monday, December 17, 2012 10:13:17 AM UTC, Daniel Dinnyes wrote:
>
> Hi,
>
> I expect the cost of calling `identity` to be negligible. Not for sure,
> but the JVM might
does the `identity` effect performance? I wouldn't think much.
>
> Alex
>
> On Fri, Dec 14, 2012 at 9:58 AM, Daniel Dinnyes
>
> > wrote:
>
>> Hi,
>>
>> I would like to suggest an enhancement to the clojure.core/group-by
>> function. The ide
uot;
"Rex"]}
(group-by :type #(.toUpperCase (:name %)) animals) ; hell yeah!
> {:cow ["BETSY"], :cat ["MURMUR" "ROSIE" "ALF"], :dog ["LESSIE" "DINGO"
"REX"]}
It would be so cool to have this in the core. What do you gu
24 matches
Mail list logo