Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread Sean Corfield
On Fri, Jul 5, 2013 at 8:53 PM, Carlo Zancanaro wrote: > Is there a > reason you don't use the database's table/column name quoting? It means that > keywords like :first-name cannot be used as table names without a fair bit > of trouble. The DSL in java.jdbc supports :entities and :identifiers to

Domain modelling question

2013-07-05 Thread Marc Schneider
Hello, I'm trying to implement some business model in Clojure. I have several years of experience developing OO systems in Java. So it's still very hard to wrap my head to functional thinking. I hope you can help me with following questions. I need a domain model for customers, contracts and f

Clojure Group

2013-07-05 Thread Michael Sadler
Hello, I came across the Clojure group via a blog and didn't want to spam it and decided to contact you directly. I'm wondering if this can be posted to the group: #Metricata makes the software engineering process measurable and repeatable. ses.newventurewebsites.com Looking forward, Michae

Re: Web crawling tree traversal

2013-07-05 Thread Gary Trakhman
I wrote this a while ago, here it is :-) https://github.com/gtrak/betamore-clj/blob/master/src/betamore_clj/core.clj On Thu, Jul 4, 2013 at 1:23 PM, Amir Fouladi wrote: > Hi everybody > > I'm a clojure newbie, so I'm sorry if I'm asking a dumb question. > I'm trying to write a program to crawl

Re: Offline Clojure docs

2013-07-05 Thread Kelker Ryan
wget -k -m http://clojure-doc.org/wget -k -m http://clojuredocs.org/ 06.07.2013, 12:59, "Tom Faulhaber" :It's easy to pull the autodoc documentation for offline use. You can either do this: $ git clone https://github.com/clojure/clojure.git clojure-api$ cd clojure-api$ git checkout gh-pages or you

Re: Offline Clojure docs

2013-07-05 Thread Tom Faulhaber
It's easy to pull the autodoc documentation for offline use. You can either do this: $ git clone https://github.com/clojure/clojure.git clojure-api $ cd clojure-api $ git checkout gh-pages or you can just open "https://github.com/clojure/clojure/archive/gh-pages.zip"; or pull the directory wit

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread Carlo Zancanaro
Hey Sean, Most of the points in my reply to Roman also apply to `HoneySQL`. In particular this phrase in the README summarises a good deal of my criticism: "When using the vanilla helper functions, new clauses will replace old clauses". You have to go out of your way to get the composability that

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread Carlo Zancanaro
Hey Roman, The issue that I see with `sqlingvo`, and the thing which I was trying to solve for myself, is that it doesn't compose well. Unless I'm missing something, you have to generate the entire query in the one `sql` form. To me, this is a big restriction and was the number one thing I was try

Re: core.async JAR

2013-07-05 Thread David Pollak
I've found the core.async files are in snapshots... this line in project.clj works for me: :repositories {"sonatype-oss-public" " https://oss.sonatype.org/content/repositories/snapshots/"} On Fri, Jul 5, 2013 at 12:24 AM, James Reeves wrote: > On 4 July 2013 15:20, pmf wrote: > >> Is there

[ANN] http-kit 2.1.5 released, bug fix, please upgrade if using the Websocket API

2013-07-05 Thread Shen, Feng
Hi, [http-kit "2.1.5"] Just released, if you are using the Websocket API, please upgrade. This release fixes a bug reported by Andrew Rudenko: #68 Loop of Close frames 1. A WebSocket client like Autobahn.Android w

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Justin Kramer
Besides post-processing results, you can also instruct java.jdbc to return Joda dates in the first place. Using clojure.java.jdbc 0.3.0-alpha4: (ns example (:require [clojure.java.jdbc :as j] [clj-time.local :as cl])) ... (extend-protocol j/IResultSetReadColumn java.sql.Date (r

Re: Sequential conditional transforms of an argument

2013-07-05 Thread Mikera
On Friday, 5 July 2013 16:52:10 UTC+1, Laurent PETIT wrote: > 2013/7/5 Mikera >: > > I really like the as-> macro for this kind of thing. > > > > (as-> (something) x > > (if (test1 x) (transform1 x) x) > > (if (test2 x) (transform2 x) x) > > (do-something-else-with

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Cedric Greevey
Even without reaching for libraries outside clojure.core, there's (update-in m [:key-of-interest] #(if (condition? %) (transformation %) %)) and the ability to convert that into a function, e.g. (defn conditional-update-in [m condition? transformation k] (update-in m [k] #(if (condition? %) (t

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Ben Wolfson
You could use clojure.algo.generic.functor.fmap: (fmap #(if (pred? %) replacement-value %) your-map). On Fri, Jul 5, 2013 at 2:08 PM, John Walker wrote: > I had to do something similar, and used > clojure.walk. > > On Friday, July 5, 2013

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Colin Yates
Grrr.. google groups seems to be playing up so apologies if this is double posted. Thanks both! My attempt (inspired by Stuart Sierra's reply at https://groups.google.com/forum/#!topic/clojure/Hlfn4PdKg-k) was something like this (from memory so forgive me): (defn val-or-date [result [k v]] (

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Jim - FooBar();
I 'd change the implentation of update-vals to use reduce-kv. you will avoid the cost of destructuring on every single step :) Jim On 05/07/13 22:15, Jay Fields wrote: I use update-vals from https://github.com/jaycfields/jry fairly often. As long as you don't mind doing the pred check in the

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Jay Fields
I use update-vals from https://github.com/jaycfields/jry fairly often. As long as you don't mind doing the pred check in the fn you pass to update-vals, it should do the trick. Cheers, Jay On Fri, Jul 5, 2013 at 5:14 PM, Jim - FooBar(); wrote: > You'll never really 'replace' any values so why n

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Jim - FooBar();
You'll never really 'replace' any values so why not reduce/reduce-kv ? Just build a new map out of the old one... Jim On 05/07/13 21:59, Colin Yates wrote: Hi all, I think this is one of those questions which has quite a few answers, but given a map, how do I replace the values by applying a

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread John Walker
I had to do something similar, and used clojure.walk. On Friday, July 5, 2013 8:59:54 PM UTC, Colin Yates wrote: > > Hi all, > > I think this is one of those questions which has quite a few answers, but > given a map, how do I replace the v

(newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Colin Yates
Hi all, I think this is one of those questions which has quite a few answers, but given a map, how do I replace the values by applying a function to those values, but only if they meet a condition? I understand the building blocks of (map..), (filter..), (assoc-in..) and (filter..) and I can s

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-05 Thread Dragan Djuric
Thanks for the tip, Michael. I added a notification on every page, for the TL;DR crowd, so I hope that will catch the attention of enough people and improve the future readability of the docs. On Wednesday, July 3, 2013 2:34:33 PM UTC+2, Michael Klishin wrote: > > 2013/7/3 Dragan Djuric > > >> T

core.logic - Using featurec to describe relationships around keys in a map

2013-07-05 Thread David Rocamora
Hi, I'm trying to use featurec to describe some relationships within a nested map. When I try to use it to find some keys in the map it returns nothing. Here is an example: ;; Here is a map of some foods > (def foods {:apple {:color "Red"} > :carrot {:color "Orange"} > :

Re: Pedestal introduction question

2013-07-05 Thread Ryan Neufeld
Thanks, I made the update in the doc repo [1]. I'm not sure why your message took so long to drop into my non-registered email queue. I only saw an email about it late this morning. Anyways, I'll get this pushed to pedestal.io ASAP. In the future you can submit an issue or pull request to the p

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread David Nolen
On Fri, Jul 5, 2013 at 1:13 PM, Adam Saleh wrote: > Apologies, forgot that this is not a forum. > > 1) What would environment trimming provide me? Because right now I am > using core.logic quite naively, > mostly just applying recursion and some pattern matching. > Handling large inputs. If you'

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread Adam Saleh
Apologies, forgot that this is not a forum. 1) What would environment trimming provide me? Because right now I am using core.logic quite naively, mostly just applying recursion and some pattern matching. 2) for starting I have implemented a simple regular grammar engine, seems to work :) (d

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread Adam Saleh
What does that mean? Because right now I am using core.logic quite naively, mostly just applying recursion and some pattern matching. Adam -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: multiline strings and multiline comments ?

2013-07-05 Thread Laurent PETIT
2013/7/5 Michael Wood : > On 5 July 2013 14:17, Laurent PETIT wrote: >> >> 2013/6/29 Niels van Klaveren : >> > In my version of CCW CTRL-/ multiline (un)commenting just works (under >> > Windows). >> > Perhaps it's a keyboard shortcut problem ? >> > >> > Only problem there is when multiple lines a

Re: Anybody has tried to (re)write re-match in core.logic?

2013-07-05 Thread Norman Richards
On Thu, Jul 4, 2013 at 9:36 AM, Tassilo Horn wrote: > > Not sure if core.logic can do relations between infinite sets... > Sure, why not? Here's a trivial example of combinations of all lists containing :x with all the lists containing :y, both infinite. (run 10 [x y] (membero :x x) (membero

Re: Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
Even though I would like to know if there is a better solution it seems that the workaround using profiles (and optionally using aliases) mentioned in the thread http://librelist.com/browser//leiningen/2012/8/29/plugins-can-t-be-on-s3/#648e7f85c85df8f7248fc9365693c20c works for me. In that th

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread Sean Corfield
And there's HoneySQL: https://github.com/jkk/honeysql (that's the one java.jdbc will recommend going forward since I worked with the author, Justin Kramer, on compatibility and direction for java.jdbc and HoneySQL at Clojure/conj last year) On Fri, Jul 5, 2013 at 3:59 AM, r0man wrote: > Hi Carl

[ANN] Pedestal 0.1.10 has been released

2013-07-05 Thread Ryan Neufeld
Hey Folks, We've just released the 0.1.10 versions of the Pedestal libraries. This release has a couple of neat improvements; the app message queue is now a priority queue (specify msg/priority :high for a high-priority message,) and service's url-for now accepts a :fragment option (among other

Re: multiline strings and multiline comments ?

2013-07-05 Thread Michael Wood
On 5 July 2013 14:17, Laurent PETIT wrote: > 2013/6/29 Niels van Klaveren : > > In my version of CCW CTRL-/ multiline (un)commenting just works (under > > Windows). > > Perhaps it's a keyboard shortcut problem ? > > > > Only problem there is when multiple lines are selected, and some are > > unco

Re: Sequential conditional transforms of an argument

2013-07-05 Thread Laurent PETIT
2013/7/5 Mikera : > I really like the as-> macro for this kind of thing. > > (as-> (something) x > (if (test1 x) (transform1 x) x) > (if (test2 x) (transform2 x) x) > (do-something-else-with x y) > (if (test3 x) (transform3 x) x)) > > Advantages: > - It's part of

Re: Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
I also found this thread http://librelist.com/browser//leiningen/2012/8/29/plugins-can-t-be-on-s3/#648e7f85c85df8f7248fc9365693c20c that discusses this issue. I tried to add after the defproject form... (cemerick.pomegranate.aether/register-wagon-factory! "s3p" #(eval '(org.springframework.aws.

Re: Sequential conditional transforms of an argument

2013-07-05 Thread Mikera
I really like the as-> macro for this kind of thing. (as-> (something) x (if (test1 x) (transform1 x) x) (if (test2 x) (transform2 x) x) (do-something-else-with x y) (if (test3 x) (transform3 x) x)) Advantages: - It's part of core in 1.5 - It's a macro and com

Re: multiline strings and multiline comments ?

2013-07-05 Thread Laurent PETIT
2013/7/5 Niels van Klaveren : > >> Right, but what should be done, then? The command is a "toggle", but >> there are both commented and uncommented lines: should it comment all >> lines, or uncomment all lines? > > > I understand why the function works like it does, and there's no 'right' > solutio

Re: multiline strings and multiline comments ?

2013-07-05 Thread Niels van Klaveren
> Right, but what should be done, then? The command is a "toggle", but > there are both commented and uncommented lines: should it comment all > lines, or uncomment all lines? > I understand why the function works like it does, and there's no 'right' solution to this problem. I just posted t

Leiningen and s3-wagon-private load order issues?

2013-07-05 Thread Ryan Stradling
I have created a lein plugin called lein-install. Lein install is published to a private s3 repo using s3-private-wagon. That all works fine. I have another project called lein-webapp that has a project like so... :plugins [[s3-wagon-private "1.1.2"] [lein-install "0.1.0-SNAPSH

Re: multiline strings and multiline comments ?

2013-07-05 Thread Niels van Klaveren
> Right, but what should be done, then? The command is a "toggle", but > there are both commented and uncommented lines: should it comment all > lines, or uncomment all lines? > I fully understand there's no right solution for this, just wanted to assure the OP that the function should work

[ANN] modern-cljs tutorial 15 - Unit testing

2013-07-05 Thread Giacomo Cosenza
Hi all, I just published the 15th tutorial of the series modern-cljs. https://github.com/magomimmo/modern-cljs After having implemented the server side validators, it introduces unit testing. HIH My best regards Mimmo -- -- You received this message because you are subscribed to the Google

Re: Sequential conditional transforms of an argument

2013-07-05 Thread Thomas Heller
Hi, you could use a macro, but a simple function should suffice. I use something along the lines of (defn cond-transform [x & pairs] (reduce (fn [x [test-fn transform-fn]] (if (test-fn x) (transform-fn x) x)) x pairs)) ;; example

Re: multiline strings and multiline comments ?

2013-07-05 Thread Laurent PETIT
2013/6/29 Niels van Klaveren : > In my version of CCW CTRL-/ multiline (un)commenting just works (under > Windows). > Perhaps it's a keyboard shortcut problem ? > > Only problem there is when multiple lines are selected, and some are > uncommented, uncommenting the whole block doesn't work. Right,

Sequential conditional transforms of an argument

2013-07-05 Thread Laurent PETIT
hello, More often than not, I'm facing code looking like this: (let [x (if (test1 x) (transform1 x) x) x (if (test2 x) (transform2 x) x) x (if (test3 x) (transform3 x) x)] x) Do you know of a better way to write this with only clojure.core functions? So far, I've had no success

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread r0man
Hi Carlo, if you'are looking for generating more complex SQL there's also: https://github.com/r0man/sqlingvo Roman. On Wednesday, July 3, 2013 10:48:07 AM UTC+2, Carlo wrote: > > Hey guys! > > I've been working on a small library to make writing SQL queries a little > bit easier. It's along th