Re: Define new defn, lein uberjar succeeds to compile but lein run fails

2015-11-25 Thread mattias w
I moved my own definition of defn to a separate project, and then it works. It seems you cannot redefine defn within the same project it is used. Den fredag 13 november 2015 kl. 13:46:56 UTC+1 skrev mattias w: > > I defined my own defn in the namespace mwm. > > > My new code looks like this > > >

Re: channels 1:1, callbacks many:many ?

2015-11-25 Thread Moe Aboulkheir
On Wed, Nov 25, 2015 at 6:42 AM, wrote: > > So how does one use channels if one is accustomed to registering several > callbacks to a single event? Do you have an intermediary which takes one > value from the source channel and then puts the value on as many other > channels as there are subscribe

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Dragan Djuric
I am working on something related to probabilistic programming/inference/learning. Not yet ready for use but I hope to get it there the next year. Although some key building blocks are the same (MCMC), I really cannot see how such things could be integrated to core.logic, and even why. So, I wo

Re: Ultralight Components

2015-11-25 Thread William la Forge
James, I've been thinking about protocols. Yes, I can now put them on an aggregate, but there may be a lot of places where it is better not to use a protocol and just use functions instead. The code below does not use a protocol and I rather like it. In other cases we can use functions to achi

Re: Ultralight Components

2015-11-25 Thread Colin Yates
(let [x …] (if x true false)) is exactly what (if-let [x …] true false) is for (http://stackoverflow.com/questions/2010287/when-to-use-let-vs-if-let-in-clojure ) :-) > On 25 Nov 2015, at 13:10, William la Forge

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Carl Cotner
> Although some key building blocks are the same (MCMC), I really cannot see > how such things could be integrated to core.logic, and even why. This is not a concrete answer to your question, but probability can be thought of as a continuous extension of logic where 0 = False and 1 = True (and .5

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Dragan Djuric
I know well how probabilistic logic works. It is a superset of the true/false logic, and goes much beyond "half true" etc. My question was about how this would look like when integrated with core.logic vs just using full-blown probabilistic logic-based library/language. On Wednesday, November 2

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Carl Cotner
Sorry, didn't mean to offend. I was just offering a reason for the "even why". Perhaps I misinterpreted ... On Wed, Nov 25, 2015 at 9:20 AM, Dragan Djuric wrote: > I know well how probabilistic logic works. It is a superset of the > true/false logic, and goes much beyond "half true" etc. My ques

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Dragan Djuric
I am sorry if my reply sounded like I was offended. I was not, I was just going straight to the point without beating around the bush :) On Wednesday, November 25, 2015 at 3:28:14 PM UTC+1, Carl Cotner wrote: > > Sorry, didn't mean to offend. I was just offering a reason for the > "even why". Pe

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread David Nolen
The rationale is simply that Prolog-like systems have embraced it as it appears to be a very natural fit - https://dtai.cs.kuleuven.be/problog/ David On Wed, Nov 25, 2015 at 9:20 AM, Dragan Djuric wrote: > I know well how probabilistic logic works. It is a superset of the > true/false logic, an

Re: Any chance of core.logic getting extended with probKanren?

2015-11-25 Thread Carl Cotner
No worries. I was just trying to point out that at least conceptually it is a very natural extension. On Wed, Nov 25, 2015 at 9:41 AM, Dragan Djuric wrote: > I am sorry if my reply sounded like I was offended. I was not, I was just > going straight to the point without beating around the bush :)

Re: Ultralight Components

2015-11-25 Thread William la Forge
+1 On Wednesday, November 25, 2015 at 8:14:32 AM UTC-5, Colin Yates wrote: > > (let [x …] (if x true false)) is exactly what (if-let [x …] > true false) is for ( > http://stackoverflow.com/questions/2010287/when-to-use-let-vs-if-let-in-clojure > ) > > :-) > > On 25 Nov 2015, at 13:10, William la

Re: Ultralight Components

2015-11-25 Thread William la Forge
Atamert, I didn't get far on yo-yo--stopped reading when it started talking about monadic functions. :-) But there is one main difference. I expect a component to "do its own thing", i.e. register its close function on opening. So there is nothing like defining a component. Well, except that w

Re: channels 1:1, callbacks many:many ?

2015-11-25 Thread Timothy Baldridge
In addition to mult/tap, if all you need is something that looks like a promise, the newest core.async has "promise channels" which only accept a single put, but that value can be retrieved by many takes. On Wed, Nov 25, 2015 at 3:21 AM, Moe Aboulkheir wrote: > > > On Wed, Nov 25, 2015 at 6:42

Re: channels 1:1, callbacks many:many ?

2015-11-25 Thread Stuart Sierra
Hi, Channels are many-to-many in the sense that many processes can "put" values on the same channel, and many processes can be waiting to "take" a value. They are one-to-one in the sense that each "put" value will be delivered to exactly one "taker". What you're describing sounds like a typica

Re: channels 1:1, callbacks many:many ?

2015-11-25 Thread fahptv
by the way, the existing code base was created by other people, not me On Wednesday, November 25, 2015 at 9:40:11 AM UTC-8, fah...@gmail.com wrote: > > Thanks for all the replies so far. You're right, there is state involved. > My situation is this: > >1. there are several different kinds of

Re: channels 1:1, callbacks many:many ?

2015-11-25 Thread fahptv
Thanks for all the replies so far. You're right, there is state involved. My situation is this: 1. there are several different kinds of triggers (like phone, doorbell, email, SMS) 2. there are business rules about who should answer and what they should do in response (Bob vs Jane an

[ANN] Gorilla REPL v0.3.5

2015-11-25 Thread Jony Hudson
There's a new release of Gorilla REPL available on Clojars. The biggest change - which should make the lives of students of Clojure a tiny bit better - is that exceptions are now displayed with their stack traces (thanks to cider-nrepl's stacktrace middleware). There are a number of other small

Re: [ANN] Gorilla REPL v0.3.5

2015-11-25 Thread Fergal Byrne
Great to hear Jony. You wouldn't believe the diversity of projects using this for exposition and explanation, and the stack trace is going to make a big difference. Hats to you and all your contributors. -- Fergal Byrne, Brenter IT Author, Real Machine Intelligence with Clortex and NuPIC ht

Re: [ANN] Gorilla REPL v0.3.5

2015-11-25 Thread John Wiseman
> * Update to support CIDER-nrepl version 0.9.1. This is the part I'm most excited about :) Thanks, Jony! On Wed, Nov 25, 2015 at 10:43 AM, Fergal Byrne wrote: > Great to hear Jony. You wouldn't believe the diversity of projects using > this for exposition and explanation, and the stack trace

Re: Self-referential gen-class usage

2015-11-25 Thread Beau Fabry
Forgive me for resurrecting a 7 year old thread, but is this still the solution? On Thursday, June 26, 2008 at 7:56:18 AM UTC-7, Chas Emerick wrote: > > At some point, I came to need to define a generated Java class that > had methods that returned instances of the class being generated. The >

Duplicate key exception reading map that was written to a file

2015-11-25 Thread Dave Kincaid
I have something very strange going on when I try to write a map out to a file and read it back in. It's a perfectly fine hash-map with ? key/values (so it's pretty big). When I write the map out to a file using (spit "/tmp/mednotes6153968756847768349/repl-write.edn" (pr-str phrases)) and t

Re: Duplicate key exception reading map that was written to a file

2015-11-25 Thread Dave Kincaid
The number of keys in the map is 8,054,160. On Wednesday, November 25, 2015 at 10:04:11 PM UTC-6, Dave Kincaid wrote: > > I have something very strange going on when I try to write a map out to a > file and read it back in. It's a perfectly fine hash-map with ? > key/values (so it's pretty b

Re: Duplicate key exception reading map that was written to a file

2015-11-25 Thread Ghadi Shayban
While in memory before writing, are the hash codes for the "duplicate" keys the same? You can call (hash) on the keys. I'm thinking there is perhaps an issue with unicode string serialization... Are the question marks a particular character? If you can find the similar strings in memory, be

Re: Duplicate key exception reading map that was written to a file

2015-11-25 Thread Dave Kincaid
The question marks are actual question marks. I'm not sure how to find the "duplicate" keys in the map in memory. As far as I can tell there is only one "? 5" key in the in memory map. I thought maybe computing the frequencies of the hash values of the keys and looking for any with more than on

Re: Define new defn, lein uberjar succeeds to compile but lein run fails

2015-11-25 Thread Benjamin R. Haskell
It sounds like you're looking for refer-clojure: https://clojuredocs.org/clojure.core/refer-clojure E.g., for your project: (ns mw.mwm (:require [clojure.pprint :as pp] [clojure.walk :as walk]) (:refer-clojure :exclude [defn]) (:gen-class)) Tested in a fork: https://github.com/mattia

Re: Duplicate key exception reading map that was written to a file

2015-11-25 Thread Dave Kincaid
I just tried outputting the map to an Avro file and read it back in. This works fine. That tells me that there is something wrong with the way that I'm trying to write the EDN file somehow. Here is the code I used to output to Avro and read back: (def schema (avro/parse-schema {:type :map :valu

Re: Duplicate key exception reading map that was written to a file

2015-11-25 Thread Ghadi Shayban
Does the phrases value in memory exactly match the payload roundtripped through Avro? -- 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 - pleas