Re: How to: reduce boolean operations?

2013-05-24 Thread Alan Thompson
Usage: (every? pred coll) (see http://clojuredocs.org/clojure_core/clojure.core/every_q ) Function *every?* expects a predicate and a collection. Converting the map {:a 1} into a collection returns a sequence of 2-element vectors: user=> (seq {:a 1}) ([:a 1]) Calling the function :a on a vec

Git vs Perforce Comparison

2013-05-24 Thread Alan Thompson
ution to a more modern approach. The result is posted at the link below in case you find it useful in making a similar argument. Enjoy! http://cooljure.blogspot.com/2013/05/hello-all-this-is-my-very-first-post-on.html Alan Thompson -- -- You received this message because you are subscribed t

Re: ANN - adi 0.1.5 (user friendly syntax for datomic)

2013-05-29 Thread Alan Thompson
Wow - that is pretty cool! Alan On Tue, May 28, 2013 at 11:41 PM, zcaudate wrote: > > > 6. Insertion of `arbitrarily` formatted data: > a - books containing users: > > (adi/insert! ds [{:book {:name "Charlie and the Chocolate Factory" > :author "Roald Dahl" >

Re: GSOC Algebraic Expressions

2013-05-29 Thread Alan Thompson
this reduce some of the duplication in your rules example? Good luck! Alan Thompson On Wed, May 29, 2013 at 8:29 AM, David Nolen wrote: > A very cool of use of core.logic, look forward to seeing where it goes :) > > > On Wed, May 29, 2013 at 11:10 AM, Maik Schünemann < > maikschuenem...@g

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Alan Thompson
I am new to re-seq, but this is progress: (re-seq #"(?i)target.*" testcase) ("Target Line" "target line") On Wed, May 29, 2013 at 9:18 AM, Peter Mancini wrote: > (def testcase "Line 1\nLine 2\nTarget Line\nLine 4\nNot a target line") > (println testcase) > (re-seq #"(?i)^target" testcase) > (

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Alan Thompson
normally find it easiest to process input like this one line at a time. You must then the ".*" to the search pattern to match the remainder of the line if you want that returned (try leaving it off to see the difference). Alan On Wed, May 29, 2013 at 9:28 AM, Alan Thompson wrote: >

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Alan Thompson
really want to process a sequence of strings (broken up by line) and just filter out the ones you want to keep. So, re-find seems like the right tool here. Alan On Wed, May 29, 2013 at 9:42 AM, Alan Thompson wrote: > Here it is: > > (def lines (clojure.string/split "Line 1\n

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Alan Thompson
OK, here it is: http://docs.oracle.com/javase/7/docs/api/index.html?java/util/regex/Pattern.html Look under "Special Constructs", the 3rd entry. Still pretty terse! Alan On Wed, May 29, 2013 at 9:45 AM, Neale Swinnerton wrote: > You need to pass the multiline 'm' flag to the regex. some varia

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Alan Thompson
composing two simple functions (re-find ... (re-split ...)) will be much easier for readers of the code to understand than the complicated do-it-all-in-one-regex method. Also, this is what people are used to from unix grep, which operates on each line of a file separately. Alan On Wed, May 29, 2

Re: GSOC Algebraic Expressions

2013-05-29 Thread Alan Thompson
> but I plan to have generic rules classes of operations. > > Thanks for your feedback > > > On Wed, May 29, 2013 at 6:21 PM, Alan Thompson wrote: > >> Hi - This looks great! Did you look at Mathematica at all? They have >> been doing symbolic algebra for many years

Re: [ANN] Leiningen 2.2.0 released

2013-05-29 Thread Alan Thompson
Hi - I get ~ > lein upgrade The script at /home/alathompson/bin/lein will be upgraded to the latest stable version. Do you want to continue [Y/n]? Upgrading... curl: (35) Unknown SSL protocol error in connection to github.com:443 Failed to download https://github.com/technomancy/leiningen/raw/s

Re: Leiningen 2.2.0 released

2013-05-29 Thread Alan Thompson
Both usages are from the command line in Cygwin, both accessing Github. It seems strange that one works by default and one doesn't. Oh well. Alan On Wed, May 29, 2013 at 11:32 AM, Phil Hagelberg wrote: > On May 29, 11:01 am, Alan Thompson wrote: > > curl: (35) Unknown SSL pro

Re: Best IDE

2013-06-04 Thread Alan Thompson
Have any of you looked at Light Table? http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/ I wonder what it would take to get a VIM-like mode available with that? Alan On Tue, Jun 4, 2013 at 10:27 AM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > There are things

Re: Making things go faster

2013-06-05 Thread Alan Thompson
Nice summary on the blog. Might I suggest one small improvement? How about: (do (use 'plugh.file-test :reload-all) (run-tests) ) Then, just a single sequence. :) Alan Thompson P.S. I'm still working on getting GVIM+fireplace set up, which should allow me to do everything from

Re: with-open and for

2013-06-10 Thread Alan Thompson
Hey Thomas - How'd you get the nice syntax highlighting in your post? Alan On Sat, Jun 8, 2013 at 7:16 PM, Steven D. Arnold wrote: > Thanks for the responses! As suggested, wrapping in 'doall' does work. > > > On Jun 8, 2013, at 3:28 AM, Thomas Heller wrote: > > (defn filter-file [filename] >

Re: Making cryptograms, my first Clojure function. Feedback welcome.

2013-06-13 Thread Alan Thompson
can't tell you how many times this "fail-fast" type of behavior has saved me, since it makes bugs easy to find rather than burying the cause of a problem (kinda like getting an error at compile-type instead of at runtime). Alan Thompson On Wed, Jun 12, 2013 at 5:30 PM, Shannon Sever

Re: A* Graphe implementation

2013-06-18 Thread Alan Thompson
There is a nice example using the A* algorithm on page 149-154 of "The Joy of Clojure" by Fogus & Houser. Alan Thompson On Sun, Jun 16, 2013 at 11:00 PM, Marc Haemmerle wrote: > There's also: > http://nakkaya.com/2010/06/01/path-finding-using-astar-in-clojure/ >

Re: In what OS do you code?

2013-06-18 Thread Alan Thompson
Windoze 7 with Cygwin on desktop, AIX in production (mostly PL/1 & Java). Alan On Tue, Jun 18, 2013 at 4:08 AM, Kelker Ryan wrote: > Arch Linux, but moving to Manjaro for a more stable and simple version of > the distro. > The editor is Emacs + nrepl.el + clojure-mode + ritz + rainbow parens +

Software project estimation

2013-06-19 Thread Alan Thompson
Hi All, I saw a nice summation of software project estimation and thought some of you might like to view it: http://agile.dzone.com/articles/estimating-unknown-dates-or Enjoy! Alan Thompson -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: [ANN] Shodan: ClojureScript console API wrapper

2013-09-11 Thread Alan Thompson
Looks nice! Alan On Fri, Sep 6, 2013 at 12:29 PM, David Nolen wrote: > SWEET! > > > On Fri, Sep 6, 2013 at 3:26 PM, Joel Holdbrooks wrote: > >> Hi everyone, >> >> I put together a small library for wrapping the JavaScript console API >> available here: https://github.com/noprompt/shodan. >> >>

Software Quality video: Douglas Crockford

2015-06-08 Thread Alan Thompson
n and an overview of the current state of the practice. I recommend it to everybody. Alan Thompson -- 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 member

clojure.core.match: AssertionError: Pattern row reuses wildcards

2015-07-01 Thread Alan Thompson
Hi - I am trying to write some unit tests for Datomic using core.match to keep things succinct. I was hoping to use a match pattern like this: [ {:e tx-eid :a :db/txInstant:v _ :tx tx-eid :added true} {:e _ :a :community/category :v "free stuff" :tx tx-eid

Fwd: [ANN] Tupelo Datomic: Making Datomic Even Sweeter

2015-07-08 Thread Alan Thompson
her to the :people partition (let [tx-result @(td/transact *conn* (td/new-entity :people ; <- partition is first arg (optional) to td/new-entity { :person/name "Honey Rider" :location "Caribbean" :weapon/type #{:weapon/kn

Re: Typed Clojure paper draft

2015-07-13 Thread Alan Thompson
Ambrose - I like the paper and am glad to see continuing progress on Typed Clojure. I think the ability to integrate types easily into Clojure programs will only grow in importance in the future. Keep up the great work! Alan On Sat, Jul 11, 2015 at 7:30 AM, Ambrose Bonnaire-Sergeant < abonnairese

Re: Updated Clojure cheatsheet, including new vars in Clojure 1.7.0

2015-07-13 Thread Alan Thompson
Thank you again for providing such a valuable resource! I have a permanent browser tab open to the Cheatsheet! Alan On Sun, Jul 12, 2015 at 8:31 PM, Andy Fingerhut wrote: > Thanks to Alex Miller, http://clojure.org/cheatsheet is now updated to > the latest version of the cheat sheet, with links

Clojure, Made Simple: Rich Hickey at JavaOne

2015-07-14 Thread Alan Thompson
Hey, I just saw this video released: https://youtu.be/VSdnJDO-xdg It is Rich, talking at JavaOne, and might be the best talk I've seen him deliver. Alan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Re: Is clojars down?

2014-08-05 Thread Alan Thompson
I'm getting flakey problems from clojars right now. I can access any other websites, from multiple computers. I can access the homepage, and download any files from clojars, delete ~/.m2 and restore via 'lein deps', but I cannot upload any changes via "lein deploy clojars'. I keep getting failur

Clojure & Vim & Ctags (oh my!)

2014-09-04 Thread Alan Thompson
Hi, I've been using Clojure & Vim for a year now, with fireplace, etc. However, it seems that Exuberant Ctags is a bit crippled since I have not found a way to make it understand namespace aliases. In my current work it seems that nearly every function is in a separate namespace with a namespace

Re: Clojure & Vim & Ctags (oh my!)

2014-09-04 Thread Alan Thompson
s not know anything about clojure namespaces, it thinks the whole thing is the function name, not just the part after the "/" character. Alan On Thu, Sep 4, 2014 at 11:52 AM, Jason Felice wrote: > Is using tools.analyzer.jvm overkill? Do you want to capture > pre-macro-expan

Re: Clojure cheatsheet v16 with few updates for Sets, Maps, and Relations sections

2014-09-04 Thread Alan Thompson
Thanks for the update! I noticed that the URL still implies usage of Clojure 1.3: http://jafingerhut.github.io/cheatsheet-clj-1.3/cheatsheet-tiptip-cdocs-summary.html Should this change as well? Alan On Fri, Aug 29, 2014 at 6:56 AM, Andy Fingerhut wrote: > Newest version available here: > >

Re: Clojure & Vim & Ctags (oh my!)

2014-09-05 Thread Alan Thompson
ability to jump around: gf on an external symbol will jump to that > symbol's definition. > > > On Thursday, 4 September 2014, Alan Thompson wrote: > >> Nothing that fancy. Just trying to make ctags understand namespaces & >> namespace aliases. Vim/C

Re: Clojure & Vim & Ctags (oh my!)

2014-09-05 Thread Alan Thompson
Ah! Thank you! Alan On Fri, Sep 5, 2014 at 12:24 PM, Dave Ray wrote: > ctrl-o will take you back to your previous position after gf. At least it > does for me. > > Dave > > > On Fri, Sep 5, 2014 at 11:47 AM, Alan Thompson wrote: > >> Thanks for the 'gf'

Re: bit-wise operators for bigint in Clojure

2020-05-28 Thread Alan Thompson
In Clojure, it is probably easiest to just use Java interop, eg: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigInteger.html#setBit(int) Alan On Tue, May 26, 2020 at 9:39 AM Harmon Nine wrote: > Hello. > > I noticed a post about this from 2013, so doing a bump. > > Th

Classpath bug re Clojure 1.10.1.645 when using Figwheel.Main

2020-08-10 Thread Alan Thompson
Hi. Just helped a colleague debug a vexing problem on a CLJS project using Figwheel.Main. If we do *`brew install clojure/tools/clojure`*, it works: ~/work/tmp810/xanadu > clj --help Version: *1.10.1.561* Usage: clojure [dep-opt*] [--] [init-opt*] [main-opt] [arg*] clj [dep-opt*] [--

Re: Classpath bug re Clojure 1.10.1.645 when using Figwheel.Main

2020-08-10 Thread Alan Thompson
P.S. There seems to be no *`clojure --version`* flag. Should this be added to the command line tool? On Mon, Aug 10, 2020 at 4:58 PM Alan Thompson wrote: > Hi. Just helped a colleague debug a vexing problem on a CLJS project > using Figwheel.Main. > > If we do *`brew install c

Re: Classpath bug re Clojure 1.10.1.645 when using Figwheel.Main

2020-08-11 Thread Alan Thompson
Hi - I just tried your suggestion and no joy: ~/work/tmp810/xanadu > clj -e "((requiring-resolve ' clojure.java.io/resource) \"public/index.html\")" DEPRECATED: Libs must be qualified, change deps-ancient => deps-ancient/deps-ancient (deps.edn) DEPRECATED: Libs must be qualified, change reagent

Re: Classpath bug re Clojure 1.10.1.645 when using Figwheel.Main

2020-08-12 Thread Alan Thompson
rce the classpath you say, ignoring everything else). > > Or could be that it's not the index.html but something it refers to > getting picked up from elsewhere? > > On Tue, Aug 11, 2020 at 6:18 PM Alan Thompson wrote: > >> Hi - I just tried your suggestio

Re: Accessing Record fields with keywords in ClojureScript not working as in Clojure

2020-08-12 Thread Alan Thompson
I verified the problem in the StackOverflow post. For some reason keyword lookup of record fields in CLJS doesn't work. Alan On Tue, Aug 4, 2020 at 12:05 PM Justin Smith wrote: > I don't think this is true, or if true is incidental to the real problem > > % cljs > ClojureScript 1.10.758 > cljs.

An Intuition for Lisp Syntax

2020-10-25 Thread Alan Thompson
Nice article on how you can "discover" lisp: https://stopa.io/post/265 Enjoy! Alan -- 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

First build of Tupelo Clojure using Java 17 (Clojure 1.11.0-alpha1)

2021-09-15 Thread Alan Thompson
and everything is working fine (as expected!). 25936 lines of Clojure 419 tests 4014 assertions ~/tupelo > lein clean; lein test Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated

Re: how to package a project to a jar file?

2021-09-15 Thread Alan Thompson
You could also check out depstar https://github.com/seancorfield/depstar On Tue, Sep 14, 2021 at 8:35 AM c y wrote: > i can't use lein > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegrou

bat-test: How can I stop the capture of test output?

2021-10-25 Thread Alan Thompson
Does anybody here use `bat-test` with boot? It defaults to capturing all test output, and I can't figure out how to stop that. Thanks, Alan -- 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

Re: set return value is unordered, is that a bug or by design?

2016-05-31 Thread Alan Thompson
I believe you may have meant sorted-set On Tue, May 31, 2016 at 6:10 AM, vandr0iy wrote: > You could use sorted-map, if you wish to have them ordered: > > https://clojuredocs.org/clojure.core/sorted-map > > there is also sorted-map-by, which lets

Re: set return value is unordered, is that a bug or by design?

2016-05-31 Thread Alan Thompson
e trouble, I think), use "sorted-set": user=> (def s1 (set [1 2 3])) #'user/s1 user=> s1 #{1 3 2} user=> (def s2 (into (sorted-set) s1)) #'user/s2 user=> s2 #{1 2 3} The same trick works for "sorted-map" Alan On Tue, May 31, 2016 at 8:12 AM, Alan T

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-12 Thread Alan Thompson
On Thursday, June 9, 2016 at 11:40:03 PM UTC-7, Rangel Spasov wrote: > > Add the latest tools.analyzer as a dependency solved the problem. > > [org.clojure/tools.analyzer "0.6.9"] > >> >> I had the same problem and had to add this dependency. Is this expected? Using lein-collisions found no c

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-12 Thread Alan Thompson
e [schema.core :as s] ...) ​​ On Sun, Jun 12, 2016 at 5:12 PM, Alan Thompson wrote: > > > On Thursday, June 9, 2016 at 11:40:03 PM UTC-7, Rangel Spasov wrote: >> >> Add the latest tools.analyzer as a dependency solved the problem. >> >> [org.clojure/tools.analyzer

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-12 Thread Alan Thompson
I would have expected the namespaces to avoid this kind of conflict. Why don't they? Alan On Sun, Jun 12, 2016 at 6:29 PM, James Reeves wrote: > On 13 June 2016 at 01:21, Alan Thompson wrote: > >> I am also getting a conflict with Plumatic Schema: >> >> WA

Re: [ANN] New clojure.org!

2016-06-14 Thread Alan Thompson
Alex - I could not find a link to the Clojure.org github project on the clojure.org site. Should one be added under "Contributing" somewhere? Alan On Thursday, January 14, 2016 at 7:45:06 AM UTC-8, Alex Miller wrote: > > The new http://clojure.org is alive! > > Most of the content on the site is

clojure.spec regression bug for 1.9.0-alpha6

2016-06-14 Thread Alan Thompson
Hi - Just noticed that the :ret function in fdef seems to be ignored in 1.9.0-alpha6: user=> (require '[clojure.spec :as s]) user=> (defn dummy [x] (if x "yes" "no")) user=> (s/fdef dummy #_=> :args (s/cat :x integer?) #_=> :ret integer?) user=> (s/instrument #'dummy) user=> (dummy 3) (pr

GMail code formatter

2016-06-14 Thread Alan Thompson
Just discovered a cool Chrome extension so that you can get proper syntax highlighting when pasting code into your email. It turns plain-old code into something nice to read: *Plain:* (defn truthy? "Returns true if arg is logical true (neither nil nor false); otherwise returns false." [arg]

Re: GMail code formatter

2016-06-16 Thread Alan Thompson
​​Hmmm, Never thought of that: (defn truthy? "Returns true if arg is logical true (neither nil nor false); otherwise returns false." [arg] (if arg true false) ) ​Doesn't look half-bad, although ​I don't always have Cursive/IDEA open. Alan On Tue, Jun 14, 2016 at 9:38 PM, Colin Taylor wro

New issue of Clojure Gazette is out

2016-06-21 Thread Alan Thompson
If you haven't seen the Clojure Gazette, please give it a try! http://us4.campaign-archive2.com/?u=a33b5228d1b5bf2e0c68a83f4&id=70c69d167d&e=c39662b4e4 Alan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

Re: Too over complicated

2016-06-22 Thread Alan Thompson
Olek - You may find some of the convience functions you are missing in the Tupelo library. In particular: https://github.com/cloojure/tupelo#convenience-in-testing-seqs https://github.com/cloojure/tupelo#keeping-it-simple-with-not-nil Keeping It Simple with not-nil? Clojure has the build-in fun

Re: is there a way to use drip to speed up the running of unit tests?

2016-06-26 Thread Alan Thompson
I also highly recommend test-refersh! Alan On Sat, Jun 25, 2016 at 8:47 AM, Jake McCrary wrote: > Hi Fenton, > > In my experience the way to get faster feedback from your tests is to have > them run in a way that doesn’t require stopping and starting a process. > This can be done by either evalu

Clojure 1.9.0-alpha10: Semantic mismatch: any? vs not-any?

2016-07-11 Thread Alan Thompson
In clojure we are used to shortcuts involving not: (when-not x ...) => (when (not x) ...) (if-not x ...) => (if (not x) ...) (not-every? pred coll) => (not (every? pred coll)) (not-any? pred coll) => (not (some pred coll)) However, the new function clojure.core/any? breaks

Re: Thoughts on clojure.spec

2016-07-11 Thread Alan Thompson
Do you find it frustrating that there's no way to turn on instrumentation of function outputs for manual testing? Yes. On Mon, Jul 11, 2016 at 4:16 PM, Oliver George wrote: > > Do you find it frustrating that there's no way to turn on instrumentation >> of function outputs for manual testing?

Re: where to find clojure gigs?

2016-07-13 Thread Alan Thompson
Try these: - https://functionaljobs.com/ - https://jobs.braveclojure.com/ - https://clojurians.slack.com/messages/jobs/details/ - http://stackoverflow.com/jobs Also, make sure you list clojure and related tech you know when posting to Monster, Indeed, CareerBuilder, StackOverFlow/jo

Re: Use latest stable

2016-07-14 Thread Alan Thompson
If you haven't seen it yet, lein-ancient ( https://github.com/xsc/lein-ancient) provides an easy way of checking your project for out of date dependencies. For example: > lein ancient [criterium "0.4.4"] is available but we use "0.4.3" [tupelo "0.9.0"] is available but we use "0.1.60" [com.rpl/sp

Good post on remote working

2016-07-17 Thread Alan Thompson
http://jakemccrary.com/blog/2016/06/14/tips-for-working-from-home/ Having worked remotely most of the past two years, I think this blog post is a good summary and has some important points. Cheers, Alan -- You received this message because you are subscribed to the Google Groups "Clojure" group

Re: Frustrations so far

2016-07-20 Thread Alan Thompson
Hi Peter - I started the Tupelo library and related Tupelo-Datomic library in order to collect helper & convenience functions that I felt were missing (IMHO) from core Clojure. If you have any ideas to add or improve

Re: map/filter/remove etc. change underlying structure

2016-09-09 Thread Alan Thompson
Hi Colin, I too have been bitten by this type of inconsistency in clojure.core functions. The root of the problem is that conj has different behavior for lists and vectors, and that a seq behaves like a list. When map, filter, etc convert the source vector into a seq, the behavior of conj changes

WAT: JavaScript & Ruby

2016-09-22 Thread Alan Thompson
A 4 minute lightning talk on what happens when your API just kinda evolves itself: https://www.destroyallsoftware.com/talks/wat Alan -- 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 t

Re: parallel sequence side-effect processor

2016-09-23 Thread Alan Thompson
​Huh. I was also unaware of the run! function.​ I suppose you could always write it like this: (def x (vec (range 3))) (def y (vec (reverse x))) (run! (fn [[x y]] (println x y)) (map vector x y)) > lein run 0 2 1 1 2 0 although the plain old for loop with dotimes looks simpler: (doti

Correcting a docstring mistake in clojure.core/filter

2016-09-24 Thread Alan Thompson
Hi Alex - What is the best way to correct a mistake in the docstring for clojure.core/filter? The existing docstring is: ​​ Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects. Returns a transducer when no collection is provided. ​I

Re: [ANN] data-scope - tools for interactively inspecting and visualizing data

2016-09-26 Thread Alan Thompson
Looks cool. Alan On Sun, Sep 25, 2016 at 1:00 AM, James Sofra wrote: > Hey Alistair, > > I have been working on an engineering project and found myself charting a > lot of load distributions and such. Being able to chart intermediate values > really easily has been great. > > -- > You received t

Don't Call Yourself A Programmer, And Other Career Advice

2016-09-26 Thread Alan Thompson
A good blog posting on the realities of the software industry: -- *Don't Call Yourself A Programmer, And Other Career Advice* If there was one course I could add to eve

First time using DataScript

2016-09-26 Thread Alan Thompson
Hi - I was answering a question on StackOverflow, and after solving it using functions from clojure.core, I thought it was the prefect candidate for a little DataScript. Basically the user wants to do a "natural join" on column :obs/A, then print out pairs of :obs/value from type :x and type :y.

Re: Idiom question

2016-09-28 Thread Alan Thompson
Hi Paul, Since you are interested in the threading macros, you might like to take a look at one of my favorite variants from the Tupelo library : Literate Threading Macro We all love to use the threading macros -> and ->> for certain t

Re: Idiom question

2016-09-30 Thread Alan Thompson
The idea of the `it->` operator in the Tupelo library is basically just a combination of the explicitness of swiss arrows and the pronoun `it` from Groovy. Alan On Fri, Sep 30, 2016 at 2:00 PM, Stephen Spalding wrote: > The semantic o

Re: [ANN] A CDN for Clojars (testers needed)

2016-10-04 Thread Alan Thompson
Done! Seems to be working. Alan On Tue, Oct 4, 2016 at 6:36 PM, Toby Crawley wrote: > We're now serving a copy of the Clojars repository from Fastly's > CDN[1], backed by Rackspace Cloud Files[2] at > https://repo.clojars.org, and are looking for users to test out this > new setup. This CDN rep

Love the Medley library :)

2016-10-13 Thread Alan Thompson
I had nearly forgotten all of the very convenient functions in the Medley library until I was reminded by a small mention in the Clojure Cheatsheet . It allows you to ve

Re: WAT: JavaScript & Ruby

2016-10-13 Thread Alan Thompson
I cannot think of anything in Clojure as crazy as the stuff in the video; 90% of the stuff in Clojure is a big, big improvement over Java, et al. And a good chunk of that 90% is simply brilliant. Having said that, there are a few WAT type things in Clojure, from small annoyances like the presence

Re: [ANN] clj-xchart – A charting/plotting library for Clojure

2016-10-16 Thread Alan Thompson
Looks nice - I'll be keeping it in mind. Alan On Sat, Oct 15, 2016 at 5:31 AM, Jean Niklas L'orange wrote: > Hi Clojurians, > > I am happy to announce clj-xchart ! > XChart is a lightweight charting > library for Java

Re: Java like static typing for Clojure?

2016-10-16 Thread Alan Thompson
Be sure to check out Plumatic Schema (previously Prismatic Schema) if you haven't already. There is also a good Clojure Conj video from 2013. Alan On Sat, Oct 15, 2016 at 3:14 PM, Didier wrote: > I know a lot of

Re: join* tables from csv

2016-10-18 Thread Alan Thompson
You may also like this answer using DataScript to solve a similar problem: http://stackoverflow.com/questions/39712460/how-to-map-different-values-from-2-sets-in-clojure-based-on-unique-value/39714081#39714081 On Tue, Oct 18, 2016 at 6:09 AM, Moe Aboulkheir wrote: > (defn join* [d1 c1 d2 c2] >

Re: comp and partial vs ->>

2016-10-27 Thread Alan Thompson
I almost never use either the `comp` or the `partial` functions. I think it is clearer to either compose the functions like Gary showed, or to use a threading macro (my favorite is the `it->` macro from the Tupelo library ). Alan On Thu

Re: comp and partial vs ->>

2016-10-30 Thread Alan Thompson
I agree 100%. I quite frequently use the style, more than any of the alternatives. It even has a name, "Introduce Explaining Variable": http://refactoring.com/catalog/extractVariable.html ​ Alan​ On Sun, Oct 30, 2016 at 7:50 PM, Mikera wrote: > On Thursday, 27 October 2016 22:56:42 UTC+8, J

Re: Clojure Web Applications for Beginner

2016-11-02 Thread Alan Thompson
You should also checkout the Clojure Cookbook , which I highly recommend: They have an entire chapter on Clojure Webapps: https://github.com/clojure-cookbook/clojure-cookbook/tree/master/07_webapps Alan On Wed, Nov 2, 2016 at 12:41 PM, Erik Assum wrote: > This t

Re: How do I set up database in the context of a web application ?

2016-11-02 Thread Alan Thompson
You can find a nice overview in the Clojure Cookbook . On Wed, Nov 2, 2016 at 2:58 PM, 'George' via Clojure < clojure@googlegroups.com> wrote: > I'd like to use datomic, but my ques

Re: any? in clojure 1.9.0 alpha

2016-11-06 Thread Alan Thompson
There was quite a discussion of this topic back in July if you'd like to review it: https://goo.gl/Azy8Nf The semantic mismatch is unfortunate. Alan On Sun, Nov 6, 2016 at 6:47 PM, waffletower wrote: > I disagree, the new implementation is a subset of the code I presented. > Here is the docst

Re: [ANN] Clojure Programming Cookbook

2016-11-15 Thread Alan Thompson
Ordered! Looking forward to seeing it. :) Alan On Mon, Nov 14, 2016 at 7:08 PM, Nicolas Modrzyk wrote: > Hi Clojure people, > > So after one year and 23 days, (that would be 388 days) the IT book I was > working on with Makoto (merci!) finally got published! > > It has been a long battle with

Re: [ANN] Odin 0.2.0 - Query DSL for Clojure

2017-02-23 Thread Alan Thompson
Just came across this - it looks very cool! Alan On Sat, Dec 10, 2016 at 7:14 AM, Timothy Baldridge wrote: > I just released the first official version of Odin ( > https://github.com/halgari/odin). Odin is a declarative, extensible query > DSL for Clojure that leverages transducers to provide a

Generating a deck of cards in Clojure using generator functions (a la Python)

2017-03-14 Thread Alan Thompson
A recent post to StackOverflow asked for clarification on different ways of generating a deck of cards. The OP had used nested `for` with `flatten` and `map-indexed` but tho

Re: ANN: I wrote a beginner datomic tutorial I wanted to share with y'all, constructive feedback welcome

2017-03-20 Thread Alan Thompson
Looks like a good start. If you are interested, you may find some of the examples and helper functions from the Tupelo Datomic library useful: https://github.com/cloojure/tupelo-datomic Alan On Sun, Mar 19, 2017 at 2:34 PM, Fenton Travers wrote: > https://www.reddit.com/r/Clojure/comments/5z

Re: ANN: Orchestra, complete instrumentation for clojure.spec

2017-04-05 Thread Alan Thompson
Sounds nice! Will definitely be looking into this. Alan On Wed, Apr 5, 2017 at 11:21 AM, Jeaye wrote: > Folks, > > tl;dr -- https://github.com/jeaye/orchestra > > I'd like to announce the release of Orchestra, which tackles an > opinionated issue of clojure.spec's instrumentation not checking :r

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

2017-04-24 Thread Alan Thompson
Having not gone through your code in detail, I would suggest replacing `map` -> `mapv` to make it an eager operation so that state updates (i.e. ` next-states`) occur right away. The presence of laziness where it is not needed or expected (especially in Java interop code) can cause problems with t

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

2017-04-24 Thread Alan Thompson
stuff like `java.util.HashMap` with Clojure versions whenever possible. Again, the goal is to avoid clashes in the hidden assumptions of the two models. Alan On Mon, Apr 24, 2017 at 1:05 PM, Alan Thompson wrote: > Having not gone through your code in detail, I would suggest replacing > `

Rust intro for Clojurists

2017-04-29 Thread Alan Thompson
https://gist.github.com/oakes/4af1023b6c5162c6f8f0 -- 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.

[ANN] Tupelo - Clojure With A Spoonful of Honey

2017-04-30 Thread Alan Thompson
​​ Version 0.9.39 of the Tupelo library has been released. Tupelo is a library of helper and convenience functions to make working with Clojure simpler, easier, and more bulletproof. I've been working on some parsing & validation code recently and had occasio

Re: Incomplete With Destructuring Lists

2017-05-10 Thread Alan Thompson
Don't try to force the destructuring DSL to do more than it was intended to do. Just do it manually (or write a macro if you really insist): (defn foo [& args] (let [ [a b c] (take 3 args) mid3 (take 3 (drop 3 args)) [g h i] (drop 6 args) ] (when (< 9 (count args))

Re: Incomplete With Destructuring Lists

2017-05-10 Thread Alan Thompson
(1 2 3 4 5 6 7 8 9 10) On Wed, May 10, 2017 at 9:04 PM, Alan Thompson wrote: > Don't try to force the destructuring DSL to do more than it was intended > to do. Just do it manually (or write a macro if you really insist): > > > > (defn foo > [& args] > (let

How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
A recent question on StackOverflow raised the question of the best way to automatically generate functions. Suppose you want to automate the creation of code like this: (def foo {:able"Adelicious!" :baker "Barbrallicious!" :charlie "Charlizable"}) (def bar {:able"Apple" :b

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
t's wrong with (foo :able) => "Adelicious!" and (:able foo) => > "Adelicious!"? > > > On Thursday, May 11, 2017 at 9:20:19 AM UTC+2, Alan Thompson wrote: >> >> A recent question on StackOverflow raised the question of the best way to >> au

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
>> What's wrong with (foo :able) => "Adelicious!" and (:able foo) => >> "Adelicious!"? >> >> >> On Thursday, May 11, 2017 at 9:20:19 AM UTC+2, Alan Thompson wrote: >>> >>> A recent question on StackOverflow raised the questi

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
Since the original question was in CLJS, which has neither `intern` nor `eval`, does that mean the macro mapping another macro approach is the only solution there? On Thu, May 11, 2017 at 9:18 AM, Alan Thompson wrote: > I like the idea of using `eval` and `memoize`. I'll have to keep

Re: How to Create Clojure `defn` Functions automatically?

2017-05-11 Thread Alan Thompson
foo)`. > > On Thu, May 11, 2017 at 10:27 AM, Alan Thompson > wrote: > >> Since the original question was in CLJS, which has neither `intern` nor >> `eval`, does that mean the macro mapping another macro approach is the only >> solution there? >> >> >> On

Re: def with function call - how often executed?

2017-05-11 Thread Alan Thompson
When clojure reads this, it immediately evaluates `(+ 1 2)` => 3 so your code looks like: (def x 3) So subsequent references to `x` just get the pre-computed value of 3 and don't know how it was derived. Alan On Thu, May 11, 2017 at 9:58 AM, Kevin Kleinfelter < kleinfelter.gro...@gmail.com>

Re: How to Create Clojure `defn` Functions automatically?

2017-05-13 Thread Alan Thompson
functions. Here is the re-worked version: http://stackoverflow.com/questions/43958471/how-to-create-clojure-defn-functions-automatically-without-macros/ Alan On Thu, May 11, 2017 at 10:15 AM, Alan Thompson wrote: > Actually someone else wrote the original CLJS question (1): >

Re: Functional Pattern to Replace Temp Var

2017-05-13 Thread Alan Thompson
You are already doing exactly the right thing by having a temporary variable. To be precise a code fragment like: (let [expensive-answer (some-fn x y z) final-result { :k1 (f1 expensive-answer) :k2 (f2 expensive-answer) :k3 (f3 expensive-answer) }

Re: How to Create Clojure `defn` Functions automatically?

2017-05-13 Thread Alan Thompson
e: > Sorry, but this use of intern is a pointless. What does intern give you > that a let over a defn doesn't? > > On Sat, May 13, 2017 at 4:37 PM, Alan Thompson wrote: > >> If anyone is interested, I cleaned up the question to (hopefully) make it >> clearer, as w

  1   2   3   >