[ANN] JSON tagged literals library (worse-is-better EDN)

2013-06-27 Thread Kevin Lynagh
I just open sourced a JavaScript library that may be of interest to Clojurists: https://github.com/lynaghk/json-tagged-literals The library lets you serialize/deserialize custom tags in JSON, similar to EDN. We initially used EDN for some projects, but the deserialization performance of th

Re: Two Way DOM binding in clojurescript

2013-08-21 Thread Kevin Lynagh
I just posted a 3500 word blog post on this topic: http://keminglabs.com/blog/cljs-app-designs/ which outlines the relative merits and tradeoffs of using explicit DOM references with callbacks vs. Angular's dirty-checking model and interop with the library from ClojureScript. cheers, Kevi

[ANN] zmq-async: A thread safe core.async wrapper for ZeroMQ

2013-08-26 Thread Kevin Lynagh
Hi everyone, I wrote a core.async-based wrapper for ZeroMQ: https://github.com/lynaghk/zmq-async ZeroMQ is a message-oriented socket library with bindings to lots of languages and support for a variety of communication styles (request/reply, publish/subscribe, in-process pair sockets, push/pul

[ANN] jetty7-websockets-async: A core.async wrapper for websocket client/server communications

2013-08-26 Thread Kevin Lynagh
Hi everyone, I wrote a core.async wrapper for Jetty 7 websockets: https://github.com/lynaghk/jetty7-websockets-async On past projects I've used http-kit, Aleph/Netty, and Jetty 9 for websockets. However, I recently discovered that good 'ol Jetty 7 (of ring-jetty-adapter fame) can act both as a

Re: Clojure statechart / hierarchical FSM implementation

2014-09-07 Thread Kevin Lynagh
I've been working on an implementation of Harel's statecharts based on his original paper (http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf) and Horrocks' excellent "Constructing the User Interface with Statecharts" (http://www.amazon.com/Constructing-User-Interface-Statec

Re: CLJX & CLJS problem

2014-02-13 Thread Kevin Lynagh
It sounds like you have everything setup correctly---nothing stands out to me as being a problem. I can't tell for sure without the project source code, though. Take a look at Prismatic Schema's project.clj: https://github.com/Prismatic/schema/blob/master/project.clj they have the same use

Re: [ANN] Javelin, spreadsheet-like FRP for ClojureScript

2013-02-21 Thread Kevin Lynagh
For those interested in comparing Javelin with other ClojureScript approaches to building rich applications on the clientside, there are several implementations of the infamous todo list applications here: https://github.com/lynaghk/todoFRP/tree/master/todo And, of course, if you're missing

ClojureScript macro import

2011-08-07 Thread Kevin Lynagh
Is it possible to use macros within ClojureScript without having to fully reference them? Right now I have (ns hack.cljs.hello (:require-macros [d3-macros :as d3m])) and have to use the form (d3m/my-macro ...) Ideally I could just say (my-macro ...) Is this possible? Bonus

Re: ClojureScript macro import

2011-08-09 Thread Kevin Lynagh
Okay, that's the impression I got from poking around but I just wanted to make sure I wasn't missing anything. Thanks Stuart. On Aug 9, 1:46 pm, Stuart Sierra wrote: > It's not currently possible to refer macros without a namespace prefix: > ClojureScript does not have `refer` or `use`. There hav

Passing ClojureScript objects to JavaScript functions

2011-08-10 Thread Kevin Lynagh
What is the best way to pass Clojure vectors and maps to JavaScript functions? Currently when I need to call a JavaScript function that takes an array I do something like (js/my_js_fn (.array (vector 1 2 3))) and I pass Clojure maps like (js/my_js_fn (.strobj (hash-map "a" 1 "b" 2))) T

Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Kevin Lynagh
er the details but I know that doing > anything automatically is out. I think it will either be a macro or a > reader-macro and will only create js objects out of literals or > expressions which can be evaluated to a literal. > > Brenton > > On Aug 10, 9:04 pm, Kevin Lynagh wrot

Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Kevin Lynagh
.) On Aug 11, 2:14 pm, Ken Wesson wrote: > On Thu, Aug 11, 2011 at 5:02 PM, Kevin Lynagh wrote: > > Alright, thanks for the info. Do you know why an automatic solution is > > out? > > > I'm trying to use D3 from ClojureScript, but right now all of the > &g

Access `this` in ClojureScript

2011-08-16 Thread Kevin Lynagh
Is there a recommended way to access `this` within ClojureScript aside from (js* "this")? I'm using jQuery event handlers, which set `this` to originating DOM element, and I'd like to get my hands on them. In other news, I'm liking ClojureScript more and more every day = ) -- You received this m

Re: Another ClojureScript app in the wild

2011-08-17 Thread Kevin Lynagh
Hi Matthew, Have you tried console.log() as (.log js/console "is anybody out there?") That works for me currently. When I first started in ClojureScript I had trouble calling console.log() because it was a native code function and it couldn't be called with JavaScript's .call(this, args) for

Re: clojurescript why: (def ... is failing whereas (let ... succeeds

2012-02-11 Thread Kevin Lynagh
How do you know the let is working? Is the run-draganddrop function being called by something outside of that source file? It'll have the same problem as the def, you just won't see it when you load the file because the function isn't called. I looked into goog.jar and goog.fx.DragDrop is an entir

Clojure/West rock climbing unsession

2012-03-09 Thread Kevin Lynagh
Keming Labs and Upwind Solutions are sponsoring a trip to the local rock gym the Friday of Clojure/West, immediately after Richard Gabriel's talk. No rock climbing experience required: we're going to be bouldering, i.e., without ropes, not very high up. If you would like to come, RSVP with me via e

Re: GSOC : Constraint based UI layout

2012-04-07 Thread Kevin Lynagh
il 6, 2012 9:48:47 AM UTC-7, SHIVAM HANDA wrote: > > Hi everyone, > > > I am Shivam Handa, a sophomore at IIT (Indian Institute of > > technology), Delhi majoring Computer Science and Engineering. I am > > intending to work on Constraint based UI layout as a GSOC project

Re: Supporting platform specific code

2012-04-14 Thread Kevin Lynagh
I have no idea what, if anything, Clojure the language(s) *should* do about this issue, but I can explain the reasoning behind CLJX. CLJX uses the reader to statically analyze toplevel forms in a file and generate new ones according to declarative rewrite rules. The motivating use case was to make

Re: Converting clojure code to clojurescript

2012-04-19 Thread Kevin Lynagh
Mark, There's a format-like function in the Closure library. Add to your namespace (:require [goog.string :as gstring] [goog.string.format :as gformat]) and call it like (gstring/format "%02.0f" (inc 8)) ;;or whatever. On Apr 19, 4:46 pm, Evan Mezeske wrote: > Is the 16 seconds fi

[ANN] C2: Clojure/ClojureScript data visualization

2012-05-11 Thread Kevin Lynagh
Announcing C2, a data visualization library inspired by D3.js C2 is not a charting library; there are no plotting functions like "scatterplot" or "piechart" . Instead, C2 is a collection of scales, map projections, and component templates (e.g., axes) that you can compose to build custom data graph

Re: ClojureScript: How to call console.log with variable args?

2012-05-20 Thread Kevin Lynagh
Moritz, One thing that I found helpful was to define log as a macro so that it'll be inlined in the JavaScript. That way Chrome will give you the correct line numbers (for the compiled JS, anyway) when you print things out to the console. On May 20, 11:50 am, David Nolen wrote: > Hmm for some

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

Re: CRUD application backed only by immutable facts

2012-06-05 Thread Kevin Lynagh
f query results, or indexed data and maintain > it, while still being > purely functional. (For example by attaching those results as meta > data to the data structure, and > defining your own assoc-like functions that maintain a consistency of > the meta-dataed query results) >

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-13 Thread Kevin Lynagh
Jacobo, Using JavaScript from ClojureScript is very straightforward. There are a few points where interop is awkward, but that wasn't the main reason I wrote a new library (in Clojure). There were two primary motivations for that. 1) We needed a visualization library that would work on the serv

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-13 Thread Kevin Lynagh
> > As to your first point and only to clarify, had you made it a wrapper for > D3 and in a node.js application, there would still be no problem in using > it server-side, am I right? > Unfortunately, no---D3 requires a full DOM. Node.js is just the JavaScript engine. There are some fake DOM i

[ANN] C2 v0.2.0: now with cljs data binding

2012-06-27 Thread Kevin Lynagh
This release contains backwards-incompatible changes in the both the API and philosophy. The primary change is that the imperative `unify!` function has been removed in favor of a `unify` datatype that represents the same idea: "these children should match up with this template function run acr

Re: [ANN] C2 v0.2.0: now with cljs data binding

2012-06-27 Thread Kevin Lynagh
Of course, you may want a link to the library itself: https://github.com/lynaghk/c2 As always, to use from Clojure/ClojureScript just add this to your `project.clj`: [com.keminglabs/c2 "0.2.0"] -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: [ANN] C2 v0.2.0: now with cljs data binding

2012-06-28 Thread Kevin Lynagh
Thanks Las, the page is now updated with the latest version and additional description. -- 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 - ple

Re: Packaging ClojureScript libraries for use with Leiningen

2012-10-12 Thread Kevin Lynagh
If your downstream users are using the "lein-cljsbuild" plugin, note that it will automatically pick up externs and JavaScript libs within your JARs if you put them under /closure-js/libs/your-project/some-js-lib.js /clojure-js/externs/your-project/externs.js (see https://github.com/eme

D3 JavaScript data visualization in ClojureScript

2011-08-25 Thread Kevin Lynagh
We've been experimenting with ClojureScript and D3, a JavaScript DOM- manipulation with an emphasis on data visualization, and we just put our work on the Github: https://github.com/lynaghk/cljs-d3/ Basically, this is a façade that proxies the native D3 JavaScript functions so that you don't

Re: D3 JavaScript data visualization in ClojureScript

2011-08-25 Thread Kevin Lynagh
44 pm, Chris Granger wrote: > Very cool! I was actually implemented a little visualization lib > inspired by D3 directly in cljs. I'll clean it up and push it > tohttp://github.com/ibdknox/pinottonight. > > D3 is awesome, so I'm excited to see stuff like this. :) >

ClojureScript can't call JavaScript functions relying on `this`

2011-08-28 Thread Kevin Lynagh
I am having trouble using ClojureScript to call JavaScript functions that exploit prototype injection. If I'm reading `defmethod :emit invoke` correctly, https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/compiler.clj#L513 ClojureScript always seems to compile f(x) JavaScript

Re: ClojureScript can't call JavaScript functions relying on `this`

2011-08-29 Thread Kevin Lynagh
On Aug 29, 6:24 am, Chouser wrote: > On Sun, Aug 28, 2011 at 9:22 PM, Kevin Lynagh wrote: > > I am having trouble using ClojureScript to call JavaScript functions > > that exploit prototype injection. > > If I'm reading `defmethod :emit invoke` correctly, > > >

Re: clojure : collaborative learning ...

2011-09-26 Thread Kevin Lynagh
Are these two related? https://github.com/jandot/bioclojure https://github.com/jayunit100/BioClojure What exactly are you trying to make---a set of libraries or starter- kit for Incanter on bioinformatics problems? I've found it much easier to write code towards solving a concrete probl

Re: : Breaking change coming WRT object property access syntax

2011-10-14 Thread Kevin Lynagh
I agree with you on making breaking changes sooner rather than later. This one seems fine to me; I execute no-arg functions on JavaScript objects more than I directly refer to them, so it'll be nice to not have to write (. obj (m)) anymore. On Oct 14, 12:44 pm, Fogus wrote: > The tickethttp://dev

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-26 Thread Kevin Lynagh
ty: D3 and ClojureScript: Data visualization on the web 20 minute intro, 40+ minutes hacking Host: Kevin Lynagh, ke...@keminglabs.com Declarative DOM manipulation for interactive statistical graphics. Working examples using the D3 JavaScript library from ClojureScript: http://keminglabs.com/clj

Re: How to use *command-line-args* ?

2011-12-22 Thread Kevin Lynagh
If you need parsing that is any more complicated, check out https://github.com/clojure/tools.cli which handles flags, arguments, and generating --help banners. On Dec 21, 7:52 pm, Antonio Recio wrote: > Solved: > (read-write-image (nth *command-line-args* 0) (nth *command-line-args* 1)) -

Re: LCUG: 17th January 2012, Malcolm Sparks - Reflections on a real-world Clojure application

2012-01-04 Thread Kevin Lynagh
It's a bit short notice for me to take a holiday to London =) Any chance the talk will be filmed and posted online? On Jan 4, 4:28 am, Kushal Pisavadia wrote: > Happy New Year all! > > The London Clojure User Group are kicking things off with a talk from > Malcolm Sparks this month, titled: Refle

Re: Libraries for ClojureScript.

2012-01-16 Thread Kevin Lynagh
Manoj, I wrote a ClojureScript wrapper around the D3 JavaScript library, https://github.com/lynaghk/cljs-d3 and took some liberties with the D3 API to make it more concise and otherwise Clojure-like. For instance, you set attributes in D3 like d3_selection .attr("x", 5) .att