Re: defrecord can't impl some interface methods

2018-07-05 Thread Leon Grapenthin
Great thanks, I just upvoted that. -- 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 first post. To unsubscribe

Re: How do I use spec and deftype together?

2018-07-04 Thread Leon Grapenthin
Spec doesn't check object fields. The defrecord case works because defrecord implements map. On Wednesday, July 4, 2018 at 12:47:26 PM UTC+2, markus...@gmail.com wrote: > > The same question was asked on > https://clojurians-log.clojureverse.org/clojure-spec/2018-01-19 > but I did not find an ans

defrecord can't impl some interface methods

2018-07-04 Thread Leon Grapenthin
IDK if it has always been this case, but this doesn't compile in Clojure 1.9 (defprotocol Cleanable (clean [this])) (defrecord Cleaner [] Cleanable (clean [this] "cleaned!")) This is likely because java.util.Map implements a clean method with the same amount of args (0) and defrecord somehow al

Re: [ANN] spec.alpha 0.2.168 and core.specs.alpha 0.2.36

2018-06-27 Thread Leon Grapenthin
Looks like the README of core.specs.alpha has the core.specs deps info by mistake. Thank you for the relases. On Tuesday, June 26, 2018 at 8:41:17 PM UTC+2, Alex Miller wrote: > > spec.alpha 0.2.168 is now available with the following changes: > >- CLJ-2182

Re: Custom core.async go threadpools? Using go parking for heavy calculation parallelism throughput?

2018-05-02 Thread Leon Grapenthin
I remember a Rich Hickey talk on core.async where he mentioned building blocking takes/puts into the compiler, as a possible future extension, making the go macro obsolete. Is that on any roadmap? Tesser I have to look at again, it seemed to go into a similar direction. Fork/Join /w reducers is

Re: Custom core.async go threadpools? Using go parking for heavy calculation parallelism throughput?

2018-05-01 Thread Leon Grapenthin
can use channels coming into the blocks starting threads to control the > parallelism by hand. > > On Tue, May 1, 2018, 03:41 Leon Grapenthin > wrote: > >> Recently I worked on an algorithm where a distributed tree is (sort of) >> flattened in a way that each node runs a

Custom core.async go threadpools? Using go parking for heavy calculation parallelism throughput?

2018-05-01 Thread Leon Grapenthin
Recently I worked on an algorithm where a distributed tree is (sort of) flattened in a way that each node runs a commutative aggregation over all of its child nodes calculations. 1 A node can obviously not pmap over all the child nodes (would spawn exponential amount of threads). 2 If I want t

Re: Why does the `def-` not exist?

2018-03-01 Thread Leon Grapenthin
I guess unqualified meta keywords are reserved for the compiler anyway so it could just warn if it doesn't know a unqualified kw. -- 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

Re: Why does the `def-` not exist?

2018-02-28 Thread Leon Grapenthin
The one issue with the lack of def- is the existence of defn-. If defn- didn't exist, no one would ask for def-. I believe this is where the "regret" comes from. The other issue with the lack of def- is that its annoying to type ^:prviate. I don't see how you could accidentally mistype it (never

Re: Why does the `def-` not exist?

2018-02-27 Thread Leon Grapenthin
hese in the old clojure-contrib ( > https://github.com/clojure/clojure-contrib/blob/master/modules/def/src/main/clojure/clojure/contrib/def.clj > > - but no def- !). > > How often do you def things anyway (much less private things)? > > On Monday, February 26, 2018 at

Re: Why does the `def-` not exist?

2018-02-26 Thread Leon Grapenthin
while I agree with you that it would be somewhat useful, bikeshedding > only gets you so far. > > On Monday, February 26, 2018 at 7:17:05 PM UTC+2, Leon Grapenthin wrote: >> >> - How many times do you just write (def ...) instead of (def ^:private >> ...) because you ar

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Leon Grapenthin
y, February 26, 2018 at 10:59:53 AM UTC-6, Leon Grapenthin wrote: >> >> Thank you for this tool. >> >> I'm using this for a rather large new project right now and already love >> how precise and minimalistic this tool is. Features like -Sverbose, -Stree >&g

Re: Why does the `def-` not exist?

2018-02-26 Thread Leon Grapenthin
- How many times do you just write (def ...) instead of (def ^:private ...) because you are not sure whether you need the definition yet, want to save effort, and then you forget to add ^:private later? - How many times have you implemented def- yourself into your project and then used only half

Re: [ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-26 Thread Leon Grapenthin
Thank you for this tool. I'm using this for a rather large new project right now and already love how precise and minimalistic this tool is. Features like -Sverbose, -Stree and now -Sdescribe are very helpful. Although it is probably not intended I don't think we will be using Leiningen and B

Re: Anyone mourns the loss of: tryclj.com ?

2017-12-16 Thread Leon Grapenthin
On tryclj I entered my first Clojure forms. The 5 minutes tutorial was great because it made me want to learn more. Whether JS or JVM, we should get a substitute up and running, preferably on the home page. On Saturday, December 16, 2017 at 4:29:23 AM UTC+1, Didier wrote: > > Just realized that:

[ANN] Clojure 1.9.0-beta3

2017-10-26 Thread Leon Grapenthin
Have you considered calling it clojure.spec.alpha.skip-macros ? Would make sense if you intend to ignore that setting in 2.0 (or any later release with spec nonalpha) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: [core.spec] Stricter map validations?

2017-10-10 Thread Leon Grapenthin
how you could define a time when all specs need to be > present. How would I enter this spec at the repl if spec definition was > required at s/keys invocation time? > > > On Friday, October 6, 2017 at 4:32:41 PM UTC-7, Leon Grapenthin wrote: >> >> The argument that e

Re: [core.spec] Stricter map validations?

2017-10-06 Thread Leon Grapenthin
ne s/keys specs without correspondingly speccing the leaves as an > "incrementally lock down/validate" approach, I wouldn't be too upset if I > lost that ability and it started throwing an error. I mean it throws an > error if I go to generate it anyway. > > On Friday

Re: [core.spec] Stricter map validations?

2017-10-06 Thread Leon Grapenthin
ys specs without correspondingly speccing the leaves as an > "incrementally lock down/validate" approach, I wouldn't be too upset if I > lost that ability and it started throwing an error. I mean it throws an > error if I go to generate it anyway. > > On Friday, October 6,

Re: [core.spec] Stricter map validations?

2017-10-06 Thread Leon Grapenthin
k} > boot.user=> > > On Friday, October 6, 2017 at 5:56:29 AM UTC-7, Leon Grapenthin wrote: >> >> Open maps/specs are fine. >> >> s/keys supporting unregistered specs are not. >> >> At least to me. I just fixed two more bugs in production that we

Re: [core.spec] Stricter map validations?

2017-10-06 Thread Leon Grapenthin
Open maps/specs are fine. s/keys supporting unregistered specs are not. At least to me. I just fixed two more bugs in production that were would not have happened. What are the supposed benefits of this feature? I can only infer "being able to require keys without their spec being known" whi

Re: [core.spec] Stricter map validations?

2017-10-03 Thread Leon Grapenthin
s and keysets I'm fine with them. However, I use select-keys after validating data over the wire. Would be nice if there were some "select-spec" for open specs. On Tuesday, October 3, 2017 at 5:03:01 AM UTC+2, Alex Miller wrote: > > > On Monday, October 2, 2017 at 12:30:57 PM

Re: [core.spec] Stricter map validations?

2017-10-03 Thread Leon Grapenthin
My critique is not towards closed keysets but about being able to (s/keys :req [::some-kw]) without having defined the spec ::some-kw, but e.g. ::soem-kw instead. This can trip you up badly, and not at compile time. I'd be surprised if this never happened to you. Regarding open maps and keysets

Re: Help ship Clojure 1.9!

2017-10-02 Thread Leon Grapenthin
Since spec is mainly a dependency of 1.9. to improve error reporting over 1.8 (correct me if I'm wrong), I'd like to point out this ticket again: https://dev.clojure.org/jira/browse/CLJ-2013 It solves what I determined the root cause of this report https://groups.google.com/d/msg/clojure/mIlKaO

Re: [core.spec] Stricter map validations?

2017-10-02 Thread Leon Grapenthin
I second this from my experience, using spec quite extensively since its release. We already had some invalid data passing silently because of this. It can easily happen if you have a typo in the spec. Also we never experienced benefits from being able to not spec keys required in s/keys. It a

Re: Code Review -- Testing truthiness twice

2017-10-01 Thread Leon Grapenthin
fix (defn get-if [m pred] (let [[match & more] (filter (comp pred key) m)] (if (and match (not more)) (val match Apologies. On Sunday, October 1, 2017 at 11:44:27 PM UTC+2, Leon Grapenthin wrote: > > 1. In general this style of iteration is not idiomatic unless you are

Re: Code Review -- Testing truthiness twice

2017-10-01 Thread Leon Grapenthin
1. In general this style of iteration is not idiomatic unless you are hunting performance or write sth. that simply can't be composed from core sequence library (s. b.). If you have to write this style, look at `when-first`, `seq`, `next`. Study implementation of core library. More idiomatic im

Re: ANN: ClojureScript 1.9.854

2017-07-30 Thread Leon Grapenthin
Yes, it does make CLJSJS obsolete and the new method is to include Node modules from NPM. CLJSJS was never the one true way, especially for production. It lacked deduplication of transitive dependencies that were not packed per CLJSJS and of course support for dependencies that where are not in

Re: ANN: ClojureScript 1.9.854

2017-07-30 Thread Leon Grapenthin
Amazing release, trying it out right now. Just wanted to see if including this works: https://github.com/coopermaruyama/react-web3 I try to :require it via [react-web3 :as w3] Unfortunately this gives me a not-found error. Also I noticed that CLJS indeed downloaded react-web3 to "node_modules"

Re: [clojure.spec/form] Need for evaluated subspecs

2017-05-20 Thread Leon Grapenthin
Hi Alex, thanks for replying. Indeed I don't have practical use for s/form right now; I'm just trying to guess what could be a good use in the future :) On Thursday, May 18, 2017 at 10:01:25 PM UTC+2, Alex Miller wrote: > > > > On Thursday, May 18, 2017 at 12:37:26 PM

Re: [clojure.spec/form] Need for evaluated subspecs

2017-05-18 Thread Leon Grapenthin
I also have this problem. 1. If I create a dynamic spec constructor per defmacro and invoke it, it's s/form gives the primitive specs form - because spec doesn't provide me with a way to facilitate specs that capture their form. 2. If I apply that invocation to another primitive spec, s/form o

Re: [ANN] Clojure 1.9 / clojure.spec split

2017-04-26 Thread Leon Grapenthin
Thanks for the update, this seems like a good decision allowing things to evolve more quickly. Does that also mean that there are no breaking changes intended to current non .alpha namespaces/APIs? Kind regards, Leon On Wednesday, April 26, 2017 at 5:30:56 PM UTC+2, Alex Miller wrote: > > We

Re: (doseq/lazy/interop)? problem, different behaviour when adding a println

2017-04-26 Thread Leon Grapenthin
Hi Lucas, lazy sequences, as the one produced by the map/filter construct, aren't realized at once. I. e. they are returned as a sequence, but your map and filter lambdas are only invoked once somebody looks at whats in the sequence. Usually, steps are evaluated in chunks of size 32. Your filt

Re: clojure.spec explain and multi-arity functions with first optional argument

2017-04-23 Thread Leon Grapenthin
Please try whether my CLJ-2013 patch fixes the issue for you. From my observation it should. On Saturday, April 22, 2017 at 7:31:48 PM UTC+2, Yegor Timoshenko wrote: > > (require '[clojure.spec :as s]) > (require '[clojure.spec.test :refer [instrume

Re: Is it normal for exercise-fn to return examples that don't conform?

2017-04-02 Thread Leon Grapenthin
Generated samples aren't unique. Conform like this: (s/conform (:args (s/get-spec `wtv)) [0]) On Thursday, March 30, 2017 at 2:55:35 AM UTC+2, Didier wrote: > > If you look at this example: > > (defn wtv [in] (if (= 0 in) 0 10)) > (s/fdef wtv > :args (s/cat :in int?) > :ret (s/a

Re: Version control at the function level - a la Rich

2017-02-17 Thread Leon Grapenthin
Look for https://github.com/Datomic/codeq. Certainly there is more potential to pursue this nowadays with tools.analyzer. There is also an open source Java git implementation which might be worth checking out as a replacement for shelling out. I find this an interesting topic to explore. Here i

Re: cognitect.http-client submit spec mismatch

2017-02-17 Thread Leon Grapenthin
tering the problem? > > On Friday, February 17, 2017 at 4:05:28 AM UTC-6, Leon Grapenthin wrote: >> >> I don't know where else to file this bug: >> >> - The spec of submit is in the .specs namespace, and it does not refer to >> the correct var. >>

cognitect.http-client submit spec mismatch

2017-02-17 Thread Leon Grapenthin
I don't know where else to file this bug: - The spec of submit is in the .specs namespace, and it does not refer to the correct var. -- 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

Re: if nil is true

2017-01-30 Thread Leon Grapenthin
Hi Sayth, welcome to Clojure. Read like this: (nil? nil) ;-> true Is nil nil? True. (true? nil) ;-> false Is nil true? False. Kind regards, Leon. On Monday, January 30, 2017 at 8:34:09 AM UTC+1, Sayth Renshaw wrote: > > Hi > > If nil is true > > clojure-noob.core> (nil? nil) > true > > Th

Re: clojure.spec: behaviour of ? macro

2017-01-28 Thread Leon Grapenthin
Hi Marc, note that the return of gen/sample is 10 examples. Each one is a collection. So the collection [] matches your spec, as does [:c]. And so on. A regex-op outside of a regex-op always specs a collection. If used within another regex-op, it just specs an element. To illustrate: (gen/s

Re: Spec of conform of spec

2016-12-09 Thread Leon Grapenthin
Alex, I thought about this and it appears to be a convenience problem. Spec is e. g. excellent to parse a e. g. a Query DSL (which is my current side project) via conform. But then you have that large data structure that you want to break down and operate on in several functions. So you need to

Re: s/def: Rationale, tradeoffs? When to emulate this pattern?

2016-11-29 Thread Leon Grapenthin
While I can follow "we have namespaced names" I find it difficult to follow "too much stuff onto vars and var meta". I feel this is what OP is asking for. - What is meant by "too much"? When is var metadata "too much"? - What problem can/did result from "too much"? - Why is this assumed limitati

Re: s/def: Rationale, tradeoffs? When to emulate this pattern?

2016-11-29 Thread Leon Grapenthin
The registry is stored in a global atom which is usually considered an anti-pattern in library code. It makes sense here though, based on the idea that global conflicts are avoided by namespaced keywords. What bothers me though is reloadability. When I hit clojure.tools.namespace.repl/reload-al

Re: When to halt-when?

2016-11-03 Thread Leon Grapenthin
ot;oops"}] (range 3))) > > ;;=> {:err "oops"} > > > > > > On Thursday, November 3, 2016 at 1:06:36 PM UTC-5, Leon Grapenthin wrote: >> >> What is the intended usage of halt-when? >> >> The naming of halt-when hints at imperative / non-c

Re: comp and partial vs ->>

2016-11-03 Thread Leon Grapenthin
This style is only good if you do damn good naming on your "explaining variables". So while more names can really improve readability, bad names do the opposite by adding confusion and misdirection. This pattern enforces naming for every step. Good names are difficult, so I can only recommend to

When to halt-when?

2016-11-03 Thread Leon Grapenthin
What is the intended usage of halt-when? The naming of halt-when hints at imperative / non-collection contexts but I'm failing to guess what such a context could look like? What is an intended usecase for the default behavior "the input that triggered the predicate will be returned"? For co

Re: Is there an easy way for s/keys spec to work against both qualified/unqualiffied keys at the same time?

2016-10-14 Thread Leon Grapenthin
They are not exclusive (s/def ::baz (skeys :req [::foo] :req-un [::bar])) works. On Friday, October 14, 2016 at 7:07:39 AM UTC+2, Ikuru Kanuma wrote: > > Hi, > > I was reading the official spec guide's explanation for the s/keys macro, > played around with it a bit, > and was a little surprised

Re: complex made simple?

2016-10-14 Thread Leon Grapenthin
Rich has mentioned Polyas "How to solve it" in several talks. It's a great book on the matter. On Friday, October 14, 2016 at 11:59:56 AM UTC+2, Alan Forrester wrote: > > In Rich Hickey's talk "Simple Made Easy" he mentioned that there are > ways to take a system that somebody else wrote that is

Re: Clojure docstring style

2016-09-22 Thread Leon Grapenthin
Couldn"t you just do it like this? 1. Parse docstring into symbols 2. If symbol is defined in the current ns, hyperlink 3. If symbol is namespace-qualified, hyperlink 4. If symbol is name of an arg, hyperlink This should leave very few false positives where an english word is the name of a var i

Re: core.async top use cases

2016-09-19 Thread Leon Grapenthin
It is not just convenience. For example agents don't provide functionality like buffering, backpressure and select aka alts. If you send an action to an agent you don't get to know when it's done or to choose what to do if it is currently busy. On Monday, September 19, 2016 at 11:49:13 AM UTC+

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-24 Thread Leon Grapenthin
Hi Alex, I could track down why explain stops early. http://dev.clojure.org/jira/browse/CLJ-2013 On Wednesday, August 24, 2016 at 11:33:43 PM UTC+2, Leon Grapenthin wrote: > > > On Tuesday, August 23, 2016 at 3:27:28 AM UTC+2, Alex Miller wrote: >> >>

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-24 Thread Leon Grapenthin
On Tuesday, August 23, 2016 at 3:27:28 AM UTC+2, Alex Miller wrote: > > predicate: (cat :args (* :clojure.core.specs/binding-form) :varargs (? > (cat :amp #{(quote &)} :form :clojure.core.specs/binding-form))), > > the predicate that is actually failing in the spec, probably not > particularly

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-22 Thread Leon Grapenthin
I welcome the strict checking over backwards compatibility for broken syntax. E. g. allowing things like symbols in the ns decl would require supporting that as a feature in future updates, analyzer code, other hosts etc. The Clojure devs should not have to worry things with so little use. Stil

Re: [ANN] Automatic Clojure Type Annotations

2016-08-17 Thread Leon Grapenthin
Wow. I can imagine this saving a day or two when trying to type or spec a legacy codebase. Wouldn't it also be / Is it possible to infer deeper calling levels? I. e. if (defn f [x] (g x)) generate types/specs for g and f from (f 42)? Because when one doesn't have unit tests, she could gain expo

Re: [ANN] Clojure 1.9.0-alpha9

2016-07-06 Thread Leon Grapenthin
1.9 could still support the behavior that worked in 1.8 and in CLJS, too, or throw a compile time Exception. If we had known this change in behavior, fixing it in the codebase wouldn't have been much trouble. But a missing default can lead to errors far away so it takes time to get to the grou

Re: [ANN] Clojure 1.9.0-alpha9

2016-07-06 Thread Leon Grapenthin
nesday, July 6, 2016 at 1:43:46 PM UTC+2, Alex Miller wrote: > > This is the correct behavior. The :or map keys are always the local names > being bound (not the keys being looked up in the map). > > > On Jul 6, 2016, at 4:40 AM, Leon Grapenthin > wrote: > > > > A

Re: [ANN] Clojure 1.9.0-alpha9

2016-07-06 Thread Leon Grapenthin
Another small bug report: (let [{:keys [a/b] :or {a/b 42}} {}] b) Evaluates to nil, but should evaluate to 42 (let [{:keys [a/b] :or {b 42}} {}] b) Evaluates to 42, but should evaluate to nil. On Tuesday, July 5, 2016 at 9:50:47 PM UTC+2, Alex Miller wrote: > > Clojure 1.9.0-alpha9 is n

Re: [ANN] Clojure 1.9.0-alpha9

2016-07-06 Thread Leon Grapenthin
Small bug report Throwable->map in core_print.clj doesn't handle Throwable.getCause returning null in L463. This results in a NPE in StrackTraceElement->vec in the same file in some cases, so printing a stacktrace results in a new Exception which is a bit confusing. On Tuesday, July 5, 2016 at

Re: clojure.spec Invalid token error from different namespace when specs are registered with number

2016-06-29 Thread Leon Grapenthin
I believe that this is a problem with how the reader resolves aliased keywords as the problem can be reproduced without spec. You should file a JIRA ticket. On Wednesday, June 29, 2016 at 9:22:49 AM UTC+2, Mamun wrote: > > Hi, > > Invalid token error from different namespace when specs are regis

Re: clojure.spec Invalid token error from different namespace when specs are registered with number

2016-06-29 Thread Leon Grapenthin
token: :a/1 clojure.lang.Util.runtimeException (Util.java:221) ::1 -> :user/1 On Wednesday, June 29, 2016 at 4:21:49 PM UTC+2, Leon Grapenthin wrote: > > I believe that this is a problem with how the reader resolves aliased > keywords as the problem can be reproduced without spec. You shoul

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Leon Grapenthin
This is fantastic. Spec really seems to turn out like a "killer-feature" for Clojure. On Wednesday, June 29, 2016 at 12:13:25 AM UTC+2, Alex Miller wrote: > > Clojure 1.9.0-alpha8 is now available. > > Try it via > > - Download: > https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha8 >

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Leon Grapenthin
I welcome the current naming because for the naming to be consistent it is also necessary that names and forms of spec describe what is expected of specified data. In fact every does require every element to conform to a spec, not just some so it is semantically correct. (s/sample (s/and num

Re: tips on writing modern idiomatic code

2016-06-21 Thread Leon Grapenthin
https://github.com/bbatsov/clojure-style-guide is a good place to start. On Tuesday, June 21, 2016 at 2:46:22 PM UTC+2, Sergey Didenko wrote: > > Hi, > > What would you advise for writing-rewriting your Clojure code in MODERN > idiomatic way? > > Using Kibit? > > Pasting your code samples on som

Re: Spec of conform of spec

2016-06-18 Thread Leon Grapenthin
::even-spec) [2]) > ;= {:user/label-odd 2} > (s/valid? (s/keys) *1) > ;= false > (s/explain (s/keys) *2) > ; In: [:user/label-odd] val: 2 fails spec: :user/label-odd at: > [:user/label-odd] predicate: odd? > ;= nil > ``` > > > On Saturday, June 18, 2016, Leon Grapenth

Re: Spec of conform of spec

2016-06-18 Thread Leon Grapenthin
Given that conform takes an arbitrary (opaque) function, I don't think > that's generically possible. > > > On Saturday, June 18, 2016 at 7:37:33 AM UTC-5, Leon Grapenthin wrote: >> >> Assume I parse with conform. >> >> Then I have functions that operate

Spec of conform of spec

2016-06-18 Thread Leon Grapenthin
Assume I parse with conform. Then I have functions that operate on the value returned by conform. I want to spec them. But I can't get a spec for the value returned by conform (so that I can spec said functions) automatically. Imagine `(s/conform-spec ::my-spec)` would return the spec of the

Re: instrumenting clojure.core

2016-06-14 Thread Leon Grapenthin
, Leon. Apologies for not reading more >> closely! Yours is a much more interesting puzzle. >> >> Here's an attempt I made >> <https://gist.github.com/atroche/2248efce0dee46a92d021a8bf7e96237>, >> groping towards it using reflection, but I couldn&#

Re: instrumenting clojure.core

2016-06-13 Thread Leon Grapenthin
g. I wrote up an example > <https://gist.github.com/atroche/731f80376985773c60d5e943b38d8052> that > might be helpful. > > @Ryan thanks for starting this thread, and @Alex thanks for responding. > It's been an interesting discussion! > > Cheers, > > > On Monday

Re: instrumenting clojure.core

2016-06-12 Thread Leon Grapenthin
ote: > > > On Sunday, June 12, 2016 at 9:22:24 AM UTC-5, Leon Grapenthin wrote: >> >> That looks great already. I'm also interested in what the official >> workflow for adding specs to core is going to be and whether contributions >> are desired. >> &g

Re: instrumenting clojure.core

2016-06-12 Thread Leon Grapenthin
That looks great already. I'm also interested in what the official workflow for adding specs to core is going to be and whether contributions are desired. The last example seems like it could be better because the user has to infer how identity was called within map. So what we'd want is a cod

Re: Variadic run!

2016-05-29 Thread Leon Grapenthin
run is a high performance version of (dorun (map ...)), implemented via reduce which also doesn't support a variadic fn. Probably (dorun (map ...)) is what you are looking for? On Sunday, May 29, 2016 at 10:27:54 PM UTC+2, Claudius Nicolae wrote: > > run! can eagerly map a function over a coll.

Re: Variadic run!

2016-05-29 Thread Leon Grapenthin
Have you considered (concat coll1 coll2)? On Sunday, May 29, 2016 at 10:27:54 PM UTC+2, Claudius Nicolae wrote: > > run! can eagerly map a function over a coll. > I think it would be nice to support multiple collections, making it an > eager version of map. > > My particular use case is running a

Re: clojure.spec

2016-05-28 Thread Leon Grapenthin
That's amazing, David - and much sooner than expected. Thanks for porting so fast. Going to use in production asap :) One question: What is the direction regarding macros? Given that error messages are going to be greatly improved once macros are specified I am curious of course- can one just w

Re: clojure.spec

2016-05-25 Thread Leon Grapenthin
Just had a chance to play around with spec. Looks like this is going to destroy a lot of problem space :) Thanks. Probably a bug: (s/exercise (s/and set? (s/coll-of (s/with-gen keyword? #(gen/elements [:s1 :s2 :s3])) #{}))) ;-> ([#{}

Re: Callback fn in core.async/put!

2016-04-28 Thread Leon Grapenthin
RA: http://dev.clojure.org/jira/browse/ASYNC-167 > Alan > > On Wed, Apr 27, 2016 at 12:34 AM, Leon Grapenthin > wrote: > >> It is true if the put did succeeded, false if the channel was already >> closed. >> >> Should be clarified in the docstr. "Will throw if closed

Re: Callback fn in core.async/put!

2016-04-27 Thread Leon Grapenthin
It is true if the put did succeeded, false if the channel was already closed. Should be clarified in the docstr. "Will throw if closed." is also not true. On Wednesday, April 27, 2016 at 5:48:09 AM UTC+2, Alan Thompson wrote: > > The docs for put! say > > (put! port val) > (put! port val fn0) >

Re: How to configure a library from a file in the project that has it as a dependency?

2016-04-20 Thread Leon Grapenthin
It's very simple: Leave configuration file management and stuff out of the lib. Instead, pass the translations dictionary to your library as an argument. On your app level, you could still load the desired dictionary from a config file but the lib should stay independent of this. On Wednesday

Re: [ANN] CIDER 0.12 (Seattle)

2016-04-18 Thread Leon Grapenthin
Is there still a one page version of the manual so that I can use full text search like on the old README? Asking beacuse the readthedocs search function returns 0 results for "shortcut" or "shortcuts". Besides thank you very much. On Sunday, April 17, 2016 at 4:54:44 AM UTC+2, Bozhidar Batsov

Re: [ANN] CIDER 0.11 Released!

2016-03-03 Thread Leon Grapenthin
Congratulations. Cider is really awesome! On Thursday, March 3, 2016 at 6:42:48 AM UTC+1, Bozhidar Batsov wrote: > > Hey everyone, > > CIDER 0.11 (a.k.a. Bulgaria) is finally out! > > Today Bulgarians (like me) celebrate the country's Liberation Day and the > rest of the > world will get to celeb

Re: [ANN] walmartlabs/active-status 0.1.2

2016-02-02 Thread Leon Grapenthin
That seems like a cool thing to have. Thank you. On Tuesday, February 2, 2016 at 10:31:10 PM UTC+1, Howard M. Lewis Ship wrote: > > Library for allowing a command line application to report status of > multiple asynchronous jobs using an update-in-place status board > implemented using termina

Re: [ANN] New clojure.org!

2016-01-18 Thread Leon Grapenthin
Have you considered linking to or embedding Rich Hickeys videos "Clojure for Java programmers", "Clojure for Lisp programmers" and "Clojure data structures"? When I was learning the language they served as excellent introductory material and among facts really conveyed a "feeling" for the langu

Re: [ANN] New clojure.org!

2016-01-14 Thread Leon Grapenthin
Amazing. I really like the clean and minimalistic design. Congratulations! On Thursday, January 14, 2016 at 4:45:06 PM UTC+1, Alex Miller wrote: > > The new http://clojure.org is alive! > > Most of the content on the site is the same content as before (but in a > new shinier package). However, t

Re: CIDER 0.10 is out!

2015-12-27 Thread Leon Grapenthin
Wow. The debugger is simply awesome. Thanks! The inline evaluation with in buffer display is also a cool feature. And it works really well with the debugger. Upgrading highly recommended :) On Saturday, December 26, 2015 at 4:11:53 PM UTC+1, frye wrote: > > > On Tue, Dec 22, 2015 at 10:57 AM,

Re: Why "some-fn" is not called "some-pred" or "every-pred" is not called "every-fn" and vicer-versa.

2015-12-21 Thread Leon Grapenthin
Do you have an example where it would be more useful? On Monday, December 21, 2015 at 2:20:41 AM UTC+1, Mike Rodriguez wrote: > > The distinction between names is important when one is a predicate and the > other is not. However I think it would be more useful if it were every-fn > since it is o

Re: Why "some-fn" is not called "some-pred" or "every-pred" is not called "every-fn" and vicer-versa.

2015-12-20 Thread Leon Grapenthin
every-pred is guaranteed to return a boolean value. some-fn returns the first logical true value of one of the fns passed. On Sunday, December 20, 2015 at 6:42:42 PM UTC+1, Jesus Bejarano wrote: > > Seems to me like it would be more consistent, right? > -- You received this message because you

Re: core.async channel /w transducer which thread?

2015-12-17 Thread Leon Grapenthin
22 GMT+01:00 Leon Grapenthin >: > >> The blocking put is made on a separate thread (channel named res), then >> later a blocking take from that same channel is made in the second go-loop. >> > >> Or are you saying "if it takes too long, parallelize via pipeline&

Re: core.async channel /w transducer which thread?

2015-12-16 Thread Leon Grapenthin
take long enough that you > care about where it executes, you should use async/pipeline instead. > > Timothy > > On Wed, Dec 16, 2015 at 4:16 AM, Leon Grapenthin > wrote: > >> Is it safe to say that a transducer in a channel always executes on the >> producer thr

core.async channel /w transducer which thread?

2015-12-16 Thread Leon Grapenthin
Is it safe to say that a transducer in a channel always executes on the producer thread? Kind regards, Leon. -- 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 memb

Re: [ANN] Clojure 1.8.0-RC1 is now available

2015-11-12 Thread Leon Grapenthin
Does this mean putting it in the arglist always works and there is rarely a practical reason to do anything else? On Thursday, November 12, 2015 at 8:36:20 PM UTC+1, Nicola Mometto wrote: > > It.. depends :( > > If your type hint is a *primitive* then you want to put it in the arglist. > If you

Re: [ANN] Let's make clojure.org better!

2015-11-12 Thread Leon Grapenthin
I'd like to say that as a Clojure programmer I really like the current page. The reference documentation is an excellent resource. It does not answer all questions, but it answers the most critical ones very concisely and I hope that you intend to keep it like that. If one thing about the pa

scheduling with core.async?

2015-09-22 Thread Leon Grapenthin
Is it recommended to use core.asyncs timeout channel to wait on hour or even longer for light scheduling tasks? High precision is a nongoal. Kind regards, Leon. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: [ANN] com.stuartsierra/component 0.3.0 now with ClojureScript

2015-09-19 Thread Leon Grapenthin
Thanks for the release. Given that you were originally sceptical towards CLJS support, is there a particular application or use case that made your change your mind? Kind regards, Leon. On Friday, September 18, 2015 at 10:51:19 PM UTC+2, Stuart Sierra wrote: > > 'Component' - lifecycle and dep

Re: Weird GenSyms behaviour across different quoted blocks in a macro

2015-08-26 Thread Leon Grapenthin
What Ambrose said and: There is no need to use a hash for i in the for form. It is misleading because one thinks it will become a generated symbol as part of the generated form which is untrue. On Wednesday, August 26, 2015 at 11:08:12 PM UTC+2, Rafik NACCACHE wrote: > > Suppose I have the foll

Re: Function syntax

2015-08-13 Thread Leon Grapenthin
It is a matter of personal style. Note that there is a max function. On Thursday, August 13, 2015 at 1:53:23 PM UTC+2, Herwig Hochleitner wrote: > > Yep, I meant the thing, `vector` is doing. Thanks! > > 2015-08-13 13:36 GMT+02:00 Amith George > > : > >> Maybe you meant to use `vector` instead of

Re: add-watch and writing data into a core.async channel

2015-07-31 Thread Leon Grapenthin
Use put! On Friday, July 31, 2015 at 8:21:18 AM UTC+2, Raymond Huang wrote: > > I'd like to use `add-watch` on an atom which writes the data to a > core.async channel. So far, I've come up with this, but it seems bad > because I create a new go-routine everytime something happens. > > (add-watch

Re: #{:eduction :performance} Trying to understand when to use eduction

2015-07-19 Thread Leon Grapenthin
he > operations in a nested transformation are chunked. However, every new layer > adds another set of (chunked) sequence allocation. Eduction or anything > transducer-based is going to do no seq allocation and execute as a single > eager pass. Generally this means that transducer stuff

Re: Advice on introducing a Java dev to Clojure

2015-07-18 Thread Leon Grapenthin
I have tried various different approaches from convincing of Clojure advantages in the Java devs concrete domain, showing off incredibly awesome toy projects, larger projects, not tryng to sell, trying to sell, sending ClojureTV videos and what not approach you can think of. I have not managed

Re: Advice on introducing a Java dev to Clojure

2015-07-18 Thread Leon Grapenthin
I have tried various different approaches from convincing of Clojure advantages in the Java devs concrete domain, showing off incredibly awesome toy projects, larger projects, not tryng to sell, trying to sell, sending ClojureTV videos and what not approach you can think of. I have not managed

#{:eduction :performance} Trying to understand when to use eduction

2015-07-18 Thread Leon Grapenthin
My understanding was that if I pass an eduction to a process using reduce, I can save the computer time and space because the per step overhead of lazy sequences is gone and also the entire sequence does not have to reside in memory at once. When I time the difference between (apply max (map in

Re: Different macro definitions via reader conditionals?

2015-07-02 Thread Leon Grapenthin
@Mike: Great post. I think you should make it more explicit that the :cljs branch of the macro is never used on Clojure and CLJS/JVM. Kind regards, Leon. On Thursday, July 2, 2015 at 3:20:17 PM UTC+2, Mike Fikes wrote: > > I’m interested in whether there is a nice answer to this as well. > > F

  1   2   >