Re: Any updates on spec after “Maybe Not” presentation?

2022-05-25 Thread Dmitry Kakurin
t; Alex > > On Thursday, May 19, 2022 at 4:12:33 PM UTC-5 Dmitry Kakurin wrote: > >> Hello, >> The “Maybe Not” talk from 2018 has hinted at significant upcoming changes >> for spec, such as removal of “:req” keys for map specs and potential >> introduction

Any updates on spec after “Maybe Not” presentation?

2022-05-19 Thread Dmitry Kakurin
Hello, The “Maybe Not” talk from 2018 has hinted at significant upcoming changes for spec, such as removal of “:req” keys for map specs and potential introduction of “spec/select”. But I could not find any additional information in the past 3-4 years on the evolution of that line of development.

Re: [ANN] Instaparse 1.0.0

2013-04-14 Thread Dmitry Kakurin
Interesting, I did not know that. That's OK if checks do not *guarantee* correctness. But having 20/80 Pareto principle in mind: if few simple detection technics will warn about 80% of ambiguous grammars (especially the ones found in practice), that would be very helpful. Thanks, Dmitry. -- --

Re: [ANN] Instaparse 1.0.0

2013-04-12 Thread Dmitry Kakurin
y least I'd like to detect ambiguity during my app startup. I.e. I'd like to put a big fat assert during initialization phase. Is there a way to do it now (or planned in the future)? Thanks for being patient with me :-), Dmitry. On Friday, April 12, 2013 12:51:36 AM UTC-7, puzzler wrote:

Re: [ANN] Instaparse 1.0.0

2013-04-11 Thread Dmitry Kakurin
Hi Mark, Brilliant work, thank you! I was playing with your arithmetic parser from tutorial, and noticed the following definition for add and sub: "expr = add-sub = mul-div | add | sub add = add-sub <'+'> mul-div sub = add-sub <'-'> mul-div ... And I realize now that the ord

Re: How Clojure protocols are implemented internally?

2011-05-08 Thread Dmitry Kakurin
Very well, something along these lines would be my guess too. But that would mean that in case 2 protocols are no faster than multimethods. And I've got an impression that protocols are described to be as fast as interface dispatch (callvirt). So either my impression is wrong (which is totally po

Re: How Clojure protocols are implemented internally?

2011-05-07 Thread Dmitry Kakurin
[2] and if it is, calls the count function > implemented in that type. > > [1]https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/R... > [2]https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/C... > > On Sat, May 7, 2011 at 10:00 PM, Dmitry

How Clojure protocols are implemented internally?

2011-05-07 Thread Dmitry Kakurin
Is there a document describing internal implementation of Clojure protocols? I.e. what is happening "under the hood"? To be specific suppose I have extended ICountable protocol with a single "count" method to String class. What happens when I call (count "some string")? At what point dynamic dispat

Recent builds have failed on http://build.clojure.org

2010-07-09 Thread Dmitry Kakurin
The last successful build was on June 23rd. - Dmitry -- 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 pos

Re: ClojureDocs.org

2010-07-09 Thread Dmitry Kakurin
It's a great idea, and the site looks very good. Two suggestions: 1. Move examples section above source code section 2. Add OpenID sign in support. Personally I'm instantly repelled by sites asking me to create another account/password. And I'm sure I'm not alone. Stackoverflow.com is a great examp

How do I extend an existing function to take different number of params?

2010-01-09 Thread Dmitry Kakurin
Suppose I already have a function f that accepts 0 and 1 param: (defn f ([] 0) ([ _ ] 1)) How do I extend it with additional version that takes 2 params? Something like the following that does not override the original: (defn f [ _ _ ] 2) and makes all 3 work: (f) (f 1) (f 1 2) - Dmitry --

Re: Clojure analysis

2009-12-17 Thread Dmitry Kakurin
On Dec 17, 10:42 am, Santhosh G R wrote: > Again the same statement about being humble :-( The "humble" comment relates to the title of your article. Lookup (and contrast) words "analysis" and "opinion" in your favorite dictionary. Were your post named "My opinion about Clojure" I would not make

Re: Clojure analysis

2009-12-17 Thread Dmitry Kakurin
Please keep in mind that it is almost literally the speech that I give to my friends/colleagues when they ask me why am I so excited about Clojure. I did it many times now and I have quickly learned that saying "persistent data structures" gets misinterpreted by every single person as "something yo

Re: Clojure analysis

2009-12-16 Thread Dmitry Kakurin
Judging by the article you've spent very little time "learning" Clojure and have managed to get every key point wrong: > Clojure is a multi-paradigm language no it's not, and it's most certainty not an OOP language: http://clojure.org/rationale > Functional programming finds its best implementat

Re: Generalizing -> & ->>

2009-12-13 Thread Dmitry Kakurin
Thanks for a great idea Andrew! I was slightly annoyed by the lack of consistency in parameter ordering of Clojure collections API (cons vs conj, get/assoc vs filter/ map/take). IMHO the input collection should ALWAYS be the last param. Then simple ->> macro would be sufficient in most cases. Out o

Re: Large lazy seq = StackOverflow?

2009-10-24 Thread Dmitry Kakurin
On Oct 21, 9:14 pm, John Harrop wrote: > You probably therefore want this instead: > > (defn multi-filter [filters coll] >   (let [c (count filters) >         ignore (Object.)] >     (map >       (fn [i] >         (remove #(= % ignore) >           (take-nth c >             (drop i >              

Re: Large lazy seq = StackOverflow?

2009-10-21 Thread Dmitry Kakurin
On Oct 21, 6:45 pm, John Harrop wrote: > the reduction is wrapping the initial seq of empty vectors in ten > thousand layers of map ... fn ... invoke ... map ... etc. > Reducing a lazy sequence generator like map over a large sequence does not > work well in Clojure. I wonder if this could be i

Large lazy seq = StackOverflow?

2009-10-21 Thread Dmitry Kakurin
I have an innocent-looking function that only uses map and reduce, but when I run it on a big collection (10K elements) I get a StackOverflow exception. Here is the function: (defn multi-filter [filters coll] (reduce (fn [res e] (map (fn [f r] (if (f e) (conj r e) r)) filters

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
On Oct 20, 5:52 am, Meikel Brandmeyer wrote: > > (defn multi-filter [filters coll] > >   (reduce > >     (fn [res e] > >       (map (fn [f r] (if (f e) (conj r e) r)) > >         filters > >         res)) > >     (repeat (count filters) []) > >     coll)) > > I think this basically equivalent to

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
nts possible to my emap definition? (defn emap [f c1 c2] (loop [s1 (seq c1) s2 (seq c2) res [] ] (if (and s1 s2) (recur (seq (rest s1)) (seq (rest s2)) (conj res (f (first s1) (first s2 res))) - Dmitry On Oct 19, 12:13 pm, Meikel Brandmeyer wrote: > Hi, > > Am 19.10

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
mitry On Oct 18, 7:20 pm, Alex Osborne wrote: > Dmitry Kakurin wrote: > > I actually like your "tag them then group them" approach. > > But what if the same record can have multiple tags? > > E.g. :sales and :upgrades? > > Hmmm. the first way that occurred to m

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-19 Thread Dmitry Kakurin
The reduce-by approach (while cool) would not work for me because I need to run multiple queries on the results. - Dmitry On Oct 18, 10:54 am, Alex Osborne wrote: > Alex Osborne wrote: > > If the three output lists themselves are too large, I'd just explicitly > > sum your units with reduce: >

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-19 Thread Dmitry Kakurin
ndmeyer wrote: > Hi, > > Am 18.10.2009 um 09:48 schrieb Dmitry Kakurin: > > > > > > > Here is what I have right now: > >  (let [idata ... something ... > >        sales > >          (filter > >            #($ (% "Product T

Best way to run multiple filters on the same [lazy] collection?

2009-10-18 Thread Dmitry Kakurin
I need to run 3 separate filters on the same collection. Can I do this in a single pass thru collection (as opposed to 3 separate passes)? Basically I don't want to bind the head of 'idata' collection because it holds the whole thing in memory. Also collection itself is coming from a file. Here i

Re: Problem with .NET interop

2009-10-15 Thread Dmitry Kakurin
t; -David > > On Oct 13, 2:22 am, Dmitry Kakurin wrote: > > > > > What's wrong with my definition of sqrt? > > > user=> (defn sqrt [x] (. System.Math Sqrt x)) > > #'user/sqrt > > user=> (sqrt 4) > > System.InvalidCastExceptio

Problem with .NET interop

2009-10-13 Thread Dmitry Kakurin
What's wrong with my definition of sqrt? user=> (defn sqrt [x] (. System.Math Sqrt x)) #'user/sqrt user=> (sqrt 4) System.InvalidCastException: Specified cast is not valid. at lambda_method(Closure , Object ) at AFunction_impl.invoke(Object ) at lambda_method(Closure ) at AFunction_im

Re: ClojureCLR limitations

2009-10-13 Thread Dmitry Kakurin
lete test suite.  (It does pass all the tests in > > the test suite, but there is a lot of ground not covered.) > > > -David > > > On Oct 10, 2:29 am, Dmitry Kakurin wrote: > > > > I've read "Programming Clojure" book an I love the language (and the &

Why JVM (and not .NET) is the "primary" platform for Clojure?

2009-10-10 Thread Dmitry Kakurin
I've watched some Clojure screen cast where Rich Hickey mentions that initially Clojure was co-developed for both platforms simultaneously. But then it became too hard and he has dropped .NET support. Out of curiosity, why JVM has won the contest :-)? - Dmitry --~--~-~--~~--

ClojureCLR limitations

2009-10-10 Thread Dmitry Kakurin
I've read "Programming Clojure" book an I love the language (and the book), kudos! I'm evaluating ClojureCLR as a scripting language for my product. Is there a list of ClojureCLR limitations and not implemented features? I've just started playing with it and (after some debugging) discovered tha