Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Didier
| And to be completely clear, I'm not complaining about the design decision in Clojure. I'm just trying to really understand what the design is, what are the trade-offs and where the confusion might come from. conj is what is known as a leaky abstraction. Leaky abstractions aren't always bad,

Re: How define alias for .indexOf? (def somealias .indexOf) does not work.

2018-07-19 Thread Didier
The memfn docstring says it can be type hinted to avoid reflection. Any reason why it would still be slower then wrapping it in a type hinted function? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

RE: [ANN] Clojure 1.10.0-alpha5

2018-07-19 Thread Sean Corfield
Progress so far… with Alpha 6. I’ve encountered a number of (random) JVM SEGV fatal errors running our Boot build pipeline and if I don’t hit any of those, I hit an exception like this fairly reliably: https://gist.github.com/seancorfield/f29bdb948a2a533c14a07ff6ffd6548a (the missing class see

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Renzo Borgatti
> On 19 Jul 2018, at 21:17, Andy Fingerhut wrote: > > > If you wish for the Clojure core team to provide that style of documentation > for you, I expect your wish will not be fulfilled. It is not technically > difficult to replace all Clojure doc strings with more verbose variants. It > _

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Benoît Fleury
Sorry if if it was not clear. I was not asking for more documentation. I understand that the documentation of `conj` should not say anything about how the different implementations work since it is only about adding an element to a collection in constant time. And you can always have future impleme

Re: [ANN] Clojure 1.10.0-alpha5

2018-07-19 Thread Alex Miller
Gotcha. Let us know... > On Jul 19, 2018, at 3:08 PM, Sean Corfield wrote: > > Yes, which allowed us to actually _try_ to run our build pipeline – so the > problems we’re seeing are fallout from the big changes in Alpha 5… I just > haven’t nailed them down yet 😊 Everything works fine on Alpha

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Andy Fingerhut
On Thu, Jul 19, 2018 at 1:04 PM Benoît Fleury wrote: > Replying to myself ... :) > > 1. Am I wrong in thinking that most Clojure programmers use append/prepend > as mental models for the different implementations of conj? > > No. > > 2. Am I wrong in thinking that they shouldn't? > > Yes. > > Clo

RE: [ANN] Clojure 1.10.0-alpha5

2018-07-19 Thread Sean Corfield
Yes, which allowed us to actually _try_ to run our build pipeline – so the problems we’re seeing are fallout from the big changes in Alpha 5… I just haven’t nailed them down yet 😊 Everything works fine on Alpha 4. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Benoît Fleury
Replying to myself ... :) 1. Am I wrong in thinking that most Clojure programmers use append/prepend as mental models for the different implementations of conj? No. 2. Am I wrong in thinking that they shouldn't? Yes. Clojure developers need to know the behavior of conj for vectors and lists. T

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Alan Thompson
(Deleting/reposting due to an editing error) As someone mentioned, the functions `prepend` and `append` exist in the Tupelo library to prevent this kind of confusion: from the README:

Re: How define alias for .indexOf? (def somealias .indexOf) does not work.

2018-07-19 Thread Laurens Van Houtven
I expect you're asking generally and James already gave the correct answer for that, but index-of specifically is defined in clojure.string :) On Thu, Jul 19, 2018 at 12:45 PM, James Reeves wrote: > You'd need to wrap it in a function, like: > > (defn index-of [^String haystack ^String needle] >

Re: How define alias for .indexOf? (def somealias .indexOf) does not work.

2018-07-19 Thread James Reeves
You'd need to wrap it in a function, like: (defn index-of [^String haystack ^String needle] (.indexOf haystack needle)) On Thu, 19 Jul 2018 at 18:33, Christian Seberino wrote: > How define alias for .indexOf? > > (def somealias .indexOf) does not work. > > cs > > -- > You received this messa

Re: How define alias for .indexOf? (def somealias .indexOf) does not work.

2018-07-19 Thread Gary Trakhman
memfn will do this for you https://clojuredocs.org/clojure.core/memfn But it's usually the wrong thing. Wrt reflection-perf/warnings, you'd be better off with an anonymous function and typehint most of the time. On Thu, Jul 19, 2018 at 1:33 PM Christian Seberino wrote: > How define alias for

How define alias for .indexOf? (def somealias .indexOf) does not work.

2018-07-19 Thread Christian Seberino
How define alias for .indexOf? (def somealias .indexOf) does not work. cs -- 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 pati

Re: command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes
Now, I've found the source of the problem. I'd got an "old" alias named clojure in my .profile. Now all works fine. Johannes Am Donnerstag, 19. Juli 2018 16:28:04 UTC+2 schrieb Johannes: > > I suppose I have installed the command line tools on my Mac with > > brew install clojure > > as describe

Re: command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes
Am Donnerstag, 19. Juli 2018 16:41:24 UTC+2 schrieb Alex Miller: > > It might be good to check that `clojure` actually points to what you think > it points to. Check `which clj` and `which clojure` to make sure they are > coming out of the same directory. > I think they do: JohMBAir:~ johannes

Re: [JOB] Clojure(Script) jobs at Reify Health | U.S Remote or Boston

2018-07-19 Thread Ripu Gupta
Hi Gaberial, How are you? Did you find any clojure developer for your requirement? On Monday, April 9, 2018 at 11:17:25 PM UTC-4, cldwalker wrote: > > Hi, > Reify Health is building clinical trial software using Clojure and > ClojureScript. We are looking for experienced developers who are > k

[ANN] tools.deps.alpha 0.5.442, clj 1.9.0.391

2018-07-19 Thread Alex Miller
Just a few minor bug fixes. Now available: - tools.deps.alpha 0.5.442 - clj 1.9.0.391 - Mac: brew upgrade clojure - Linux: see https://clojure.org/guides/getting_started - Windows: working on it! Changelog: - Throw error if unknown aliases are used (TDEPS-85) -

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Joe R . Smith
Building off of something Benoit mentioned about conj not being about order, but about adding to a collection, consider conj’s behavior when adding a map-entry to a hash-map:  (conj (hash-map :a 4 :c 1) [:b 3]) => {:c 1, :b 3, :a 4} conj is an interface for adding– not to be conflated with orde

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Christian Seberino
On Thursday, July 19, 2018 at 10:04:39 AM UTC-5, Benoît Fleury wrote: > > I agree with Alex. It is important to understand the rationale behind the > behavior of conj. conj is for adding an element to a collection. It doesn't > say anything about ordering. It has been chosen as an operation, as >

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Christian Seberino
Thanks. I caught that yesterday. Like I said, I'm definitely a beginner. ;) On Thursday, July 19, 2018 at 2:05:20 AM UTC-5, Vladimir Bokov wrote: > > First of all, def in a fn body is antipattern (use let), then do into on a > itself > > (defn concat_ [a b] > (if (vector? a) > (into a b)

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Christian Seberino
> > - 'you always get back a value of the concrete type you supplied for > argument X' isn't obviously less cognitively burdensome than 'you always > get back a sequence' > Combining objects of type X should give a result that is of type X. That seems the most natural to me. > - doesn't

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Benoît Fleury
I agree with Alex. It is important to understand the rationale behind the behavior of conj. conj is for adding an element to a collection. It doesn't say anything about ordering. It has been chosen as an operation, as opposed to append/prepend, because it can be implemented with the same time compl

Re: command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Alex Miller
It might be good to check that `clojure` actually points to what you think it points to. Check `which clj` and `which clojure` to make sure they are coming out of the same directory. On Thursday, July 19, 2018 at 9:28:04 AM UTC-5, Johannes wrote: > > I suppose I have installed the command line t

command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes
I suppose I have installed the command line tools on my Mac with brew install clojure as described in the Getting Started Guide. If I try clj I get Clojure 1.9.0 user=> fine! If I try clojure I get Fehler: Hauptklasse clojure.main konnte nicht gefunden oder geladen werden Ursache: java.lan

Re: Change platform for reader conditionals

2018-07-19 Thread Alex Miller
With read-string in Clojure, the :clj platform feature is always active but it is possible to add additional features like :cljs: (read-string {:read-cond :allow, :features #{:cljs}} "#?(:clj 1 :cljs 2)") In this case, both :clj and :cljs features will be active, so it will return 1 because the

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Didier
Hey Alan, Nice job on Tupelo by the way. I do find it a bit bloated though, and that's why I never use it. Any reason why all the different namespace are still mixed together? Seem like they could each be an independent lib, like how the datomic namespace was split out. On Wednesday, 18 July 2

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Vladimir Bokov
First of all, def in a fn body is antipattern (use let), then do into on a itself (defn concat_ [a b] (if (vector? a) (into a b) (concat a b))) четверг, 19 июля 2018 г., 4:07:46 UTC+7 пользователь Christian Seberino написал: > > I'm just a Clojure beginner but it seems that the Lisp W