Re: Is there a tool to display all the references to a symbol in a project?

2014-12-03 Thread Alex Hammel
If you're OK with using an editor that's not emacs, most of them have some kind of ctags plugin these days. There's a decent looking ctags config for clojure here http://andrew.stwrt.ca/posts/vim-ctags (haven't tried it myself). On Wed, Dec 3, 2014 at 7:40 AM, Ashton Kemerling

Re: My first implementation of Sieve of Eratosthenes. cons please

2014-11-26 Thread Alex Hammel
A few observations: I believe what you have implemented is trial division http://en.wikipedia.org/wiki/Trial_division, rather than the SoE. It looks a little weird to me to have a predicate called `not-foo?` starting with a call to `not`. I would rather define a `foo?` predicate, and then do

Re: My first implementation of Sieve of Eratosthenes. cons please

2014-11-26 Thread Alex Hammel
Or there's this approach, based on an example from the docs https://clojuredocs.org/clojure.core/lazy-seq, which gives an infinite lazy seq of primes: (defn divisible-by? [x y] (zero? (mod x y))) (defn sieve [s] (cons (first s) (lazy-seq (sieve (filter #(not (divisible-by? %

Re: better way to group consecutive numbers in a vector?

2014-11-07 Thread Alex Hammel
Here's my take on the 'add delimiters and split' approach. Bonus `congeal function, which chunks collections on any condition you like: (defn- insert-gaps [coll pred gap-symbol] (reduce (fn [acc x] (if (pred (peek acc) x) (conj acc x) (conj acc

Re: [ANN] Automat: better FSMs through combinators

2014-05-14 Thread Alex Hammel
This looks really, really cool. Good work! On Wed, May 14, 2014 at 6:41 AM, Jason Felice jason.m.fel...@gmail.comwrote: Wow, this library looks very useful! Thanks! -Jason On Tue, May 13, 2014 at 5:55 PM, Colin Fleming colin.mailingl...@gmail.com wrote: I'm also very excited about

Re: Potential Intro clojure projects - libraries and ideas with wow factor

2014-04-16 Thread Alex Hammel
Probably. Things like OptaPlanner are the big business use-case for logic programming, IIRC. On Wed, Apr 16, 2014 at 1:49 AM, Josh Kamau joshnet2...@gmail.com wrote: Can core.logic be used to implement something like http://www.optaplanner.org ? Josh On Wed, Apr 16, 2014 at 9:36 AM,