Re: Recursive definition in core.logic

2014-09-22 Thread Joshua Ballanco
On Sunday, September 21, 2014 at 21:40, Tassilo Horn wrote: > I think instead of `conde' you can use `conda' here, because when the > first clause succeeds the second one cannot succeed and doesn't need to > Careful with the use of `conde` vs `conda`, as `conda` is an early cut. In other words

Re: Surprised by behaviour of `compile` vs positional constructor fns

2014-09-22 Thread Jozef Wagner
It looks like following not so well known bug http://dev.clojure.org/jira/browse/CLJ-979 On Mon, Sep 22, 2014 at 8:55 AM, Peter Taoussanis wrote: > Hi all! > > Ran into some behaviour today that I wasn't expecting and am wondering if > someone could shed some light. > > Steps to reproduce (reprod

Re: Surprised by behaviour of `compile` vs positional constructor fns

2014-09-22 Thread Peter Taoussanis
Hi Jozef, thanks a lot for the pointer - that does seem to be the cause! Will continue to track from there. Cheers :-) -- 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

Re: clojure.org uses a wikispaces TLS certificate

2014-09-22 Thread Laurens Van Houtven
Hi Alex, On 20 Sep 2014, at 20:20, Alex Miller wrote: > Clojure.org is hosted on wikispaces. For what purpose would you access it by > https? It’s not a (purposeful) choice; my browser is configured to access any site that supports it over HTTPS. Since this is intentional, I have simply inst

[ANN] clecs 1.0.1

2014-09-22 Thread Atamert Ölçgen
clecs is an entity-component-system framework for Clojure. The repo is here: https://github.com/muhuk/clecs Changes Since Version 0.2.x * Replaced function based queries with data driven queries. -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- You received this message becaus

`remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-22 Thread Daniel König
Hi, after removing a namespace with the remove-ns form, I am not able to require it a second time. >From what I can tell, I should be able to reload a namespace after removing it. This behaviour was found in Clojure 1.5.1 and Clojure 1.6. Example: => (require 'config :reload) nil => (remove-ns

Re: [ANN] Clojure Videos (with options for Linux users)

2014-09-22 Thread Mateusz Fiołka
Paypal payment option would be nice. On Friday, September 19, 2014 2:51:46 AM UTC+2, tbc++ wrote: > > Just wanted to throw this out there, but I've been making steady progress > on my Clojure Tutorial Videos (https://tbaldridge.pivotshare.com). We're > up to 43 videos with new episodes added a

Re: clojure.org uses a wikispaces TLS certificate

2014-09-22 Thread Alex Miller
It is likely that at some point in the future, clojure.org will be hosted elsewhere. For now, this doesn't seem to be a high priority to address so I don't plan to do anything about it (presumably it would be difficult to do so). On Monday, September 22, 2014 7:02:06 AM UTC-5, Laurens Van Houtv

Re: clojure.org uses a wikispaces TLS certificate

2014-09-22 Thread Laurens Van Houtven
On 22 Sep 2014, at 17:30, Alex Miller wrote: > It is likely that at some point in the future, clojure.org will be hosted > elsewhere. For now, this doesn't seem to be a high priority to address so I > don't plan to do anything about it (presumably it would be difficult to do > so). Absolutely

[ANN] lein-plz "0.3.0" - Add dependencies quickly

2014-09-22 Thread john walker
Hi everyone, lein-plz is a plugin for adding dependencies quickly. It lets you do things like $ lein plz add cljs core.async instead of editing the project.clj directly. @luxbock added ~450 new builtins from crossclj.info and a list task that simplifies searching

Re: `remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-22 Thread Laurent PETIT
I think it is broken, and I think I know who the culprit may be (me). Before 1.5.1 (I guess), it was impossible to do things like that from e.g. a live repl session: (ns a) (ns b (:require a)) because somehow the filesystem for ns a would be checked, no file found. So a check was adde

Re: [ANN] Clojure Videos (with options for Linux users)

2014-09-22 Thread Bozhidar Batsov
I was thinking the same thing. Lack of paypal support is the only reason I haven’t subscribed yet… Not sure if it’s something supported by pivotshare, though. — Cheers,  Bozhidar On September 22, 2014 at 5:52:05 PM, Mateusz Fiołka (mateusz.fio...@gmail.com) wrote: Paypal payment option would

Re: [ANN] Clojure Videos (with options for Linux users)

2014-09-22 Thread Timothy Baldridge
If you don't mind using Dropbox instead of Pivotshare, the "Linux option" I described is exactly that, you sign up via PayPal and I manually add you to the Dropbox share. The link for Paypal is at the bottom of the site: https://tbaldridge.pivotshare.com/ Timothy Baldridge On Mon, Sep 22, 2014 at

Re: Eager (cat) in transducers

2014-09-22 Thread Alex Miller
This is an excellent question and the answer is: no, there is not a clever way (or a desire) to avoid this. The internals of transducer functions are never lazy. Each "step" will be eagerly completed for each output element. This is a fundamental difference between the lazy sequence and transdu

Clojure beginner: angst about "doing things right"

2014-09-22 Thread J David Eisenberg
As part of a larger program, I'm testing a function that will turn a string of days on which a class occurs (such as "MWF") into a list of seven numbers: (1 0 1 0 1 0 0). I first translate"TH" (Thursday) to "R" and "SU" (Sunday) to "N" to make things a bit easier. I came up with the following c

Re: transducers and async operations

2014-09-22 Thread Leon Grapenthin
The steps of your transducer composition are depending on each other. They can only produce a result from an input if they process it synchronously. If you had > Because it's Node-JS environment, and that can be the same for any async > Javascript, you never wanna call sync operations (like syn

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread Timothy Baldridge
I'm not completely sure what you're trying to do, but I think reduce can help you here. For example: (reduce (fn [acc x] (if (odd? x) (conj acc x) acc)) [] [1 2 3 4 5 6]) returns: [1 3 5] Reduce is good for when you want iterate over one data structure and optionally u

Re: transducers and async operations

2014-09-22 Thread Wilker
I understand Leon, but all that only applies on Java world... The issue here is because I depend on async stuff, in Java you always have options to do it sync, you don't need any of those callbacks at all, this is a JS API issue. So in my case I really need the async factor here, I can't avoid it.

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread Tobias Kortkamp
Using map and sets: (defn days-number-maker [all-days day-string] (let [day-set (set day-string)] (map (fn [day] (if (day-set day) 1 0)) all-days))) (defn days-to-numbers "Change string like MTTH to (1 1 0 1 0 0 0)" [day-string] (let [d

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread Ray Miller
A general rule of thumb is to prefer higher-order functions to explicit recursion. When you are trying to accumulate something (here, you are accumulating a list of zeroes and ones), you can usually use reduce. This is a little bit more tricky here as you need to keep track of which bits of the inp

Re: Working on a patch to add Clojure for Spring dynamic language support

2014-09-22 Thread henrik42
Hi Adan, not sure if it helps, but defining Spring beans that call Clojure code is straight forward: You can find more examples at https://github.com/henrik42/spring-break I've played around with the Spring scpting API but as far as I can tell it won't let y

Re: transducers and async operations

2014-09-22 Thread Leon Grapenthin
I don't see a way for a reducing function to make its return value depend on the result of another callback. On Monday, September 22, 2014 9:45:15 PM UTC+2, Wilker wrote: > > I understand Leon, but all that only applies on Java world... The issue > here is because I depend on async stuff, in J

Re: `remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-22 Thread Stuart Sierra
I'm not sure I understand what you mean. `remove-ns` does not remove the namespace from the set of "loaded" namespaces kept by `require`. tools.namespace has a hack

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread Alex Walker
For a "do it with (map)" mindset, think in terms of list processing or a conveyer belt, where a series of pure functions transforms a value in a small but significant way. 1. Imho, the clojure-way is to apply the set of principles outlined by Rich and FP using the idioms established by the co

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread Alex Walker
For a "do it with (map)" mindset, think in terms of list processing or a conveyer belt, where a series of pure functions transforms a value in a small but significant way. 1. Imho, the clojure-way is to apply the set of principles outlined by Rich and FP using the idioms established by the co

Re: ANN: ClojureScript 0.0-2341, Improved Analysis & Transducers

2014-09-22 Thread Denis Johnson
Thanks for the update. Both the previous and this causes the following warnings with core.async: WARNING: Use of undeclared Var cljs.core.async/do-alts at line 62 file:../.m2/repository/org/clojure/core.async/0.1.338.0-5c5012-alpha/core.async-0.1.338.0-5c5012-alpha.jar!/cljs/core/async/impl/ioc_

Re: Clojure beginner: angst about "doing things right"

2014-09-22 Thread john walker
Here's one way you could do part of it: https://gist.github.com/johnwalker/7fcf1f988cd5e6e21fd5 (let [day->index(into {} (map-indexed (fn [k v] [v k]) "MTWRFSN")) ;; So M (Monday) maps to 0, S (Saturday) maps to 5 initial-state (into [] (repeat 7 0))] ;; Create an empty vector

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-22 Thread Devin Walters
I didn't read it that way. > On Sep 14, 2014, at 7:45 AM, adrian.med...@mail.yu.edu wrote: > > Friendly advice: when you describe anything you create with adjectives like > beautiful, it comes off as unnecessarily arrogant to native English speakers. > > Adrian > >> On Sunday, September 14, 20

Re: ANN: ClojureScript 0.0-2341, Improved Analysis & Transducers

2014-09-22 Thread Kyle Cordes
On Monday, September 22, 2014 9:45:44 PM UTC-5, Denis Johnson wrote: > > Thanks for the update. > > Both the previous and this causes the following warnings with core.async: > > WARNING: Use of undeclared Var cljs.core.async/do-alts at line 62 > file:../.m2/repository/org/clojure/core.async/0.1.33

Re: `remove-ns' prevents namespace from being reloaded by `require' in clj 1.5.1 and 1.6

2014-09-22 Thread Laurent PETIT
Hello, Le mardi 23 septembre 2014, Stuart Sierra a écrit : > I'm not sure I understand what you mean. > > `remove-ns` does not remove the namespace from the set of "loaded" > namespaces kept by `require`. tools.namespace > has a hack >