Re: core.async question - canceling thread

2014-01-22 Thread Stephen Cagle
I took a stab at it in pure core.async, unfortunately, it does not work; I would be curious if anyone could explain why. (use '[clojure.core.async :only [timeout ! go !! alts!]]) (defn fib [n tmout] (let [res (go (if ( n 2) n (let [r1 (! (fib (- n 1)

Re: cljx repetition

2014-01-20 Thread Stephen Cagle
I am not actually familiar with this form, don't know what [types] actually does: (:require [macros.arrow :refer (=)] [types]) I don't think you need to be requiring the cljs macros twice as you seem to be doing in both forms. Macros are in general somewhat of a sore spot in

Re: Am I using core.async/go in an un-clojurish ?

2014-01-13 Thread Stephen Cagle
Did you mean *(go (loop [ ... ]* * (case ...* *.. (func arg1 foo1)* *.. (func arg2 foo2)* *.. (func arg3 foo3)))* *where (defn func [ ... ] (.. ! .. ))* , as func (not foo) is the thing in function position? Ignoring that, and working in a general sense: I

Re: Am I using core.async/go in an un-clojurish ?

2014-01-13 Thread Stephen Cagle
I just want to re-iterate that there are many (some are probably better) ways to do this, but using what I suggested above it would be: (defn foo [] (async/go hi)) (defn test [] (println (async/! (foo (defn test [] (let [c (async/chan 10)] (async/go (async/! c (async/!

Re: Am I using core.async/go in an un-clojurish ?

2014-01-13 Thread Stephen Cagle
And already, I see that the first one should have been (defn test [] (async/go (println (async/! (foo) Boy I wish you could edit this post after the fact. On Monday, January 13, 2014 3:32:39 PM UTC-8, Stephen Cagle wrote: I just want to re-iterate that there are many (some

Re: Good resources on dataflow based programming

2013-12-24 Thread Stephen Cagle
But be warned that the author of those is very opinionated and feels that he is writing about the one true way ;-) On 23 December 2013 19:32, Stephen Cagle sam...@gmail.com javascript:wrote: Cross posted from pedestal-users group, as many people who are not using pedestal may still

Re: Good resources on dataflow based programming

2013-12-24 Thread Stephen Cagle
map to another path are possibly separate from the schema that specifies which dataflow function is associated with which path. On Tuesday, December 24, 2013 1:36:16 PM UTC-8, Stephen Cagle wrote: Thank you. I only read the last two articles so far; some notes. http://my.opera.com/Vorlath/blog

Re: Good resources on dataflow based programming

2013-12-24 Thread Stephen Cagle
how evident optimizations might be when you use a dataflow processing model. On Tuesday, December 24, 2013 3:50:43 PM UTC-8, Stephen Cagle wrote: One thing that I am seeing on a re-read is that I conflated the notion of the data flow function and the paths. I was sort of thinking that the data

Good resources on dataflow based programming

2013-12-23 Thread Stephen Cagle
Cross posted from pedestal-users group, as many people who are not using pedestal may still know about dataflow, terms like effect are used in the context of pedestal Pedestal seems strongly based on dataflow based programming. The gigantic tutorial just sort of jumps in on it. Based on my

(core.async/go nil) behavior?

2013-12-14 Thread Stephen Cagle
core.async discourages you from placing nil in a channel, as nil is only taken when the channel has been closed. However, if I create a go block with a body that evaluates to nil, core.async will return a channel that contains nil. This is a nil as a take! value, not a nil to indicate the

Re: (core.async/go nil) behavior?

2013-12-14 Thread Stephen Cagle
Huh, that is pretty clever. You're right, I just assumed I was seeing the body result. That is a pretty clever way to fix the issue. nil just closes the returned channel, causing future takes on it to return nil. Neat. On Saturday, December 14, 2013 11:18:07 AM UTC-8, Stephen Cagle wrote

Re: ANN: double-check, a Clojure/ClojureScript-portable fork of simple-check

2013-11-21 Thread Stephen Cagle
Did you try out test.generative? If so, how does simple check contrast to test.generative? On Thursday, November 21, 2013 11:31:19 AM UTC-8, Chas Emerick wrote: simple-check is planning on remaining Clojure-only, at least for the foreseeable future. This non-fork fork is the best

Re: I could use some help getting nrepl-ritz working

2013-10-03 Thread Stephen Cagle
. On Monday, September 30, 2013 11:07:56 PM UTC-7, Stephen Cagle wrote: Basically, I get a error when I try to follow the directions at http://ianeslick.com/2013/05/17/clojure-debugging-13-emacs-nrepl-and-ritz/ . In my init.el, I get a error when evaluating: *(require 'nrepl-ritz) ;;after

I could use some help getting nrepl-ritz working

2013-10-01 Thread Stephen Cagle
Basically, I get a error when I try to follow the directions at http://ianeslick.com/2013/05/17/clojure-debugging-13-emacs-nrepl-and-ritz/ . In my init.el, I get a error when evaluating: *(require 'nrepl-ritz) ;;after (require 'nrepl)* the error is: *Debugger entered--Lisp error:

print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
* (ns com.samedhi.app.test.behavior-test (:require [clojure.test.generative :as generative]) (:use [com.samedhi.quizry.app.test.defspec :only [defspec]] )) * *... ommited content ...* * * *(def ^:dynamic *view* nil)* * * *(binding [*view* (atom

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
ugh, I also see that for the last example, where I just removed the binding I said all 4 threads, I should have said all N threads. (There are 4 in my case, but that is just on my machine) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
-on-quiz-view* * b/quiz-view* * [^{:tag `random-loc} loc* * ^{:tag (clojure.core/constantly :ignored)} key* * ^{:tag `view} value])* On Friday, September 20, 2013 12:01:41 AM UTC-7, Stephen Cagle wrote: * (ns com.samedhi.app.test.behavior-test (:require [clojure.test.generative

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
is being shared among all 4 threads, which isn't really what I wanted. Furthermore, without some additional synchronization, I am pretty sure that I could have some invalid state. On Friday, September 20, 2013 12:01:41 AM UTC-7, Stephen Cagle wrote: * (ns com.samedhi.app.test.behavior-test

Re: logback.xml being picked up twice in project (how do I surpess the inheritted projects logback.xml)?

2013-08-17 Thread Stephen Cagle
with that, but it seems to work well enough for me. On Thursday, August 15, 2013 11:39:19 PM UTC-7, Laurent PETIT wrote: 2013/8/16 Stephen Cagle sam...@gmail.com javascript:: Sorry if I am being dense, just want to make sure I understand what you are saying... So, I was including

logback.xml being picked up twice in project (how do I surpess the inheritted projects logback.xml)?

2013-08-15 Thread Stephen Cagle
I have project 'base' that has a logback.xml file and project 'derive' that also has a logback.xml file. Project 'derive' has a dependency on 'base'. When I lein trampoline repl on project 'derive', I get the following warning. 15:34:30,066 |-INFO in

Re: logback.xml being picked up twice in project (how do I surpess the inheritted projects logback.xml)?

2013-08-15 Thread Stephen Cagle
, best loaded from the file system (possibly through -D). It doesn't matter what settings base has for logging, derive should set all logging parameters. jason On Thursday, August 15, 2013 3:51:04 PM UTC-7, Stephen Cagle wrote: I have project 'base' that has a logback.xml file and project

Re: logback.xml being picked up twice in project (how do I surpess the inheritted projects logback.xml)?

2013-08-15 Thread Stephen Cagle
environment-specific logging configured in that environment. jason On Thu, Aug 15, 2013 at 5:06 PM, Stephen Cagle sam...@gmail.comjavascript: wrote: I don't know what -D is, other than a one eyed laughing face. :D Is there some sort of standard for this? Do people simply write

Can't seem to import namespaces of test.generative

2013-07-27 Thread Stephen Cagle
So, I was having trouble requiring some namespaces in test.generative . I have the following project.clj (defproject gen 0.1.0-SNAPSHOT :description FIXME: write description :url http://example.com/FIXME; :license {:name Eclipse Public License :url

Re: How do I suppress warnings in a Clojurescript compilation?

2012-05-30 Thread Stephen Cagle
/variable names that are meant to be publicly used. As an example, here's the externs file for jquery: https://github.com/ibdknox/jayq/blob/master/resources/externs/jquery.js . On Wednesday, May 30, 2012 12:15:35 PM UTC-7, Stephen Cagle wrote: When I compile in advanced mode, I get thousands

How do I use a bit of clojure code in clojurescript?

2012-05-28 Thread Stephen Cagle
I have a file (tree.clj) that I have written. All is well with that file. I want to use this file from both clojure and clojurescript. I can see that this works fine on the clojure side of things, as I type (at the repl) (use 'rpc.tree) and get back nil, I can then go ahead and do whatever