clojurescript 0-.0-2227

2014-05-29 Thread t x
I just upgraded to clojurescript 0.0-2227 I now get the following error. Anyone else run into this issue? ./lein pdo cljx auto, cljsbuild ao to Compiling ClojureScript. Exception in thread main java.lang.RuntimeException: No such var: deps/find-classpath-lib, compiling:(cljs/closure.clj:431:20)

emacs + assert + syntax highlighting

2014-05-23 Thread t x
Hi, In my code, I have many lines like: (assert ) (assert ) (assert ) Now, is there a way to have the entire sexp highlighted in light grey? (Rather than as normal code). The logic being assertions are meant more like comments, and when reading, I'd prefer to not see

Re: clojurescript, sourcemaps, and debugging info

2014-05-18 Thread t x
Maybe an alternative solution to your problem. On Sunday, May 18, 2014 5:06:04 AM UTC+2, t x wrote: flat namespace is ugly. Someone please please tell me there is a better solution. :-) Is there no 10-line chrome-plugin which solves this? On Fri, May 16, 2014 at 7:35 AM, t x txre

Re: clojurescript, sourcemaps, and debugging info

2014-05-17 Thread t x
flat namespace is ugly. Someone please please tell me there is a better solution. :-) Is there no 10-line chrome-plugin which solves this? On Fri, May 16, 2014 at 7:35 AM, t x txrev...@gmail.com wrote: Bah, I've reverted to a flat namespace, i.e. foo_internal.cljs, foo_public.cljs

Re: clojurescript, sourcemaps, and debugging info

2014-05-16 Thread t x
:45 PM, t x txrev...@gmail.com wrote: Hi, * background: * I have clojurescript + lein cljsbuild auto working perfectly fine. * I have source maps working (when I click on a file in Chrome, it jumps me to the corresponding *.cljs file) * problem I am facing: * I like to name my

Re: clojurescript: modifying function definitions

2014-05-15 Thread t x
Dave, Mike: Noted. Will study this. Thanks! On Wed, May 14, 2014 at 6:46 AM, Mike Haney txmikes...@gmail.com wrote: There's a library for that - https://github.com/technomancy/robert-hooke/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post

clojurescript, sourcemaps, and debugging info

2014-05-15 Thread t x
Hi, * background: * I have clojurescript + lein cljsbuild auto working perfectly fine. * I have source maps working (when I click on a file in Chrome, it jumps me to the corresponding *.cljs file) * problem I am facing: * I like to name my modules: foo/public.cljs

clojurescript: modifying function definitions

2014-05-13 Thread t x
Suppose we had the following: (defn stupid-wrapper [f args] (. js/console log args) (let [ans (f args)] (. js/console log ans) ans)) It basically logs the arguments + return value on every function call. Now, suppose I wanted to do this to _functions that already existed_ . Is

simple static analysis in cljs process

2014-05-02 Thread t x
Hi, I'm currently running cljs with :optimizations none. I would like to inject a trivial static analysis phase of my cljs code. I.e, something like: *.cljs files - call a clojure function of mine, which sees everything as sexps - standard pipeline to generate *.js files Is there

lein cljsbuild auto ; hook to copy into directory post build

2014-04-29 Thread t x
Hi, ## context: I am currently running lein cljsbuild auto It appears that each new compile _overwrites_ the old compile in place, say resources/out ## what I would prefer to happen: every time a new build is triggered, have it write to resources/tmp then, exec rm -rf

Re: lein cljsbuild auto ; hook to copy into directory post build

2014-04-29 Thread t x
Correct answer: https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj#L73 :-) On Tue, Apr 29, 2014 at 2:29 PM, t x txrev...@gmail.com wrote: Hi, ## context: I am currently running lein cljsbuild auto It appears that each new compile _overwrites_ the old compile

clojurescript sandboxed code execution

2014-04-21 Thread t x
Hi, 1) I'm writing code in Clojurescript. 2) I want to have some level of user customizibility (i.e. think elisp) 3) I want this to be sandboxed. (i.e. not full javascript) 4) How do I do this in cljs, given I don't have eval? Thanks! -- You received this message because you are

multiple browsers, live.js - repl

2014-04-15 Thread t x
Hi, Okay. I think I have finally reached the limits of live.js, and now want an interactive browser repl + being able to push portions of code (rather than reloading the entire page). I have a simple question though: * I'm developing a _distribued_ app * So I can't test it unless I

auto include a certain line in all *.cljs files

2014-04-13 Thread t x
Hi, Can I edit some user.clj/config.clj/project.clj file, so that it's as if: (:require-macros [swiss.arrows :refer (-)]) is auto included in *every* cljs file ? [I dislike the constant repetition] Thanks! -- You received this message because you are subscribed to the Google Groups

Re: auto include a certain line in all *.cljs files

2014-04-13 Thread t x
at 10:49 AM, Kevin Ilchmann Jørgensen kijm...@gmail.com wrote: Look at :injections in https://github.com/technomancy/leiningen/blob/master/sample.project.clj. Would that help you? On Sun, Apr 13, 2014 at 7:36 PM, t x txrev...@gmail.com wrote: Hi, Can I edit some user.clj/config.clj

cljs, websocket, autoreconnect

2014-04-13 Thread t x
Hi, For building robust cljs web apps, I'd like to have a uber websocket which does the following: * when disconnected, it auto reconnects * and re-sends any messages that were not received Before I hand-roll my own hacks, I was wondering -- is there any existing cljs library which

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
? (deref (promise)) The only way this can work is with a code transform like go. Perhaps someday a new version of JS will arise that presents a different solution, but until then core.async is the best you're going to get. Timothy On Tue, Apr 8, 2014 at 3:11 PM, t x txrev...@gmail.com wrote

Re: rant / cljs in cljs ? :-)

2014-04-09 Thread t x
leave them to the end of the pomodoro. On Friday, March 21, 2014 7:48:59 AM UTC+1, t x wrote: Hi, * I'm already using: :incremental true :compiler { :optimizations :none } * I'm also aware of cljs brepl However: 1) the cljs compiler is still too slow for my liking (even though

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
, 2014 at 9:39 AM, t x txrev...@gmail.com wrote: I believe https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7 suffices. However, it's currently Firefox only and no Chrome. On Tue, Apr 8, 2014 at 8:51 PM, Timothy Baldridge tbaldri...@gmail.com wrote: What is going

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
Regarding yield: Understood, thanks for clarifying my misunderstandings! -- 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 - please be patient

true lightweight threads on clojurescript?

2014-04-08 Thread t x
Hi, * I am aware of core.async. However, I don't like the fact that (go ... ) is a macro, thus forcing the ! and ! to appear in the body, and I can't do nested things like: (defn foo [chan] (let [x (! chan)] ... )) (go ... (foo ... )) * For the following, I only need it to work

Re: true lightweight threads on clojurescript?

2014-04-08 Thread t x
ill effects. On Tue, Apr 8, 2014 at 4:51 PM, t x txrev...@gmail.com wrote: Hi, * I am aware of core.async. However, I don't like the fact that (go ... ) is a macro, thus forcing the ! and ! to appear in the body, and I can't do nested things like: (defn foo [chan] (let [x

Re: true lightweight threads on clojurescript?

2014-04-08 Thread t x
...@booleanknot.com wrote: What exactly are you trying to do? Could you describe the problem you're trying to solve in more detail? - James On 8 April 2014 22:02, t x txrev...@gmail.com wrote: I'd really like to avoid callbacks. :-) If cljs had promises, it would suffice. :-) On Tue, Apr 8, 2014 at 2

hacked up erldn

2014-04-06 Thread t x
Hi, I'm announcing my first (epsilon) contribution back to the Erlang community: https://github.com/txrev319/erldn -- a slightly hacked up fork of the original erldn. The main use case is: * I'm using clojurescript on the client side. I need to use erlang on the server side. The

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread t x
The way I think about syntax is: Given: * my brain has limited processing power (measured in kilo-hertz ?) * my brain has very limited L1 cache Question: * do I want to store the operator-precedence + left/right associativity rules of Haskell operators in my brain * spend brain cycles

cljsbuild dev/release, different debug levels

2014-04-03 Thread t x
Hi, I'm trying to figure out how to do the following: Have a shared cljs/* ... For the dev build, have (debug ...) compile to (js/console.log ...) For the release build, have (debug ...) compile to (do). Basically, I want different things to happen depending on whether the build is

Re: cljsbuild dev/release, different debug levels

2014-04-03 Thread t x
what you want. https://github.com/lynaghk/cljx You'd need to set up a custom rule for it, but it seems well within the scope of the project. On Thu, Apr 3, 2014 at 8:50 AM, t x txrev...@gmail.com wrote: Hi, I'm trying to figure out how to do the following: Have a shared cljs

Re: cljsbuild dev/release, different debug levels

2014-04-03 Thread t x
The correct statement should be: I *no longer* use cljx. :-) On Thu, Apr 3, 2014 at 8:05 AM, t x txrev...@gmail.com wrote: I don't use cljx. It slows down lein cljsbuild auto. I'm using pure clojurescript. Is there a way to get the dev / release tag passed somehow? On Thu, Apr 3, 2014 at 6

Re: dependencies from github

2014-03-29 Thread t x
Ray, David, Aaron, Phil, dgrnbrg: Understood. Thanks for clarifying my misunderstandings! On Thu, Mar 27, 2014 at 10:39 AM, dgrnbrg dsg123456...@gmail.com wrote: Voom is a Lein plugin that lets you depend on a repository and pins you to a specific commit. It also provides tools manage

dependencies from github

2014-03-27 Thread t x
Hi, ## Context: * I'm using lein. * In my project.clj, I have something like: :dependencies[ [org.clojure/clojure 1.5.1] [org.clojure/clojurescript 0.0.-2173] [not-really-trusted-package version]] Now, I don't like pulling not-really-trusted-package, which can change

optimal way to generate/store/compare 256/512/1024 bytes

2014-03-23 Thread t x
Hi, In my _cljs_ code, I need to generate keys by: * randomly generating a 256/512/1024-bit object * testing that it hasn't been used before (and if it's already used, pick another random value) The only use of these ids is as keys to a map. Thus, I would like to have efficient tests

Re: rant / cljs in cljs ? :-)

2014-03-22 Thread t x
patches that make the actual cljx transformation faster. - Chas On 03/21/2014 01:23 PM, t x wrote: I'm using: lein pdo cljx auto,cljsbuild auto dev' However, maybe perhaps it's weird timing interaction between cljx and cljsbuild that's making the lag appear more than it actually is. On Fri

cljsbuild hooks + rsync/ssh

2014-03-22 Thread t x
Hi, This sounds sorta silly: I'm already running lein cljsbuild auto Now, whenver the build completes (definitely when it succeeds; I don't care what happens when it fails), I would like to trigger an rsync or ssh to copy the resources/release/*.js files to a remote machine. Is there a

Re: rant / cljs in cljs ? :-)

2014-03-22 Thread t x
as desired (e.g. surely clojurescript.test is not the last word in ClojureScript testing??). - Chas On 03/22/2014 05:26 AM, t x wrote: I stopped using cljx, and lein cljsbuild auto is amazingly fast. It does look like timing issues / how cljx/cljsbuild auto triggers work is the issue

rant / cljs in cljs ? :-)

2014-03-21 Thread t x
Hi, * I'm already using: :incremental true :compiler { :optimizations :none } * I'm also aware of cljs brepl However: 1) the cljs compiler is still too slow for my liking (even though it's not calling closure) 2) I don't like the cljs repl nearly as much as I like the clj repl Now,

Re: rant / cljs in cljs ? :-)

2014-03-21 Thread t x
that uses core.async. Timothy On Fri, Mar 21, 2014 at 12:48 AM, t x txrev...@gmail.com wrote: Hi, * I'm already using: :incremental true :compiler { :optimizations :none } * I'm also aware of cljs brepl However: 1) the cljs compiler is still too slow for my liking (even

Re: purely functional math renderer

2014-03-16 Thread t x
MathJax renders dynamically into an existing DOM node because it needs to get sizing information before it renders. This means, for instance, that you can't even render into a DOM fragment off-screen. Jony On Saturday, 15 March 2014 03:36:04 UTC, t x wrote: Hi, I'm aware of MathJax

jquery/$ in cljs

2014-03-12 Thread t x
Hi, Consider https://github.com/extend/bullet/blob/master/examples/clock/src/toppage_handler.erl#L50-L57 I want to know how to express $.bullet in cljs (when compiled with optimiztaions: advanced). I know how to use things like (js/console.log ... ) (js/MathJax ... ) However,

Re: jquery/$ in cljs

2014-03-12 Thread t x
@Timothy, James: Everything works now. Thanks! On Wed, Mar 12, 2014 at 10:38 AM, James Reeves ja...@booleanknot.com wrote: Take a look at jayq: https://github.com/ibdknox/jayq - James On 12 March 2014 17:14, t x txrev...@gmail.com wrote: Hi, Consider https://github.com/extend/bullet

Re: Help a Startup use Clojure!

2014-03-12 Thread t x
I personally recommend ClojureScript + Erlang. As for convincing your boss to use Erlang, ask him about WhatsApp. :-) On Wed, Mar 12, 2014 at 5:06 PM, Jarrod Swart jcsw...@gmail.com wrote: Alan, Thanks for your input! ClojureScript is something I have wanted to try more but it seems even

[soft/philosophical] event handers in cljs

2014-03-09 Thread t x
Hi, Before core.async, the way I did event handling in cljs was: ## approach 1 goog.events.listen(... , callback-func) After learning core.async, I read (and liked the idea of): ## approach 2 * (defn global-events (core.async/chan 1)) * shove all events on to global-events *

cljs + mathjax

2014-03-08 Thread t x
Hi, Is there any example of using cljs + mathjax together? In particular, I need to do something like: 1) cljs generates some new dom element 2) I need mathjax to re-render Does any have an example of how to do this? Thanks! -- You received this message because you are subscribed

Re: cljs + mathjax

2014-03-08 Thread t x
In particular, (js/MathJax.Hub.Queue (array Typeset js/MathJax.Hub)) is that the right call to make, or am I doing something wrong? Thanks! On Sat, Mar 8, 2014 at 6:48 AM, t x txrev...@gmail.com wrote: Hi, Is there any example of using cljs + mathjax together? In particular, I need

Re: cljs + mathjax

2014-03-08 Thread t x
Issue resolved. (This had nothing to do with cljs / javascript interop, and was purely stupidity with how I was calling MathJax). Sorry for 3 emails of spam. On Sat, Mar 8, 2014 at 7:01 AM, t x txrev...@gmail.com wrote: In particular, (js/MathJax.Hub.Queue (array Typeset js/MathJax.Hub

Re: cljs + mathjax

2014-03-08 Thread t x
at 3:57 PM, Daniel doubleagen...@gmail.com wrote: What did you end up doing differently? On Saturday, March 8, 2014 10:15:38 AM UTC-6, t x wrote: Issue resolved. (This had nothing to do with cljs / javascript interop, and was purely stupidity with how I was calling MathJax). Sorry for 3

Re: Looking for a Rich Hickey quotation

2014-03-01 Thread t x
Thus, programs must be written for people to read, and only incidentally for machines to execute. -- http://mitpress.mit.edu/sicp/front/node3.html On Sat, Mar 1, 2014 at 2:48 AM, Kashyap CK ckkash...@gmail.com wrote: Hi, In one of the talks, Rich Hickey had mentioned something to the effect -

Re: ace / codemirror in cljs

2014-03-01 Thread t x
the LightTable code? There is probably some cljs and editor in there On Saturday, 1 March 2014 17:26:18 UTC+11, t x wrote: Hi, Is there anything like http://codemirror.net/ or http://ace.c9.io/#nav=about in cljs ? The goal is not to use codemirror/ace in a cljs project. The goal

ace / codemirror in cljs

2014-02-28 Thread t x
Hi, Is there anything like http://codemirror.net/ or http://ace.c9.io/#nav=about in cljs ? The goal is not to use codemirror/ace in a cljs project. The goal is to read some interesting cljs code on how to write an editor. Thanks! -- You received this message because you are subscribed to

Re: object identity

2014-02-26 Thread t x
[start slightly insane idea] Perhaps we need the following: * a way to tag a function as _pure_ * a map with uber_weak keys + values by uber_weak, I mean the k/v pair vanishes when either the key _or_ the value is gc-ed Then, what we do here, is that every function auto-memoizes: (func

Re: object identity

2014-02-24 Thread t x
I finally have a chance to give back. :-) I hacked up a newb's half-React. It does tree diffing + dom updating, but not the virtual event handling system. I ran into this exact problem, and solved it as follows: ## problem definition: render: data - dom tree-diff: dom * dom - list of

Re: object identity

2014-02-24 Thread t x
, February 24, 2014 1:42:03 PM UTC-8, t x wrote: I finally have a chance to give back. :-) I hacked up a newb's half-React. It does tree diffing + dom updating, but not the virtual event handling system. I ran into this exact problem, and solved it as follows: ## problem definition: render: data

clojure - beam compiler

2014-02-23 Thread t x
Hi, Are there any active efforts to compile clj/cljs to Erlang/Beam ? ## Pre-emptive responses: * I'm aware of http://lfe.github.io/ . It's not what I want. After programming in Clojure, I find normal lisp ugly in comparison. I want clojure syntax. * I'm aware I will lose STM + Agents.

Re: clojure - beam compiler

2014-02-23 Thread t x
http://docs.joxa.org/en/latest/language.html looks amazing. Thanks! On Sun, Feb 23, 2014 at 1:54 AM, Michael Klishin michael.s.klis...@gmail.com wrote: 2014-02-23 13:40 GMT+04:00 t x txrev...@gmail.com: Thus, my question -- are there any active efforts to port clojure (say via cljs's

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
Hi Timothy, One paragraph summary: When a macro expands to case inside of a go-block, it appears that the _ELSE_ clause of the case is always run. (Even after a previous clause has matched.) Slightly longer summary: In these lines:

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
@Thomas: (this is completely unrelated to the actual bug) This particular code was simplified from a more complicated macro -- where for the else clause, I want to capture the original value, so it would be something like: (silly obj :dog dog-line cat cat-line) == (case (:tag

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
then, cond or condp might work? Timothy On Tue, Feb 18, 2014 at 1:40 PM, t x txrev...@gmail.com wrote: @Thomas: (this is completely unrelated to the actual bug) This particular code was simplified from a more complicated macro -- where for the else clause, I want to capture the original value

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
Looking at https://github.com/clojure/clojurescript/blob/r2156/src/clj/cljs/core.clj#L1144-L1147 , you win. :-) On Tue, Feb 18, 2014 at 1:33 PM, Michał Marczyk michal.marc...@gmail.com wrote: On 18 February 2014 22:31, Michał Marczyk michal.marc...@gmail.com wrote: Actually in ClojureScript

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
optimizable case expressions to JS switch statements would be a welcome enhancement - http://dev.clojure.org/jira/browse/CLJS-713. David On Tue, Feb 18, 2014 at 4:35 PM, t x txrev...@gmail.com wrote: Looking at https://github.com/clojure/clojurescript/blob/r2156/src/clj/cljs/core.clj#L1144

Re: weird bug with cljs.core.async + macros

2014-02-18 Thread t x
, respectively. On 19 February 2014 01:02, t x txrev...@gmail.com wrote: With apologies for potential stupidity: * (get {... } key) is an operation that is O(log n) worst case (if using Red-Black trees) or O(1) average case (hashing) * (get { ... } key) does not have integer/string limitation

hooks on namespace required/loaded

2014-02-18 Thread t x
Hi, Although solutions not involving cljx are perfectly fine, I'm using cljx -- so solutions that involves hooking into cljx are perfectly fine too. I have my own poor-man's lint / type checker (with different objectives from core.typed). I want a certain function (call it CHECKER) to be

Re: hooks on namespace required/loaded

2014-02-18 Thread t x
is loaded/required/reloaded * gets passed the namespace Thanks! On Tue, Feb 18, 2014 at 8:32 PM, t x txrev...@gmail.com wrote: Hi, Although solutions not involving cljx are perfectly fine, I'm using cljx -- so solutions that involves hooking into cljx are perfectly fine too. I have my

Re: hooks on namespace required/loaded

2014-02-18 Thread t x
/ Done spamming. On Tue, Feb 18, 2014 at 8:38 PM, t x txrev...@gmail.com wrote: As a point of clarification, read-string is not a hard requirement. Just getting the name of the namespace (and walking through the symbols + calling source on each of them to get the source code is perfeclty fine

Re: hooks on namespace required/loaded

2014-02-18 Thread t x
wouldn't recommend going crazy with it, but it should be able to do the job, at least after the alter-var-root takes effect. Out of curiosity, what kind of linting does your function do? Andy On Tue, Feb 18, 2014 at 8:41 PM, t x txrev...@gmail.com wrote: With apologies for spamming

weird bug with cljs.core.async + macros

2014-02-17 Thread t x
Hi, repo: https://github.com/txrev319/bug-report I have a really weird bug where: * (my-macro ...) == everything works * (async/go (my-macro ...)) == something weird happens A minimal failure case is documented at: https://github.com/txrev319/bug-report/blob/master/src/app.cljx

Re: (series of swap! on atom) == single swap!

2014-02-17 Thread t x
for catching this fundamental error. On Sun, Feb 16, 2014 at 11:00 PM, Jan Herich jan.her...@gmail.com wrote: Hi t x, I think, that lock-free approach an it's semantics is more in line with other Clojure reference types such as refs. It also encourages you to only use pure functions

Re: weird bug with cljs.core.async + macros

2014-02-17 Thread t x
Can anyone verify whether this bug is reproducible? On Mon, Feb 17, 2014 at 12:28 AM, t x txrev...@gmail.com wrote: Hi, repo: https://github.com/txrev319/bug-report I have a really weird bug where: * (my-macro ...) == everything works * (async/go (my-macro ...)) == something

Re: weird bug with cljs.core.async + macros

2014-02-17 Thread t x
26.0. Same behaviour that you have seen. However, I haven't looked at the code yet. Il giorno lunedì 17 febbraio 2014 20:34:22 UTC+1, t x ha scritto: Can anyone verify whether this bug is reproducible? On Mon, Feb 17, 2014 at 12:28 AM, t x txre...@gmail.com wrote: Hi, repo: https

Re: weird bug with cljs.core.async + macros

2014-02-17 Thread t x
} :dog (log with-go: woof woof) cat (log with-go: unrecognized (init) (print (str out)) without-go: woof woof with-go: woof woof with-go: unrecognized nil Cheers, Michał On 18 February 2014 01:01, t x txrev...@gmail.com wrote: Thanks for verifying! @tbaldridge: can

Re: weird bug with cljs.core.async + macros

2014-02-17 Thread t x
[ args] (doseq [arg args] (.write out (str arg)) (.write out \n))) (async/!! (async/go (silly :dog :dog (log with-go: woof woof) (log with-go: other (str out)) On Mon, Feb 17, 2014 at 5:14 PM, t x txrev...@gmail.com

Re: (series of swap! on atom) == single swap!

2014-02-16 Thread t x
natm) @natm On Sat, Feb 15, 2014 at 4:09 PM, John D. Hume duelin.mark...@gmail.com wrote: On Sat, Feb 15, 2014 at 6:04 PM, t x txrev...@gmail.com wrote: (defn what-I-want [] (with-atom some-atom assoc-in ... assoc-in ... update-in ...)) I often do

Re: (series of swap! on atom) == single swap!

2014-02-16 Thread t x
with multiple alter, so everything is safely inside a transaction. On Feb 16, 2014 2:04 PM, t x txrev...@gmail.com wrote: Hi John, Your solution is perfectly valid and optimal for the problem I described above. Unfortunately, I forgot to mention an additional constraint: sometimes I

Re: (series of swap! on atom) == single swap!

2014-02-16 Thread t x
function) and sets the atom to new value (return value from the update function) only value of the atom reference was not changed in between, if yes the compare and set is retried until ti succeeds. Dňa nedeľa, 16. februára 2014 23:35:24 UTC+1 t x napísal(-a): I believe that's the STM approach

(series of swap! on atom) == single swap!

2014-02-15 Thread t x
Hi, Consider the following block of code: ## Sample Code (ns test) (def some-atom (atom {:tag :language :name Clojure :better-than [scheme java ruby python]})) (defn demo-func [] (swap! some-atom assoc-in [:name] Clojure 1.6) (swap!

query on clojure maps / vectors

2014-02-13 Thread t x
Hi, Preemptive: :-) * I'm not looking for datomic. * I'm also not looking for sqlkorma. * An in-memory data-log might be what I'm after. Context: I'm reading: http://code.kx.com/wiki/JB:QforMortals2/tables and it struck me -- why can't I view a clojure {vector,list} of maps as

Re: query on clojure maps / vectors

2014-02-13 Thread t x
Jagoe davidja...@gmail.com wrote: Would this work for you? http://clojure.github.io/clojure/clojure.set-api.html (in particular select for your example) On 13 February 2014 17:27, t x txrev...@gmail.com wrote: Hi, Preemptive: :-) * I'm not looking for datomic. * I'm also

meta circular clojure

2014-02-11 Thread t x
Hi, With apologies for a soft question: * in SICP, the meta circular evaluator of scheme in scheme (chapter 4) is about a page * in Ansi Common Lisp, there's a lisp in lisp in about half a page * if we took Clojure, and ripped out all the JVM support (i.e. gen-class, proxy, (.javaFunc

Re: unconditional append to end

2014-02-10 Thread t x
Someone needs to make a flappy bird version of http://jafingerhut.github.io/cheatsheet-clj-1.3/cheatsheet-tiptip-cdocs-summary.html It provides a description of the function, you type in the function name. :-) On Mon, Feb 10, 2014 at 8:22 AM, Alan Thompson thompson2...@gmail.com wrote: Thank

cljs, binding, async/go

2014-02-09 Thread t x
Hi, ## Consider this block of code: (defn init [] ;; called from window.onload (def ^:dynamic *dvar*) (binding [*dvar* 20] (. js/console log (str from main: *dvar*: *dvar*)) (async/go (. js/console log (str from go : *dvar*: *dvar*) ## In Chrome, I get back:

Re: cljs, binding, async/go

2014-02-09 Thread t x
work with bindings on CLJ, CLJs biding support is different enough that it doesn't currently work with gos. Timothy On Sun, Feb 9, 2014 at 7:33 AM, t x txrev...@gmail.com wrote: Hi, ## Consider this block of code: (defn init [] ;; called from window.onload (def ^:dynamic *dvar

Re: Alternative - macro for threading sequences?

2014-02-08 Thread t x
-style syntax for Clojure? On Friday, February 7, 2014 9:14:27 AM UTC-6, t x wrote: I think (- things (map wrangle) (map pacify) (filter effable) (map #(aggravate % :bees :sharks)) (reduce mapinate {}) is optimal for the following reason: If you're doing map and map

pdf.js

2014-02-08 Thread t x
Hi, I've looked at the first few pages of Google results for pdf.js cljs and found nothing. Before I start hacking on my own pdf.js bindings, I wanted to ask -- does anyone have cljs bindings to pdf.js ? Thanks! -- You received this message because you are subscribed to the Google Groups

Re: Alternative - macro for threading sequences?

2014-02-07 Thread t x
I think (- things (map wrangle) (map pacify) (filter effable) (map #(aggravate % :bees :sharks)) (reduce mapinate {}) is optimal for the following reason: If you're doing map and map alone, i.e. (- things (map f1) (map f2) (map f3) (map f4)) then you can do:

unconditional append to end

2014-02-07 Thread t x
Consider the following: (cons 1 '(2 3 4)) == (1 2 3 4) (cons 1 [2 3 4]) == (1 2 3 4) (conj '(a b c) 1) == (1 a b c) (conj '[a b c] 1) == [a b c 1] Now, I would like something that _always_ * appends to the end cons is almost what I want, except it always

how does source work?

2014-02-04 Thread t x
Hi, user (source source) (defmacro source Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath. Example: (source filter) [n] `(println (or (source-fn '~n) (str

Re: how does source work?

2014-02-04 Thread t x
)))] (read (PushbackReader. pbr)) (str text))) Cheers, Michał On 4 February 2014 21:34, t x txrev...@gmail.com wrote: Hi, user (source source) (defmacro source Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var

cljs sound synthesis

2014-02-03 Thread t x
Hi, Are there any tutorials for doing sound synthesis in _cljs_, using latest firefox/chrome features? I'm not looking for http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/ .. which wraps Overtone . I'm looking for something where the actual synthesis is done in js land as

Re: soft question: should remote channels appear like local channels

2014-02-01 Thread t x
get restarted, jvms crash, etc. Never assume that a remote channel actually exist when writing to it, unless you have some really solid error recovery (which probably is more work than using traditional approaches). Just my 2 cents. /thomas On Friday, January 31, 2014 6:43:14 AM UTC+1, t x

Re: soft question: should remote channels appear like local channels

2014-01-31 Thread t x
when writing to it, unless you have some really solid error recovery (which probably is more work than using traditional approaches). Just my 2 cents. /thomas On Friday, January 31, 2014 6:43:14 AM UTC+1, t x wrote: Hi, With apologies for a soft question: This question is NOT: I'm

(async/go (async/chan)) gc ?

2014-01-30 Thread t x
Hi, Consider this block of code: (async/go (async/chan)) This creates a go-thread and a go-chan. The go-thread is linked from the list of blocked go-threads. The go-chan is linked from the go-thread. Thus, did we just create a go-thread and a go-chan which is NOT gc-ed at all?

Re: (async/go (async/chan)) gc ?

2014-01-30 Thread t x
by the caller of this code, both channels are also GC'd Timothy On Thu, Jan 30, 2014 at 11:24 AM, t x txrev...@gmail.com wrote: Hi, Consider this block of code: (async/go (async/chan)) This creates a go-thread and a go-chan. The go-thread is linked from the list of blocked go

Re: (async/go (async/chan)) gc ?

2014-01-30 Thread t x
Can you please tell me if (1) all above statements are correct or (2) correct the wrong ones in place? Thanks! On Thu, Jan 30, 2014 at 11:06 AM, t x txrev...@gmail.com wrote: The key thing to remember in all questions of core.async GC is that there is no global blocked gos queue. Instead

Re: (async/go (async/chan)) gc ?

2014-01-30 Thread t x
Great! Thanks for verifying. On Thu, Jan 30, 2014 at 11:46 AM, Jozef Wagner jozef.wag...@gmail.com wrote: Seems OK. Note that code inside go blocks is transformed into state machine 'object' immediatelly, not waiting for hitting !, as go is a macro. On Thu, Jan 30, 2014 at 8:36 PM, t x txrev

soft question: should remote channels appear like local channels

2014-01-30 Thread t x
Hi, With apologies for a soft question: This question is NOT: I'm in a situation where client = cljs, server = clj, and I want to figure out how to setup a core.async channel, using pr-str and edn/read-string, where I can seamlessly push data back and forth between client and server. This

core.typed

2014-01-28 Thread t x
## Background I'm using [org.clojure/core.typed 0.2.25] ## Question: Which is the following is true: (1) my code is correct / should work, and therefore there is something with my setup (2) my code is wrong (and please point out how I can fix it) ## Code (ns test #+clj (:require

Re: core.typed

2014-01-28 Thread t x
to what core.typed depends on? Thanks, Ambrose On Tue, Jan 28, 2014 at 5:38 PM, t x txrev...@gmail.com wrote: ## Background I'm using [org.clojure/core.typed 0.2.25] ## Question: Which is the following is true: (1) my code is correct / should work, and therefore

mimic erlang in core.async

2014-01-28 Thread t x
Hi, With apologies for a vague question: Is there a library built on top of core.async that tries to mimic erlang-like processes? The main features I'm looking for are: * each channel has a single go-thread attached to it * ! sends messages of the form {:tag :message

Re: mimic erlang in core.async

2014-01-28 Thread t x
/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj On Tuesday, January 28, 2014 6:43:19 PM UTC-5, t x wrote: Hi, With apologies for a vague question: Is there a library built on top of core.async that tries to mimic erlang-like processes? The main

Re: mimic erlang in core.async

2014-01-28 Thread t x
it is cool :) On Tuesday, January 28, 2014 6:54:22 PM UTC-5, t x wrote: Hi John, This is great. I really like minimal examples to hack on / play with. Thanks! On Tue, Jan 28, 2014 at 3:46 PM, john walker john.lo...@gmail.com wrote: This doesn't answer your question, but you might find

Re: clojure.edn/read-string exceptions = nil

2014-01-26 Thread t x
a better / more elegant solution? On Thu, Jan 16, 2014 at 10:17 AM, t x txrev...@gmail.com wrote: After looking at edn/read-string and realizing I would have to modify Java code, I have decided that modifying the sender in clojure land isn't so bad after all. On Thu, Jan 16, 2014 at 9:41 AM

async/close! called when channel is gc-ed ?

2014-01-26 Thread t x
## Context: I'm doing some communication across cljs/clj with core.async ## Problem: I want a certain function called whenever: (a) the first time the channel is closed (b) when the channel is gc-ed (if not previously closed) (a) is rather easy: I define my own channel, wrapped

  1   2   >