Re: Unnecessary boxing of return from set!

2022-05-15 Thread Erik Assum
This reminds me of a bug that I believe Ghadi fixed for 1.11, https://clojure.atlassian.net/browse/CLJ-2621 Don’t know if that helps much, though. Erik. -- i farta > 15. mai 2022 kl. 14:11 skrev pete windle : > > Hey, I'm trying to work on some performance sensitive code using Clojure >

Re: Adding value to the map in sql statement dynamically

2020-12-20 Thread Erik Assum
Hi Ganesh, Please don’t do it this way, as you’re opening yourself to sql-injection. When doing parameterized queries in sql, please reach for prepared statements. As others have mentioned, next.jdbc with a sprinkle of honeysql on top should be exact what you’re looking for. Erik. -- i

Re: Hello, I'm a new Clojurian (I think)!

2020-12-17 Thread Erik Assum
Hi Tuan, and welcome! A lot of us hang out in the Clojurians slack channel, which you can sign up for at https://clojurians.slack.com/join/shared_invite/zt-fvf7u6mr-HtHPDF6G3vIV8WfkEXfBaw#/ https://clojureverse.org is another place to meet other Clojurians. Enjoy! Erik. -- i farta > 17.

Re: First post: how to mimic a Java List with types?

2020-08-15 Thread Erik Assum
Why not tease things apart? (defn eval [x] ...) (some eval my-list) ;; or list (every? eval my-list) ;; and list https://clojuredocs.org/clojure.core/some https://clojuredocs.org/clojure.core/every_q Now, you can make the eval function polymorphic in several ways, simplest is to case or cond

Re: [ANN] Deploy tokens for Clojars

2020-05-17 Thread Erik Assum
D’oh, please disregard. After reading the docs, I see that no changes would be needed, apart from updating the docs. Mea culpa, sorry for the noise. Erik. > On 18 May 2020, at 07:38, Erik Assum wrote: > > I think I agree with Sean that the time frame is a bit short. One thing is

Re: [ANN] Deploy tokens for Clojars

2020-05-17 Thread Erik Assum
I think I agree with Sean that the time frame is a bit short. One thing is making deps-deploy (and also pomegranate) work with tokens (which I’m confident I can handle). Another thing is that I would imagine both leiningen and boot would need new releases and people would need to adopt those

The magic of Lisps

2019-04-28 Thread Erik Assum
First of all, this might very well be a ramble without much sense, but please bear with me. Secondly, I’m writing this first and foremost not as an application programmer. Having programmed in the crud-application business some twenty years professionally, the last couple of them in Clojure,

Re: Using map to produce side effects, not working

2019-02-07 Thread Erik Assum
Just as a note, you should probably use `doseq` when you want to produce side effects. Erik. > On 7 Feb 2019, at 12:04, Pierpaolo Tofani wrote: > > Hi > i am new in clojure sorry. > In the snippet of code i used two map functions only to produce side effects > on two ref. > Even using

Re: [ANN] Clojure 1.10 has been released!

2018-12-17 Thread Erik Assum
eatures in Clojure 1.10. > > > > Thanks to all of the community members who contributed patches to Clojure > 1.10 (first time contributors in bold): > > Alexander Kiel > Ben Bader > Bruce Adams > Cezary Kosko > Erik Assum > Eugene Kostenko > Ghadi Shayban

Re: [ANN] clj-commons - an org

2018-11-11 Thread Erik Assum
ests, etc etc. > > 11 Νοε 2018, 12:25 μμ, ο χρήστης «Erik Assum » έγραψε: > >> Hi all, >> >> Letting the cat out of the sac. >> >> I’ve created a GitHub organisation, https://github.com/clj-commons. >> With a name like that, one could imagine

[ANN] clj-commons - an org

2018-11-11 Thread Erik Assum
Hi all, Letting the cat out of the sac. I’ve created a GitHub organisation, https://github.com/clj-commons . With a name like that, one could imagine many raisons d’être, but for now, the main reason is to give a home to useful Clojure libs/projects which for

Re: What's the end goal for tools.deps?

2018-11-04 Thread Erik Assum
Sounds like you’re in dire need of an internal installation of artifactory. Most build tools let you specify custom repositories, and you could then choose to _only_ use artifactory, both as a repo for the public packages you choose to use, and for your private packages. The you can use

[ANN] deps-deploy - a thin wrapper around com.cemerick/pomegranate for deps.edn

2018-11-04 Thread Erik Assum
deps-deploy is a small tool to be used with `clj` or `clojure` to deploy your things to Clojars https://github.com/slipset/deps-deploy/blob/master/README.md Main value proposition is that you can deploy to Clojars without having

Re: [ANN] deps-ancient - are your deps outdated?

2018-11-01 Thread Erik Assum
you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > From: clojure@googlegroups.com on behalf of Erik > Assum > Sent: Thursday, November 1, 2018 4:07:01 AM > To: clojure@googlegroups.com > Subject: [ANN] deps-ancient - are your deps out

[ANN] deps-ancient - are your deps outdated?

2018-11-01 Thread Erik Assum
I’m happy to announce deps-ancient https://github.com/slipset/deps-ancient . It will report if your deps.edn file contains outdated deps. Usage: Merge ``` {:ancient {:main-opts ["-m" "deps-ancient.deps-ancient"] :extra-deps {deps-ancient

Re: Mail queue thread

2018-10-26 Thread Erik Assum
Expert answer is always “it depends”. And long winded answer: I’d first write a function that can send one “email”: (defn send-email! [ctx email-data] …) ; context contains whatever outside resources you need Now you have the freedom to work on a list of email-data like this: (doseq [email

Re: Mail queue thread

2018-10-25 Thread Erik Assum
Not knowing your app nor your requirements, but it might also be an idea to separate concerns: Your web-app could store “emails to be sent” in a database table, and you could have a different process reading this table at regular intervals and sending mails, and also marking the emails as

[ANN] speculative - the missing specs

2018-10-20 Thread Erik Assum
Hi, Still early days, but I’d like to announce speculative, https://github.com/slipset/speculative >From the README: speculative is a collection of specs for the functions in clojure.core. While its ultimate goal is to be rendered obsolete by these or similar specs being added to

Re: [ANN] Clojure 1.10.0-RC1 (please test!)

2018-10-12 Thread Erik Assum
https://github.com/clojure-emacs/cider-nrepl/issues/549 Erik. > On 12 Oct 2018, at 16:54, Alex Miller wrote: > > Before you would have gotten the spec ExceptionInfo. Now you should get a > CompilerException wrapping that ExceptionInfo. It looks like the error is in > parsing the location out

Re: [ANN] Clojure 1.10.0-RC1 (please test!)

2018-10-12 Thread Erik Assum
16:13, Erik Assum wrote: > > I’ve ran our app and it seems to work. Tests are also passing. > > Looking forward to 1.10. > > Thanks! > > Erik. > >> On 11 Oct 2018, at 17:11, Alex Miller > <mailto:a...@puredanger.com>> wrote: >> >

Re: [ANN] Clojure 1.10.0-RC1 (please test!)

2018-10-12 Thread Erik Assum
I’ve ran our app and it seems to work. Tests are also passing. Looking forward to 1.10. Thanks! Erik. > On 11 Oct 2018, at 17:11, Alex Miller wrote: > > 1.10.0-RC1 is now available. You can try it with clj using: > > clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version

Re: SOAP server

2018-10-05 Thread Erik Assum
Last time I worked with SOAP, I used plain old java interop which suited me quite nicely. Here is a repo which shows how that worked: https://github.com/slipset/soap-box/ HTH, Erik. > On 5 Oct 2018, at 20:43, Renata Soares wrote: > > Hello! > > I need suggestions of libraries (or others

Re: [ANN] Clojure 1.10.0-alpha7

2018-09-06 Thread Erik Assum
Would it be an idea to include something like ``` clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-alpha7"’ ``` in such announcements so the lazy of us could just copy/paste it into our shells to try it out? Erik. > On 5 Sep 2018, at 14:39, Stuart Halloway wrote: > >

Re: New developments in beginner-friendly editing/repl environments?

2018-08-27 Thread Erik Assum
Have you had a look at Nightcode? https://sekao.net/nightcode/ Erik. -- i farta > 27. aug. 2018 kl. 22:00 skrev Nando Breiter : > > Lee, > > Perhaps https://atom.io/packages/atom-beautify will do what you want. > > With Parinfer disabled, I can select and shift-tab all code to the left >

Re: How to escape a space in a keyword?

2018-08-09 Thread Erik Assum
I was wondering about the rationale for the unreadable keywords a while a ago. Weavejester pointed me to https://clojure.org/guides/faq#unreadable_keywords and https://dev.clojure.org/jira/browse/CLJ-2309 Erik. -- i farta > 9. aug. 2018 kl. 06:48 skrev Didier : > > Thanks Andy, ya I

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-17 Thread Erik Assum
One data point, me: When I started out with Clojure, I was very worried about conj, not quite knowing wether it would add at the beginning or the end of the data structure. But, having worked with Clojure (in web dev) now for a couple of years, I find myself using conj quite sparingly. And I

Re: Bazel as Clojure build tool

2018-06-11 Thread Erik Assum
Totally off topic, but I once worked on a Java project where some of the tests were written in groovy and they were a huge PITA: 1) The refactoring tools never found, nor refactored the groovy code 2) The compilation errors introduced by 1) never showed up in my IDE 3) Having to relate to tests

Re: Protocols considered harmful?

2018-05-22 Thread Erik Assum
As Mark Engelberg writes, if you work in a team, you need to figure this out with the team. One point to add to the discussion is that if you find yourself implementing “several” multi methods per type, it might be worth creating a protocol, just to make it easier for the consumer to understand

Re: Looking for people interested in developing Eastwood lint tool

2018-04-27 Thread Erik Assum
Hi Andy, At ardoq, where I now work, and at Telenor Digital, where I previously worked, we had Eastwood running on all our Clojure projects, and it’s definitively one of the more under-appreciated tools in my tool box. It doesn’t make much of itself, but when it speaks, I listen. I'd be more

Re: Calling functions from within maps

2018-03-18 Thread Erik Assum
You’re missing a paren before my-rows. Not knowing that you do, but writing Clojure without paredit/park fee is a lot harder than without :) Erik. -- i farta > 18. mar. 2018 kl. 07:25 skrev Hector Lucero : > > Why does this work: > (map #(assoc % :sites

Re: Comparing and selecting web API libraries

2018-03-08 Thread Erik Assum
speed and maturity which would probably guide me to using compojure-api, the probably safe and boring bet. Erik. -- i farta > 8. mar. 2018 kl. 17:40 skrev jmckitr...@gmail.com: > > So it sounds like your choice would be compojure-api, correct? > >> On Thu, Mar 8, 2018 at 1

Re: Comparing and selecting web API libraries

2018-03-08 Thread Erik Assum
Hi, On my current project, we’re using compojure with liberator. It works, but there are a few down sides as far as I can see: Compojure is opaque, eg the routing is expressed using functions/macros, where as other routing libs like bidi and reitit (https://github.com/metosin/reitit

Re: Developing in Clojure with Emacs: Mastering the Keyboard

2018-03-04 Thread Erik Assum
There was a thread in this on clojureverse.org: https://clojureverse.org/t/share-the-nitty-gritty-details-of-your-clojure-workflow/1208 Erik. -- i farta > 4. mar. 2018 kl. 15:47 skrev Chris Shellenbarger > : > > What I feel is missing from a lot of the Clojure

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

2018-02-20 Thread Erik Assum
Out of curiosity, are you at liberty to discuss how Cognitect solves the problem of validating/coercing values at the edges of the application when you (Cognitect) are doing consulting? Erik. -- i farta > 20. feb. 2018 kl. 18:05 skrev Alex Miller : > > I do see the

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

2018-02-20 Thread Erik Assum
FWIW, I’ve been using https://github.com/metosin/spec-tools on a couple of projects lately, which helps nicely with conformance and coercion. The main devs are very helpful on #ring-swagger on the Clojurians slack. Alex, how does spec-tools measure up to your thoughts on conformance/coercion?

Re: try catch leaking exception

2018-02-14 Thread Erik Assum
There is also https://github.com/magnars/realize/blob/master/README.md which helps with this problem. Erik. -- i farta > 14. feb. 2018 kl. 12:20 skrev Thomas Heller : > > lazy-seq is the short answer. > > You are constructing the seq inside the try/catch but it is

Re: 1.8 vs 1.9 performance

2017-12-24 Thread Erik Assum
I’ve upgraded several apps to 1.9 in production. The transition has been super smooth, although some libs, amongst them core.async, have needed upgrades. I have not seen any performance degradation, but then I haven’t been checking for that. Erik. -- i farta > 24. des. 2017 kl. 15:58

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

2017-10-25 Thread Erik Assum
Eric Normand did some research on this some time ago: http://www.lispcast.com/100-most-used-clojure-expressions Erik. -- i farta > 25. okt. 2017 kl. 23:05 skrev Colin Fleming : > > IntelliJ has a nice Productivity Guide feature which works sort of like this > -

Re: Clojure for big data

2017-10-19 Thread Erik Assum
FWIW, I filed an issue and submitted a PR against flambo this summer. It was merged on the same day and released two weeks later, so flambo seems active when needed. Erik. > On 18 Oct 2017, at 13:02, Ray Miller wrote: > > This is partly prompted by the lack of activity on

Clojure core documentation

2017-09-08 Thread Erik Assum
Hi, I apologise if this is not the appropriate forum, but please bear with me. Having watched Bozhidars Clojutre presentation, https://www.youtube.com/watch?v=nrpsMB2gYI0=2=PLetHPRQvX4a9iZk-buMQfdxZm72UnP3C9 ,

Re: Priority Map with efficient search on values?

2017-04-08 Thread Erik Assum
This is way out of my league, but have you had a look at Michals priority search queues? https://github.com/michalmarczyk/psq.clj He had a presentation about them at Euroclojure in 2016 Priority Search Queues: 1.5 dimensional Tree Search - Michał

Re: Can you extend a Java class, and add new fields and constructors to it?

2017-03-23 Thread Erik Assum
Not sure that this is exactly what you're asking for, but it might still give you a starting point: https://github.com/wjoel/clj-bean Erik. -- i farta > Den 23. mar. 2017 kl. 07.12 skrev Didier : > > Hi, > > I'm trying to see if you can extend a Java class in Clojure, in

Re: How to transform deeply nested map into a series of arrays?

2017-03-08 Thread Erik Assum
You've already gotten your answer, but since Alex mentioned postwalk, and the problem looks like a flattening problem, I thought the following post might be of interest: https://mwfogleman.github.io/posts/20-12-2014-flatcat.html Erik. -- i farta > Den 8. mar. 2017 kl. 18.38 skrev

Re: Contribute Specter to Clojure core?

2017-03-04 Thread Erik Assum
My thoughts on this were spurred by this tweet from Nikita Prokopov https://twitter.com/nikitonsky/status/837049980053516310 I generally don't have the need to alter stuff deep down in data structures, but when I do, I don't mind writing the functions to do so. The two things that worries me

Release date for 1.9

2017-02-28 Thread Erik Assum
Hi, I know release dates are not normally announced for Clojure versions, and I respect and sympathize with that. That being said, my team use Clojure in our daily work, and are eager to start using some sort of schema to describe our data. In the defn podcast with Alex Miller, I think "at

Re: Clojure community survey 2016 results

2017-02-07 Thread Erik Assum
Thanks! You say 2,420 people took the survey this year. How does that compare to previous years? Erik. -- i farta > Den 7. feb. 2017 kl. 19.05 skrev Alex Miller : > > Results and analysis are available here: > >

Re: Clojure.spec, maps, restrict valid keywords, easier way?

2017-02-07 Thread Erik Assum
Bruce Hauman has done some work in this area both in figwheel and in a branch of leiningen. Basically, if I understand correctly, he looks for misspelled keywords in configuration maps by taking the levenstein distance between expected, valid, keywords and non-matching keywords in the

Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-15 Thread Erik Assum
Hi Zach, I just stumbled upon your blog post about this at https://sekao.net/blog/nightcoders.html, by the way of Shaun LeBron retweeting Josh Burkes tweet which cited "We should try to be the next Geocities, not the next Intellij". Last night, I spent some time coding with my son over on

Re: [ANN] Nightcoders.net, a cloud IDE for ClojureScript

2017-01-04 Thread Erik Assum
It seems like I need to double-click on the buttons (like “Web App” and “Game”) to make them do something. MacOS 10.12.3/Safari 10.0.3 Seems to be a safari issue, since it behaves as it should in Chrome. Erik. > On 4 Jan 2017, at 17:20, Zach Oakes wrote: > > Cloud IDEs

Re: Order preservation and duplicate removal policy in `distinct`

2016-12-29 Thread Erik Assum
Wouldn't the order be different depending on wether you keep the first or the last? (distinct [1 2 1]) => [1 2] vs (distinct [1 2 1]) => [2 1] Erik. -- i farta > Den 29. des. 2016 kl. 22.32 skrev Sean Corfield : > > Can you provide a scenario when it matters? Given that

Re: multimethods, uberjar, and several namespaces

2016-11-23 Thread Erik Assum
ber 23, 2016 at 11:53:55 AM UTC-8, Erik Assum wrote: >> So, I guess my question then would be, how do I make it load without >> creating a circular dependency? >> >> Erik. >> -- >> i farta >> >>> Den 23. nov. 2016 kl. 20.50 skrev Jonath

Re: multimethods, uberjar, and several namespaces

2016-11-23 Thread Erik Assum
d > never gets loaded. > >> On Wednesday, November 23, 2016 at 11:31:21 AM UTC-8, Erik Assum wrote: >> Hi, >> >> I’ve got a defmulti defined in a namespace and it’s corresponding defmethods >> defined in other namespaces. >> This works fi

multimethods, uberjar, and several namespaces

2016-11-23 Thread Erik Assum
Hi, I’ve got a defmulti defined in a namespace and it’s corresponding defmethods defined in other namespaces. This works fine when working in the repl, but when creating an uberjar, the defmethods in the other namespaces don’t seem to be found. I’ve created a minimal case here:

Re: [ANN] Advanced Martian usage

2016-11-10 Thread Erik Assum
Hi Oliy, In some ways this resonates with a thought I’ve had for a while, which sort of appeared while working on a spring-boot application in java. So in Spring-boot, you have classes annotated as controllers, methods annotated as request handlers which indicate what params and such they

Re: Clojure Web Applications for Beginner

2016-11-02 Thread Erik Assum
This talk is a bit old, but still... https://vimeo.com/78909065 Erik. -- i farta > Den 2. nov. 2016 kl. 19.44 skrev 'Rickesh Bedia' via Clojure > : > > Hi, > > I am fairly new to Clojure, only been learning about it for a around 2 > months. I have mainly been

Re: Java like static typing for Clojure?

2016-10-23 Thread Erik Assum
Colin, I think the points you bring up here are very interesting, and reflect ideas that I have not yet been able to formulate. I certainly would think there is enough "stuff" in here for a talk, and also some ideas into how to grnerative test "bread and butter" code, as can I, and if so,

Re: Java interop: dealing with Java implementation instances vs interfaces

2016-10-16 Thread Erik Assum
I think the method you're looking for is sendAsync. As for binding yourself to the implementation, you should stick to whatever interface getProducer says it returns, and you'll be ok. Erik. -- i farta > Den 16. okt. 2016 kl. 08.42 skrev hiskennyness : > > Not sure if

Re: get function

2016-09-13 Thread Erik Assum
From https://clojuredocs.org/clojure.core/get you’ll see that `get` accepts an additional argument, the default value, which e.g. the keyword does not. As for getting stuff out of maps, the idiomatic way is (def m {:a 1 :b 2}) (:b m) ;; => 2 There is otherwise a nice discussion about the

Re: Read the code of clj_http ,then I have one questions,#' that mean ?

2016-09-12 Thread Erik Assum
In addition, https://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/ is a good read. Erik. -- i farta > Den 13. sep. 2016 kl. 06.59 skrev Tienson Qin : > > It means var quote, I think you can find more in clojure.org reader literals. >

Re: Generate a million file from a template

2016-08-20 Thread Erik Assum
I think you should move the future inside do times, since then you’ll get a future for each write. Also, I don’t think you need to put your json-template in an atom: (ns jsonworker.foo (:require [cheshire.core :refer :all ])) (defn parse-json [file-loc] (parse-stream

grouping and mapping

2016-08-12 Thread Erik Assum
I’ve been working on a new project in java 8 at a new client where I’ve been able to play with streams. In doing so I’ve come across Collectors.groupingBy which has some additional features that group-by doesn’t seem to have. Example: Given (def foos [[:a "foo"] [:b "bar"] [:a "baz"]])

Re: Running a certain function of your project

2016-07-15 Thread Erik Assum
It's coming to Linux as well. Erik. -- i farta > Den 15. jul. 2016 kl. 10.41 skrev Cecil Westerhof : > > I myself are on Linux, but maybe interesting for someone else. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: Running a certain function of your project

2016-07-15 Thread Erik Assum
If you're on OSX and not opposed to Clojurescript, Planck[1] starts up in no time and is very useful for scripting and playing around. There is also replete if you have an iOS device. 1 http://planck-repl.org/ Erik. -- i farta > Den 14. jul. 2016 kl. 23.15 skrev Cecil Westerhof

Re: Picking a code path if a type is known at compile time (e.g. through hint)

2016-07-01 Thread Erik Assum
A multimethod which dispatches on type, or maybe extend the counted(?) protocol to these two types? Erik. -- i farta > Den 1. jul. 2016 kl. 17.12 skrev lvh <_...@lvh.io>: > > Hi, > > > I have some code that wants to know the appropriate length of a byte buffer. > These can be byte arrays

Re: Why we cannot do this now?

2016-06-22 Thread Erik Assum
Using Cider and clj-refactor, you can do M-x cljr-add-project-dependency to add (or update) a dependency. Erik. -- i farta > Den 22. jun. 2016 kl. 23.50 skrev Ritchie Cai : > > Just curious, how do you add new dependencies to a running REPL? Do you just > restart

spec.gen for uri?

2016-06-14 Thread Erik Assum
Just saw a tweet from Stuart Halloway pointing to the function which generates ramsom uri's, https://github.com/clojure/clojure/commit/1109dd4eafd95c169add38dd0051be413d9e49d0 I would argue that this function does not generate random-enough values: 1) you only generate urls using the

Re: Avoiding nested ifs...

2016-05-26 Thread Erik Assum
Not being good at reading other peoples mind, I’ll give my guess as to what Timothy was trying to suggest: If you define your input as a map with keys such as: {:type :switched ; can be :switched :dual or :something :pos 54} You can make something like: (defmulti verify-pos-for :type)

Re: Why is there no core/system-time in Clojure if it is in ClojureScript?

2016-05-19 Thread Erik Assum
If it already exists in cljs, wouldn't a relatively obvious answer be "whatever the cljs implementation returns", if what we want is to avoid reader conditionals? Erik. -- i farta > Den 19. mai 2016 kl. 22.14 skrev Alex Miller : > > I think the biggest question mark is

Re: Tiny fix for LispReader

2016-04-26 Thread Erik Assum
In addition to what Andy said, this same behavior was recently implemented in tools.reader (the Clojure impel of lisp reader) http://dev.clojure.org/jira/browse/TRDR-36 Erik. -- i farta > Den 27. apr. 2016 kl. 07.13 skrev Andy Fingerhut : > > Frank: > > I am

Re: Pmap on hash maps

2016-04-17 Thread Erik Assum
There was this talk on this a while ago by Leon Barrett https://m.youtube.com/watch?v=BzKjIk0vgzE Also, I guess this from this years Clojure West might be useful, all though I haven't watched it yet: https://m.youtube.com/watch?list=PLZdCLR02grLq4e8-1P2JNHBKUOLFTX3kb=fA9ZXy4N13s Erik. -- i

Re: Functions referenced in macro-expansions cannot be internal?

2016-04-01 Thread Erik Assum
On condp, case etc. Alex Miller wrote a blog post on their performance a while ago: http://insideclojure.org/2015/04/27/poly-perf/ Erik. -- i farta > Den 1. apr. 2016 kl. 13.03 skrev Kenneth Tilton <k...@tiltontec.com>: > > > >> On Fri, Apr 1, 2016 at 2:41 AM, Er

Re: Functions referenced in macro-expansions cannot be internal?

2016-04-01 Thread Erik Assum
Not at all answering your question, but I would strongly suggest to at least deref `me` before calling the function, so it’s definition would be more like: (defn svr [me slot] (when-let [sval (slot me)] (if (jz-ref sval) (condp type @sval) :jzi (:val @sval)

Re: clojure.math.combinatorics/combinations throws exception on n=1

2016-03-24 Thread Erik Assum
Interesting that set doesn't implement distinct. It should be a pretty straight forward implementation. Erik. -- i farta > Den 24. mar. 2016 kl. 00.53 skrev Mark Engelberg : > > The input should be a sequence not a set, so call seq on the input before > passing it

Re: [ANN] Elements of Clojure

2016-03-20 Thread Erik Assum
Having just finished the first chapter, I must congratulate you with the best software writing I have read in a long while, maybe ever. I really enjoy how you discuss naming and only use Clojure as a vehicle to illustrate your points. The ideas you put forward should be applicable to any

Re: [ANN] Inlein 0.1.0

2016-03-14 Thread Erik Assum
With regard to Planck, I don't think Inlein will be useful, since you'd have to wait for the jvm startup. What Planck, in my opinion, is missing is a story on dependency management without the jvm. Unfortunately, leiningen and Inlein both use Java libs to resolve deps, which means you need

Re: Jolin / ragtime seeding a postgres database

2016-03-14 Thread Erik Assum
Just doing some of the same, but I have a table def like CREATE TABLE ghost_channel (id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), name text Which seems to generate keys for me. Maybe you could do something like that with your sequence as well? Erik. > On 14. mar. 2016, at 10.53, 'Sven

Re: [ClojureScript] [ANN] modern-cljs - 17th tutorial - REPLing with Enlive

2015-12-25 Thread Erik Assum
When it's just a matter of correcting typos, I tend to fork the project, do the edit directly in the github gui, commit, and add a pull request, which would correspond to steps 1,5,6,8 below. Erik. -- i farta > Den 25. des. 2015 kl. 08.36 skrev Mimmo Cosenza : > >

Re: channels 1:1, callbacks many:many ?

2015-11-24 Thread Erik Assum
What I normally do is to have one channel onto which you put the event, and one function which takes the event off the channel. This latter function will then call whatever other functions which need to know that the event occurred. Erik. -- i farta > Den 25. nov. 2015 kl. 07.42 skrev

Re: Style, Efficiency, and updating nested structure

2015-11-12 Thread Erik Assum
I would like to argue that your code has to be pretty inefficient if it's creating a bigger performance impact than fetching from the database. Erik. -- i farta > Den 12. nov. 2015 kl. 15.36 skrev Dave Tenny : > > Thanks for the replies, as always lots of interesting

Re: Help with idiomatic clojure.

2015-11-12 Thread Erik Assum
There is also https://github.com/logaan/vlad which helps with validation. Erik. -- i farta > Den 12. nov. 2015 kl. 17.12 skrev Colin Yates : > > A nicer equivalent form would be: > > (cond-> [] > this-error? (conj “It failed with this error”) > that-error? (conj

Re: Help with decisions in threading macros

2015-11-03 Thread Erik Assum
some->> Erik. -- i farta > Den 3. nov. 2015 kl. 17.05 skrev Timur : > > Hi all, > > Often I need to make decisions in simple threading macros, for instance > consider the following code > > (->> m >:vector >(filterv #(= (:id %) (:id m))) >

Re: palingdrome problem (4 clojure)

2015-10-07 Thread Erik Assum
I do believe that a palindrome could be defined as user> (defn palindrome [s] (= s (clojure.string/reverse s))) ;; => #'user/palindrome user> (palindrome "agnesisenga") ;; => true user> No need to split in half. > On 7. okt. 2015, at 20.24, Tristan Strange wrote: >

Re: Library suggestions requested for clojure-toolbox.com

2015-10-07 Thread Erik Assum
chat/xmpp https://github.com/slipset/xmpp-clj Erik. > On 5. okt. 2015, at 21.40, James Reeves wrote: > > If you've written or know about a Clojure or ClojureScript library, and it's > not already on clojure-toolbox.com, I'd like to hear about it. > > Post the name and

Re: cider-nrepl not installed (emacs24)

2015-09-20 Thread Erik Assum
I had to bytecompile nrepl.el (?) in the elpa directory. Reinstalling cider did not help. Setting nrepl-log-messages to nil removes the symptoms, but doesn't solve the problem, but it is a nice workaround. Am away from my computers, so the names of things are taken from memory, and can

Re: Function syntax

2015-08-13 Thread Erik Assum
(comp last sort) Erik. -- i farta Den 13. aug. 2015 kl. 10.08 skrev Eric Le Goff eleg...@gmail.com: I would be curious to know if there are difference (in terms of performance / elegance ) between those 2 ways of expressing functions E.g (fn [ x] (- x sort last)) versus

Re: Decomplecting Clojure

2015-08-12 Thread Erik Assum
Cool! It would be nice mentioning Clojurescript as well, especially with the recent development in http://github.com/mfikes/planck, which delivers a super fast Clojurescript for commands. Erik. On 12. aug. 2015, at 20.52, Sebastian Bensusan sbe...@gmail.com wrote: Hi everybody! I've

Re: reducers question

2015-07-15 Thread Erik Assum
You might want to check out this talk by Leon Barrett at Clojure/West 2015 https://www.youtube.com/watch?v=BzKjIk0vgzEindex=2list=PLZdCLR02grLrKAOj8FJ1GGmNM5l7Okz0a Erik. On 15. jul. 2015, at 05.02, Daniel Higginbotham nonrecurs...@gmail.com wrote: I’ve been trying to better understand

Re: Advice on introducing a Java dev to Clojure

2015-07-09 Thread Erik Assum
If you're a one-person team, don't be too worried. Your Clojure code will likely not be too big, so it will be fairly easy to understand and possibly rewrite to Java, if the truck thing was to happen. Erik. -- i farta Den 10. jul. 2015 kl. 07.25 skrev Johanna Belanger

Re: Help with data structure transformation

2015-06-06 Thread Erik Assum
(for [[x y z] {:a aa :b bb :c cc}] [x y z]) ([:c cc nil] [:b bb nil] [:a aa nil]);; WTF? So her, I guess, your taking each entry in the map and destructuring them into the three vars x, y, and z. Since each map entry is a pair, the third var z will be nil. Erik. -- i farta Den 6.