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

2018-02-28 Thread Didier
see how > this is a problem. They are beginners and naturally there will be many > things that fail their intuition. > Compiler auto injection on postfix magic I'm strongly opposed to. > > @Alex thanks for your long reply yesterday and the statistics! I'll get > ba

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

2018-02-28 Thread Didier
I think the issue is not with the lack of def-, but with the use of metadata for private, as well as the presence of defn-. Becauae defn- exists, most newcomers think that postfix - on var defining special forms, macros and fns is how you mark things as private. But its not, defn- is a syntacti

Re: Transitive spec generation

2018-02-26 Thread Didier
Don't fully understand what you are doing, but when you run test.check, it seems to not always be generating random sample, it'll grow the samples. When you run sample, it'll always start back from the beginning. You can see that by running: (sgen/sample (s/gen ::test) 100) See how the generat

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

2018-02-26 Thread Didier
as a dependency with: clj -Sdeps "{:deps {org.clojure/spec.alpha {:mvn/version \"0.1.143\"}}}" But I thought Spec was part of Clojure 1.9, and should be auto-imported no? On Monday, 26 February 2018 22:23:00 UTC-8, Didier wrote: > > There was a small bug with the inst

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

2018-02-26 Thread Didier
There was a small bug with the install script around the man pages for me on a fresh openSuse Tumbleweed install. /usr/local/share/man/man1 did not exist. Specifically, /usr/local/share/man did not exist, so I had to manually mkdir it first, and re-run the installer, which only checked for the

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

2018-02-26 Thread Didier
> > I’d even be happy if the default was private for def > I actually prefer private everything by default. Its the public things you want to be reminded to think through carefully. And Var access is pretty straightforward, in case your using a lib and they forgot to make something public you

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

2018-02-26 Thread Didier
I don't see a huge problem with adding def- I think its omission relates to the mantra Encapsulation of information is folly. And thus its trying to discourage you from using private state and namespaces as classes? Maybe? -- You received this message because you are subscribed to the Google G

Re: transients problem

2018-02-24 Thread Didier
n this working: > (zipmap (keys m) (vals m)), you will never get a jumbling of keys and > values. Most of the time when people call seq on a set or map they want to > iterate over it, and that's fine. > > On Sat, Feb 24, 2018 at 2:32 PM, Didier > > wrote: > >>

Re: transients problem

2018-02-24 Thread Didier
> > is there a way round it? > Something else I need to point out is that you really should not use a Set for order. Sets are specifically unordered, and provide no guarantees of order. Try calling first, second and last on #{1 2 3} for example, you'll probably get things back in a different

Re: transients problem

2018-02-24 Thread Didier
n github and look at the Java source to see what types they work with, such as : https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L524 Hope this helps. Didier On Saturday, 24 February 2018 07:15:02 UTC-8, Alan Forrester wrote: > > Calling (first #{1}) gives

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-22 Thread Didier
eally needed too. On Wednesday, 21 February 2018 18:47:20 UTC-8, Alex Miller wrote: > > > On Wednesday, February 21, 2018 at 7:34:00 PM UTC-6, Didier wrote: >> >> I would actually love it if Spec was extended to have the concept of >> types. >> > &g

Re: s/valid? does not tell me if the data is valid as supplied

2018-02-21 Thread Didier
I would actually love it if Spec was extended to have the concept of types. Something where every spec could be tied to a Type, and types could be constructed to have Hierarchies. Not sure what the syntax would be like, but say: (s/def :String ::name string?) (s/def :String ::address (s/and str

[ANN] Reitit 0.1.0 - a fast data-driven routing library for Clojure(Script)

2018-02-19 Thread Didier
Looks good, congrats! -- 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 from this grou

Re: namespace - multiple people

2018-02-11 Thread Didier
@Justin to define contracts like that, spec is probably the best tool. Just agree on a spec for a set of functions in your namespace and then your co-worker can code to the spec. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

[ANN] lein-jlink: A leiningen plugin for custom JRE creation

2018-01-31 Thread Didier
This is awesome! I'll definitly give it a shot. Thanks for putting it together. -- 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 p

Re: If Clojure is to blame for the majority of the startup time, why doesn't ClojureScript proportionally slow down the JavaScript startup time also?

2018-01-25 Thread Didier
say the V8 design. Which one of those three things (or possible combination is it) is what I'm trying to seek answer for here. Thanks everyone, Didier On Thursday, 25 January 2018 12:53:03 UTC-8, tbc++ wrote: > > Really, any comparisons between JS and JVM startup times are not usefu

Call out to improve the wikipedia entry?

2018-01-25 Thread Didier
I noticed the wikipedia entry for Clojure is marked as having multiple issues: https://en.wikipedia.org/wiki/Clojure Would be great if a kind mind would attempt to improve it. I may give it a shot next time I have some free time, but others are welcome to beat me to the punch. -- You receive

Re: If Clojure is to blame for the majority of the startup time, why doesn't ClojureScript proportionally slow down the JavaScript startup time also?

2018-01-25 Thread Didier
Based on the profiling performed here http://clojure-goes-fast.com/blog/clojures-slow-start/ on 1.9, It looks like clojure/core__init.load is the slowest bit with load and requiring spending the most time on, as well as loadClass, followed by clojure/lang/Var.invoke. Wouldn't ClojureScript als

Re: If Clojure is to blame for the majority of the startup time, why doesn't ClojureScript proportionally slow down the JavaScript startup time also?

2018-01-24 Thread Didier
oes some extra tricks to keep this upfront cost down that > are v8-specific: > https://anmonteiro.com/2016/11/the-fastest-clojure-repl-in-the-world/ > > On Fri, Jul 14, 2017 at 6:20 PM Didier > > wrote: > >> This link: >> https://dev.clojure.org/display/design/Impr

Re: How to check Clojure spec's for macros?

2018-01-15 Thread Didier
With macros I believe you get compile time check, ie, static checking. This is because the input to a macro is availaible at compile time, so spec just validates it on macro-expanssion. You can use test.check to instrument a generative test to test the expanded code too if you want. -- You r

[CfP] 11th European Lisp Symposium, 16-17 Apr 2018, Marbella, Spain

2017-12-18 Thread Didier Verna
USA Local chairs: Andrew Lawson & Nick Levine, Ravenpack, Spain Programme committee: tba Search Keywords: #els2018, ELS 2018, ELS '18, European Lisp Symposium 2018, European Lisp Symposium '18, 10th ELS, 10th European Lisp Symposium, European Lisp Conference 2018, European Li

Map spec which can specify value spec for non keyword keys?

2017-12-16 Thread Didier
Hum, could you show me an example use of it, I'm having a hard time understanding how. I also stumbled upon a use case where we have a multi-spec of keys spec. And each one needs to have a key with same name, yet a different spec to it, only for some of their keys. Could keys* be used for that

Re: Unexpected performace of transducers

2017-12-16 Thread Didier
| I didn't fully grasp the difference between self-reducible collections v.s. other ones (in this context, and in general). Can you please delineate? I think this means that collections which implement CollReduce have an implementation of reduce which is faster than just calling first and next

Anyone mourns the loss of: tryclj.com ?

2017-12-15 Thread Didier
Just realized that: tryclj.com is gone. I wonder if clojure.org could come to the rescue, and add a try-me web repl on it. I feel like tryclj when I first got started and became interested was a great gateway. repl.it is just a little too bloated for my liking as a replacement. -- You receive

Map spec which can specify value spec for non keyword keys?

2017-12-14 Thread Didier
If I have a function that takes a destructured map, what's the best way to spec that function, so that the values of the keys in my map are also specced? The best I've got right now is (s/keys :req-un [::a ::b ::c]) given (defn foo [{:keys [a b c]}) But, I'd kind of want the names of the keys

Symbols and Vars for specs?

2017-12-11 Thread Didier
s/def docs says: "Given a namespace-qualified keyword or resolvable symbol ..." But I'm unable to s/def a spec using a resolvable symbol: (def foo 123) (s/def foo int?) (s/get-spec foo) => nil (s/get-spec 'foo) => nil (s/get-spec #'foo) => #object[clojure.spec.alpha$spec_impl$reify__797 0x7215d

Re: Immutable names of things?

2017-12-11 Thread Didier
g EDN. Someone could build an IDE on top of that, which never allows you to change the text, but only works directly at the EDN level with the clojure code as data. It would be a lot of work, but possible I think. On Monday, 11 December 2017 16:12:37 UTC-8, Eric Normand wrote: > > Hi Didi

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-08 Thread Didier
Awesome Job! Now looking forward to spec improving and eventually getting out of alpha! On Friday, 8 December 2017 13:54:26 UTC-8, Rick Moynihan wrote: > > Wow great news... Thanks to everyone who made it happen!! > > R. > > On Fri, 8 Dec 2017, 21:11 Sergey Didenko, > wrote: > >> Congratulation

Immutable names of things?

2017-12-06 Thread Didier
Warning: This is the spawn of an idea, not very well refined, and that is little extravagant. I've been doing some hammock time, and I've been thinking that names in a programming language are kind of a complecting of two things, the human readable form, and the machine identifier. What if a fu

Any data about just how much loc Clojure shaves off java?

2017-11-19 Thread Didier
Hi there, Out of pure curiosity, I was wondering if there was any rewrite or equivalent code out there between Java and Clojure that showed exactly how many LOC you save from switching to Clojure. Especially for larger endeavour. Thanks. -- You received this message because you are subscribe

Re: spec for an agent

2017-11-17 Thread Didier
> On Friday, 17 November 2017 16:53:57 UTC, Didier wrote: >> >> Why do you return an agent from a function? Can't you just return the map >> it conatains instead? And spec that? > > I want to write a function spec (s/fdef) for a function make-agent that > takes

Re: spec for an agent

2017-11-17 Thread Didier
Why do you return an agent from a function? Can't you just return the map it conatains instead? And spec 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 memb

Re: Surprising st/instrument behavior with lazy seqs

2017-11-14 Thread Didier
| One option is to use the non-conforming s/every instead of the conforming s/coll-of Why isn't instrument just validating for all spec? Doesn't conform serve no purpose here? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Surprising st/instrument behavior with lazy seqs

2017-11-14 Thread Didier
That's weird, not sure why you get ClassCastException and not the spec error of add1. That said, you can not validate a lazy-seq without realizing it. You can use s/every? on big collections, that will sample x element and validate only those. So its normal for coll-of to realize the lazy-seq,

Re: [core.spec] Stricter map validations?

2017-11-14 Thread Didier
| I think you're assuming you're validating API endpoints where client and server are tightly coupled. I can imagine a microservices system where some services put maps on a queue and others consume them. The consumers should allow keys they don't understand. They and also need to validate that

Re: [core.spec] Stricter map validations?

2017-11-14 Thread Didier
> > Eric does raise an interesting question tho I think so too. I'm still finding it hard to come up with a single example of why allowing extra keys to validate would ever be useful even for non-breakage. I can't see how it would break anything. I believe the only advantage of allowing extr

Something that has a spec is said to be ???

2017-11-13 Thread Didier
Hey all, I'm facing a naming problem, I can't decide how I want to call something that has a spec. 1. Something that has a spec is said to be *specced.* 2. Something that has a spec is said to be *speced.* 3. Something that has a spec is said to be *specified.* I'm leaning towards

Re: Map Keywords are functions, why not vector elements?

2017-11-13 Thread Didier
Yo are looking for indexOf (.indexOf vector value). (.indexOf ["a" "b"] "b") => 1 (.indexOf ["a" "b" "b"] "b") => 1 Note how indexOf searches for the index of the first value which matches value. To do what you ask, is a query over a vector, which requires a search on each element. This will t

Re: Am I being stupid regarding how much memory I use?

2017-11-12 Thread Didier
> > When folks have an app that needs more RAM than a typical server, what is > the first and most common steps they take? > First step would be to put more RAM, if you've maxed out physical RAM, you can add swap. I'd also look at reducing the RAM usage first. Are you sure you can't stream t

Re: [ANN] Clojure 1.9.0-RC1

2017-11-10 Thread Didier
Is Clojure 1.9 expected to support JDK9? Or is that support reserved for a later version? On Friday, 10 November 2017 10:08:35 UTC-8, Beau Fabry wrote: > > We've switched both of our main projects to RC1 and have had no issues yet. > > On Thursday, November 9, 2017 at 11:49:07 PM UTC-8, Sean Corf

Re: [core.spec] Stricter map validations?

2017-11-10 Thread Didier
iases for fully > qualified keywords, never type out the whole thing. > > On Thursday, November 9, 2017 at 11:22:24 PM UTC-8, Didier wrote: >> >> I just stumbled upon another potential mistake here. When you have specs >> split across namespaces. Its possible for a map spec i

Re: [core.spec] Stricter map validations?

2017-11-09 Thread Didier
I just stumbled upon another potential mistake here. When you have specs split across namespaces. Its possible for a map spec in one namespace to have one of its key's use a spec from another namespace. If you forget to require that other namespace though, you won't know, and your map will alwa

Re: Doc strings for complex cases?

2017-11-09 Thread Didier
What's the point of doc strings per arity? Wouldn't (doc fn) just concatenate them all back into one anyways? Or would you extend it to take an arity argument? I think it seems to make sense to add them like that, but usability wise, when would you be looking at the doc of a single arity by its

Re: Who Uses import-vars?

2017-11-07 Thread Didier
I found private/public works fine. I put my public interface at the bottom of the file with a nice comment header. Using another namespace like .impl, I've always had the issue that nobody on my team can agree with what the name convention should be for what an impl namespace should be called 😐,

Re: What's up with IMeta?

2017-11-04 Thread Didier
two lazy-seq share the same head? On Saturday, 4 November 2017 11:40:54 UTC-7, James Reeves wrote: > > On 3 November 2017 at 06:57, Didier > > wrote: > >> Okay, I can see how I can maybe infer some of that by piecing together >> the code base, but if there was a book, or

Re: What's up with IMeta?

2017-11-02 Thread Didier
Okay, I can see how I can maybe infer some of that by piecing together the code base, but if there was a book, or a reference somewhere describing more the implementation of Clojure itself I'd be interested to read it, if there is one out there. I'd understand if there's not, I know Clojure has

Re: What's up with IMeta?

2017-11-02 Thread Didier
Wow, thanks. Is that all tribal knowledge? Or is there some documentation around the Clojure interfaces and their semantics somewhere I could read? Maybe even a Clojure book recommendation that covers this? So if I understand correctly, withMeta will return a new object which is not equal to th

Re: [ANN] Clojure 1.9.0-beta4

2017-11-01 Thread Didier
> > FWIW, bigdec? seemed to fit better, given bigdec as a coercion and > BigDecimal as the underlying type – decimal? always seemed like the anomaly. > Thought so too, but since there's no small decimal, or any other decimal, its survivable. Though it does get a bit confusing, especially since

What's up with IMeta?

2017-11-01 Thread Didier
Hey, I was surprised to find that IMeta does not work for (with-meta). So it seems that withMeta is added to IObj, which extends IMeta. And it seems like alterMeta and resetMeta are added in IReference, which also extends IMeta. So now if you want to support meta, you have to implement IReferen

Re: bigdec? vs decimal?

2017-10-30 Thread Didier
Good catch! On Monday, 30 October 2017 08:27:36 UTC-7, Alex Miller wrote: > > Check with Rich and Stu and this was not intentional. > Ticket filed at CLJ-2259. > spec.alpha has been updated to move the generator mapping to decimal? > (released as 0.1.143) > Clojure 1.9.0-beta4 will remove this p

Re: hello world question !!!

2017-10-30 Thread Didier
> > I will see how the initial build toward having something effective for me > compares with the ease of Python. > Python's focus is on making things easy, not simple. Clojure's focus is on simplicity. Lisp's syntax is simple, not easy. So Clojure uses it. Macros extend the language in simple

Feed predicates from clojure.spec to the inference engine/type checker from the Shen java port?

2017-10-29 Thread Didier
Oh, it also follows known values around, and runs them against the specs at static time. So it can catch some value based errors, like a divide by zero, given that the value is available at static time too. -- You received this message because you are subscribed to the Google Groups "Clojure" g

Feed predicates from clojure.spec to the inference engine/type checker from the Shen java port?

2017-10-29 Thread Didier
I'm not sure how shen does it, but you should check out Spectrum: https://github.com/arohner/spectrum It tries to do static analysis of your Clojure code based on your specs. My understanding of it is that it considers equal predicates to be a type. The challenge is knowing that two predicates

Re: Q: How to find out how much Clojure you use

2017-10-26 Thread Didier
I think the Grimoire heatmap is over itself maybe? core/for being top defs, beating core.map does not match up with crossclj usage of the two. On Wednesday, 25 October 2017 23:05:12 UTC-7, Gary Trakhman wrote: > > Grimoire has a usage heatmap, I think it just might be over a few > projects: htt

Re: hello world question !!!

2017-10-20 Thread Didier
I also suggests if you want to understand how to compile Clojure without thw help of tools loke boot or lein, to read those two short tutorials: 1. http://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-the-java-cycle/ 2. http://www.flyingmachinestudios.com/programming/how

Re: hello world question !!!

2017-10-20 Thread Didier
I think you can use lein-ring or lein-uberwar to package any ring based clojure web app into a War. But, a War is just a zip file with a known set of files and directory structure. So depending on your needs, you could create it yourself too. -- You received this message because you are subscr

Re: Releasing scope-capture, a library for easing REPL-based debugging

2017-10-09 Thread Didier
What happens with loops? Say if you spy inside a for? -- 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: [core.spec] Stricter map validations?

2017-10-03 Thread Didier
t to support "close my (open) specs" at runtime = coercion. > > If Runtime Transformations stay out of scope, It would be good to have a > guide on how to write Spec + (beautiful) clojure transformations for > web/ring apps. There might be tricks we just haven't thought of

Re: [core.spec] Stricter map validations?

2017-10-03 Thread Didier
| Spec-tools (https://github.com/metosin/spec-tools) has some tools for this: the spec visitor (walking over all core specs, e.g. to collect all registered specs) and map-conformers: fail-on-extra-keys and strip-extra-keys. I understand the core team wanting to take a minimal approach to spec,

Re: [core.spec] Stricter map validations?

2017-10-03 Thread Didier
| I would have had to re-spec all the intermediate functions I'm not able to follow how that is? You would have only needed this if you are somewhere validating or have setup test.check to run. In both cases, if you wanted to validate, why don't you also want to validate this new field? Or why

Re: [core.spec] Stricter map validations?

2017-10-02 Thread Didier
| we have experienced on virtually every consulting project we'd done including spec at Cognitect I'm sure this is sometimes true, but I can't think of how that would happen. Could you detail it a little? For me, whenever I needed to add more keys, it was simple to evolve the spec with the fu

Re: How to try/catch Let bindings?

2017-10-02 Thread Didier
> Even in an impure language such as Common Lisp we frown on such LET forms True, but as far as I know, in Common Lisp, the condition handler is always in scope of where the error happened, so I wouldn't face this problem. I also struggle to split this up into functions without making it even mo

Re: [core.spec] Stricter map validations?

2017-10-02 Thread Didier
I vote for strict validation also. It's a security threat on most applications not to strictly validate inputs and outputs. I would rather Clojure defaults to be secure, and people needing to implement their own less strict validation consciously. I'm afraid a lot of people will rely on spec for

Re: How to try/catch Let bindings?

2017-10-01 Thread Didier
On Sunday, 1 October 2017 21:00:31 UTC-7, Luke Burton wrote: > > > On Sep 30, 2017, at 3:14 PM, Didier > > wrote: > > Is there another way to execute a set of complex steps which does not rely > on let and can be try/catched in the manner I describe? > > > I can&

Re: How to try/catch Let bindings?

2017-10-01 Thread Didier
I've seen this, I was still curious if the reason I was facing the issue was that let is simply the wrong tool for my use case or not. If let is the correct tool, I would propose that clojure.core should had a try/catch where the catch is in scope of the try. I feel the reason this is contrived

How to try/catch Let bindings?

2017-09-30 Thread Didier
I'm curious how others handle this use case, which I feel should be pretty common. Given you have a series of business process steps, where the flow is too complex for the arrow macros, and you also like to name the step results descriptively, so you use let: (let [a (do-a ...) b (do-b .

Re: Clojure core documentation

2017-09-25 Thread Didier
At first I thought the doc was really complicated and hard to understand, and then I became more familiar with FP and Clojure, and now I think the doc is perfect, sweet, short and to the point. What happens with a lot of those higher order functions is that you really don't understand them unti

Re: Is it wrong that I'm thinking about this?

2017-09-24 Thread Didier
specs are almost entirely s/keys >> and clojure.core predicates. >> >> Our fn spec coverage is 47% on the back-end. So the performance impact of >> instrumentation really hasn't been a concern. >> >> On Fri, Sep 22, 2017 at 10:18:52PM -0700, Didier

Re: Is it wrong that I'm thinking about this?

2017-09-22 Thread Didier
> The goal is to add the macro to orchestra, as a tool to help encourage > spec'ing all functions. That would be great. My macro for now was also not supporting all defn cases yet. And it automatically instruments the fn with orchestra. So if orchestra had a more complete one defacto, I wouldn'

Obtaining the predicate of a spec

2017-09-22 Thread Didier
I'd try to call describe on the spec. As far as I know that's the only introspection feature of spec. See if it returns what you need. -- 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: Is it wrong that I'm thinking about this?

2017-09-20 Thread Didier
ase. > > > > Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > > *From: *Didier > *Sent: *Wedn

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Didier
You shouod also checkout https://github.com/jgpc42/insn/blob/master/README.md It was annouced a few weeks back, looks like a nice interface to ASM. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread Didier
I'm not fully following what you're doing or trying to do, but don't expect meta to compose. A lot of macros and functions can strip it away. Its best kept to annotate global static things. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Is it wrong that I'm thinking about this?

2017-09-20 Thread Didier
e.match pattern-matching with the 'defun' > project? How about the schema s/defn? How would someone combine them when > macros generally don't compose too well? > > I think that sort of thing should be possible, but too opinionated for how > 'core' cloju

Is it wrong that I'm thinking about this?

2017-09-19 Thread Didier
I've been thinking since using Clojure.spec fdef that I'd like something like this: (defns foo [x string? y int?] string? forms) Where an s/fdef spec automatically build of this form: (s/fdef foo :args (s/cat :x string? :y int?) :ret string?)) And obviously the foo var and function w

varying realization of a lazy-seq of strings?

2017-09-17 Thread Didier
Oups, nevermind what I said. str just delegates to .toString and doesn't use *print-readably*. Hum, that is a bit strange then. -- 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 p

varying realization of a lazy-seq of strings?

2017-09-17 Thread Didier
Lazy sequences cache their values after the first time they are evaluated. Since print alters the output of str by binding *print-readably* to false, and also forces the sequence to realize itself, the values in your sequence are now cached the the result of str without *print-readably*. In subs

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Didier
I'm not following 100%. But s/or of specs will comform to the first valid spec it encounters. It can be used for duck typing, aka, strutural types. So given you have many maps, each can be a spec. Then you can create a spec which is one of these shapes of maps. Pass any map to the or spec, and i

Re: Question about Clojure parallelization

2017-09-12 Thread Didier
If performance is the concern, you won't be able to beat Java with Clojure. That said, it should be possible to match Java's performance. On Tuesday, 12 September 2017 09:43:58 UTC-7, darren...@gmail.com wrote: > > Hi, > > I am a researcher of Natural Language Processing. > My team want to know

Re: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Didier
I like this one, lots of good stuff. Thanks to everyone who contributed. On Thursday, 7 September 2017 14:48:51 UTC-7, Alex Miller wrote: > > Clojure 1.9.0-alpha20 is now available. > > Try it via > > - Download: > https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20 > - Leiningen: [o

Re: Why is the start function called -main

2017-09-06 Thread Didier
Clojure is always launched from Java, there's no way to bootstrap straight into Clojure from the JVM. So when you launch the JVM, it always starts in a Java main method. What Clojure does normally, is that it creates the Java main method for you, and have it call your own main method. So it goe

Re: Writing an Android application with Clojure

2017-09-06 Thread Didier
de > for using React Native for mobile dev, and ClojureScript's story is very > good there. But personally I think you'd be nuts to choose JVM Clojure over > Kotlin for serious Android development. > > On 6 September 2017 at 07:04, Didier > > wrote: > >>

Re: Using memory with futures

2017-09-05 Thread Didier
Everything tbc++ said, But also, if you create futures at a faster rate then they terminate, you will eventually run out of memory, because futures are unbounded. If that's the case, you want to use ThreadPoolExecutor to create a bounded pool or a pool backed by a queue and then use it as expla

Re: Writing an Android application with Clojure

2017-09-05 Thread Didier
in the future, but Java is not a pain to use anymore. I like Kotlin, but its also dumb to have a whole new JVM language works the same conceptually, just because Java never bothered improving on its quirks and verbosity. On Tuesday, 5 September 2017 04:14:33 UTC-7, Cecil Westerhof wrote: >

Re: Writing an Android application with Clojure

2017-09-03 Thread Didier
Kotlin is actually officialy supported on Android, so definitly a good choice there. That said, if you know Java, C#, C++, Pascal, or even ActionScript 3, Kotlin brings nothing new to the table conceptually. It does improve on convenience over Java though. So I'd still recommend you also spent s

Re: Writing an Android application with Clojure

2017-09-02 Thread Didier
Well, in the last 2 years I think React Native has grown quite a bit. I think if you target Android only, and you need performance, like a game, going with Java/C is best, or just Unity. But ClojureScript with ReactNative is great for iOS + Android compatibility for more normal apps. I don't t

Re: SRSLY? (= (true? identity) (false? identity)) => true

2017-09-01 Thread Didier
What might confuse you, is why Clojure even have true? and false? functions? Its because conditional constructs like if, cond, when, test for truthy (aka logical true) and falsey (aka logical false), not true and false. Nil and False are falsey, and everything else is truthy. Most of the time t

Re: core.async got in a bad state?

2017-08-29 Thread Didier
> > No code called by a go block should ever call the blocking variants of > core.async functions (!!, alts!!, etc.). So I'd start at the code > redacted in those lines and go from there. > Seems like a good use case for a static code analyser. Maybe a contribution to https://github.com/jonas

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-29 Thread Didier
at. Stating "this is a file", "this is a web image". Is just book >> keeping that doesn't need to be done. Is a map a :image/web? Well check its >> members and see if they match the spec. If they match, then you have a >> :image/web. No need for sum types

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-25 Thread Didier
Thanks for everyone's great input. Currently, I see the big distinction being concise vs extension. Maybe for streaming variants would be better as the format would be smaller to transfer over a wire. And for small short lived programs, or things you know won't need extension, variants offer a

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-22 Thread Didier
I can see it be quick and concise for representing events, but that's also exactly the use case example for multi-spec: https://clojure.org/guides/spec#_multi_spec What happens if your event needs more data? Maybe draw needs 2 attributes, the card and the deck? Now you have implicit encoding, w

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-22 Thread Didier
Ya, I guess the article says that some DSL uses them, like hiccup, so maybe its only in the perspective of a DSL you'd need to parse, and not really for modeling business entities. Like this: (s/def ::temp (s/or :one string? :two int?)) Will conform to a variant: => (s/conf

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-22 Thread Didier
Right, I see things the way tbc++ does, but I'm wondering if I'm missing some key insights that make variants better. I similarly struggle with the difference between (s/or) and (s/multi-spec). If I were to implement the lispcast example today with spec I'd either use (s/or): (s/def ::image-ty

Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-22 Thread Didier
I'm reading on http://www.lispcast.com/reduce-complexity-with-variants and have seen Jeanine's talk on her encoding scheme for sum types, but for some reason, I'm not convinced of the benefit over a tagged record encoding. I see that the positional vector or hash-map suggested in the lispcast a

Re: [ANN] Insn: Functional JVM bytecode generation for Clojure.

2017-08-19 Thread Didier
This looks cool, would it be possible to use this to have a deep nested clojure map automatically create a Java nesting of pojos? Like each key becomes a field of an actual class? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Entity–component–system and Clojure

2017-08-15 Thread Didier
I recently stumbled upon the entity-component-system design pattern which is popular in game engine design: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80%93system, and really liked what I saw, thought it could be a good fit for Clojure. Basically, it has three concepts: 1) Compo

CHAMP an improvement on HAMT?

2017-08-14 Thread Didier
I think that paper is from 2015. Curious to hear what are people's thoughts as to why it didn't replace Clojure's HAMT. I wouldn't mind a free 3x performance boost and a reduced memory footprint. Is it just a matter of didn't have someone doing the work, or did it turn out that there was issues

Re: Why is Clojure slow? (fibonacci)

2017-08-13 Thread Didier
Keep in mind Clojure can be made as fast as Java, it is not by default. What it is by default is one of the fastest dynamic programming language. On Sunday, 13 August 2017 11:46:31 UTC-7, Daniel Gerlach wrote: > > Thx, > > that was it :) > > I used the boxed int version ^Integer as a type hint, s

Re: beginning to learn Clojure after imperative programming my whole life

2017-08-10 Thread Didier
It did for me. It's that Clojure forced me to learn about and practice new ways to model problems and solution. For example, I'm much better at recursion and dynamic programming now. Now algorithmic problems are always hard, so there's a limit to how much better I got because of Clojure, but for

Re: :gen-class method signature help

2017-08-07 Thread Didier
Arrays in Clojure are different to Lists, and its probably why when you pass arrays to the score fn, that things don't work 100%. If you can coerce those arrays to a java list it would probably work. You can do that in js, but if that doesn't work or seem easy, you could have your -score wrappe

<    1   2   3   4   >