Re: CRUD application backed only by immutable facts

2012-06-04 Thread Jonas
On Tuesday, June 5, 2012 3:59:39 AM UTC+3, Kevin Lynagh wrote: > > Has anyone seen or implemented a CRUD application in Clojure using a > database of immutable facts? > > For instance, a traditional database table supporting a todo-list > application has columns > > user_id, task_id, task

Re: user.clj not working with lein 2.0

2012-06-04 Thread Warren Lynn
:injections works! slime works too (with slime-describe-symbol for doc). Thank you! On Jun 4, 11:05 pm, Phil Hagelberg wrote: > On Mon, Jun 4, 2012 at 5:55 PM, Warren Lynn wrote: > > (use 'clojure.repl) > > (use 'clojure.java.javadoc) > > > But now in the REPL I don't have clojure.repl namespace

Re: user.clj not working with lein 2.0

2012-06-04 Thread Phil Hagelberg
On Mon, Jun 4, 2012 at 5:55 PM, Warren Lynn wrote: > (use 'clojure.repl) > (use 'clojure.java.javadoc) > > But now in the REPL I don't have clojure.repl namespace available > anymore. Can anyone tell me why user.clj does not take effect anymore? > Thank you. Everything in clojure.repl has a nicer

CRUD application backed only by immutable facts

2012-06-04 Thread Kevin Lynagh
Has anyone seen or implemented a CRUD application in Clojure using a database of immutable facts? For instance, a traditional database table supporting a todo-list application has columns user_id, task_id, task_description, is_done A new row is created when a user adds a task. Then that row

user.clj not working with lein 2.0

2012-06-04 Thread Warren Lynn
Hi, I just started using lein version 2. Before (with lein 1.7), after running "lein swank" and connect with "slime-connect" in emacs, in my REPL i have clojure.repl included in "user" automatically namespace, because I have a file user.clj under ~/.lein with the following content: (use 'clojure.

Peano: a proof of concept using core.logic for test data generation

2012-06-04 Thread Brian Marick
TL;DR: Interested in using core.logic for test data generation? I may have the "stunted framework" [1] for you. I've spent an entertaining few weeks learning core.logic and putting it into practice. Because I learn by writing app-like code, I used it to generate constrained hierarchica

Re: checking for a key in a sorted map

2012-06-04 Thread Jay Fields
On Jun 4, 2012, at 5:49 PM, Meikel Brandmeyer wrote: >> Does anyone else think this is bad behavior, or should I ensure the map >> isn't sorted before asking it if it contains a key? > > The problem is not asking the sorted-map for contained keys but the keys you > use. You can't compare numbe

Re: checking for a key in a sorted map

2012-06-04 Thread Meikel Brandmeyer
Hi, Am 04.06.2012 um 23:36 schrieb Jay Fields: > I have some code that checks for a key as part of a cond statement. If I use > a map everything works fine, but if I ever pass in a sorted-map things fail. > I boiled down the issue to this: > > user=> (contains? (sorted-map 1 2 3 4) :a) > Class

checking for a key in a sorted map

2012-06-04 Thread Jay Fields
I have some code that checks for a key as part of a cond statement. If I use a map everything works fine, but if I ever pass in a sorted-map things fail. I boiled down the issue to this: user=> (contains? (sorted-map 1 2 3 4) :a) ClassCastException java.lang.Long cannot be cast to clojure.lang.K

Re: Hooking up Postal to Amazon SES

2012-06-04 Thread Drew Raines
rossputin wrote: > Has anyone hooked Postal up to SES ? I tried it this morning and it works fine. I added a section to the readme about it: https://github.com/drewr/postal/commit/da8d89a54fad4f8c4e8c617d49c57dc8d8b44473 Open an issue if you find a problem. Thanks! -Drew -- You received th

Re: Lambda: A lniux distro for clojurists

2012-06-04 Thread semperos
Any of a specialized distro, a shared VM, a pallet or vagrant script would be a good idea, because the point of such an offering is for *getting started*. For those who have never set up a Clojure environment, being able to interact with an existing setup and take out the parts they want would

Re: (#({:a %}) :b)

2012-06-04 Thread Steven Obua
Jay's example has convinced me that redefinition is not a good idea anyway, because #(f) is not always equivalent to f when (count [f]) is 1. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Re: why should these not the same ?[ into/ take-while]

2012-06-04 Thread Baishampayan Ghose
Ugih, > (into '(1  2 3) '(3 2 1)) => (1 2 3 1 2 3) > (into [1 2 3] [3 2 1])  => [1 2 3 3 2 1] When you `add` something to a vector it gets added to the end and when you do the same with a list, it gets added to the front. It happens that way because such behaviour is the most obvious for vectors

Re: why should these not the same ?[ into/ take-while]

2012-06-04 Thread Tassilo Horn
Ugih Li writes: > (into '(1 2 3) '(3 2 1)) => (1 2 3 1 2 3) > (into [1 2 3] [3 2 1]) => [1 2 3 3 2 1] `into` conj[oins] the items of the second collection to the first collection, and `conj` itself "adds" elements as it is most efficient for the given collections. For list, conj prepends, for

Re: (#({:a %}) :b)

2012-06-04 Thread Softaddicts
Reader macros are syntactic sugar on top of the syntax. They identify immediately what they stand for unambigously. I doubt that it would be a good idea to introduce this kind of logic in the reader. That's an open door to chaos. The same token could be used for different constructs. As Meikel

why should these not the same ?[ into/ take-while]

2012-06-04 Thread Ugih Li
(into '(1 2 3) '(3 2 1)) => (1 2 3 1 2 3) (into [1 2 3] [3 2 1]) => [1 2 3 3 2 1] (take-while even? [1 2 3 4]) => () ? anyone tell me why? -- 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: (#({:a %}) :b)

2012-06-04 Thread Jay Fields
; assume 'recorders' is {:x #(println (System/currentTimeMillis)) ... } #((recorders %)) the above code has a single form (i.e. count 1), and allows you to get the fn you desire from a map and immediately execute it. I've done similar things in prod. On Mon, Jun 4, 2012 at 8:51 AM, Steven Obua w

Re: (#({:a %}) :b)

2012-06-04 Thread Steven Obua
I doubt that this change would break anything, as the case that has changed has been pretty useless so far. On 4 Jun 2012, at 13:32, Moritz Ulrich wrote: > I don't think redefining the behavior of fundamental syntax is a good > idea. Might break many things. -- You received this message becaus

Re: (#({:a %}) :b)

2012-06-04 Thread Moritz Ulrich
I don't think redefining the behavior of fundamental syntax is a good idea. Might break many things. On Mon, Jun 4, 2012 at 2:29 PM, Steven Obua wrote: > Come to think of it, why not redefine #(...) in the following way: > > > If (count [...]) is 0 or > 1 , then the old semantics stays > If (coun

Re: (#({:a %}) :b)

2012-06-04 Thread Steven Obua
Come to think of it, why not redefine #(...) in the following way: If (count [...]) is 0 or > 1 , then the old semantics stays If (count [...]) is 1, then the new semantics kicks in (i.e., without enclosing brackets). This would allow (#({:a %}) :b) to behave in a sane way In case f is actual

Re: (#({:a %}) :b)

2012-06-04 Thread Meikel Brandmeyer (kotarak)
Or simply: #(vector 1 % 3) Literals are not the only way to create data structures. Kind regards Meikel -- 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 ar

Re: (#({:a %}) :b)

2012-06-04 Thread nick rothwell
This one has caught me once or twice as well: #(xxx) evaluates "(xxx)", not "xxx". My usual mistake is ... #([1 % 3]) ... My rather verbose workround is ... #(identity [1 % 3]) ... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Using Clojure internal libraries in another project

2012-06-04 Thread Nuno Marques
If the OP is looking for an STM for mutable data. this one [1] is being used in production in several sites for several years. [1] http://web.ist.utl.pt/~joao.cachopo/jvstm/ On Jun 3, 2012, at 8:03 PM, Andy Fingerhut wrote: > Technical-wise, since you asked specifically about the STM implement