Re: wally: a alternative way to discover functions

2013-09-09 Thread Islon Scherer
Florian: I filter out all functions that end with ! but I can't know for sure which functions have side effects. On Sunday, September 8, 2013 7:24:48 AM UTC+2, Florian Over wrote: > > Hi, > you could check for io! to find forms with side-effect, but i think it is > seldom used. > Florian > > htt

Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
Hey all, Relatively new to Clojure, and I'm wondering if there is a better/simpler way to handle what I'm doing. I'm working with the Elastisch library for interacting with ElasticSearch, and it has the following function: http://reference.clojureelasticsearch.info/clojurewerkz.elastisch.rest.d

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Ulises
If you're not planning on changing the value of your defined index, you can always use partial, e.g.: (def search (partial es/search es-index)) On 9 September 2013 09:42, Mark Mandel wrote: > Hey all, > > Relatively new to Clojure, and I'm wondering if there is a better/simpler > way to handle w

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Montag, 9. September 2013 10:42:57 UTC+2 schrieb Mark Mandel: > > > (search index mapping-type & {:as options}) > > > You don't have to use a map in the destructuring. (defn search "Docstring" [mapping-type & options] (apply esd/search es-index mapping-type options)) Kind regards Me

Re: Putting in alts! - haven't seen it used

2013-09-09 Thread Cedric Greevey
It sounds possibly useful for a form of "load balancing". You have a producer put onto any of several channels, each with a consumer. If some consumers are backlogged the put will go to one that isn't backlogged, instead of blocking, if there's a consumer available. For a CPU-bound task where the c

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Alex Fowler
I would also add that in case, if you *need* to destructure the `options` map for some reason, like: `(defn search "Docstring" [mapping-type & {:keys [option-1 option-2] :as options}] (do-smth-with-option-1 ...) (apply esd/search es-index mapping-type options))` then you can use `mapply`

Re: Clojure and freelancing

2013-09-09 Thread Alex Fowler
As for your question, the answer is: absolutely suitable. From my personal experience, http://www.luminusweb.net/ gives a good start. People say that Pedestal is gonna be great too, but I did not use it yet. понедельник, 9 сентября 2013 г., 0:31:13 UTC+4 пользователь Mateusz Dobek написал: > >

Re: new ClojureDocs experiment

2013-09-09 Thread Alex Fowler
That's really cool! Was always wondering if there's gone be something like that ever.. Gonna be visiting often! Wish also that it'd be near clojuredocs in search results if you google like "clojure parse", but that'a a different effort, I suppose.. keep up! воскресенье, 8 сентября 2013 г., 12:0

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Montag, 9. September 2013 12:31:30 UTC+2 schrieb Alex Fowler: > > I would also add that in case, if you *need* to destructure the `options` > map for some reason, like: > > `(defn search > "Docstring" > [mapping-type & {:keys [option-1 option-2] :as options}] > (do-smth-with-option-1

How to pass clojure.core/read-str reader-forms to clojure.tools.reader.edn/read-str?

2013-09-09 Thread Joachim De Beule
Hi List, As documented at http://clojure.org/reader, defining a record with defrecord also installs a reader form, e.g.: (ns test) (defrecord X [a b]) (read-string "#test.X{:a :foo, :b :bar}) => test.X{:a :foo, :b :bar} However, the record reader form does not seem to be visible to clojure.too

Re: How to pass clojure.core/read-str reader-forms to clojure.tools.reader.edn/read-str?

2013-09-09 Thread Nicola Mometto
Hi, The EDN reader (both clojure.tools.reader.edn and clojure.edn) don't read record/type literals by design. You need to use the clojure reader for that or read them as tagged literals. Joachim De Beule writes: > Hi List, > > As documented at http://clojure.org/reader, defining a record with >

Re: How to pass clojure.core/read-str reader-forms to clojure.tools.reader.edn/read-str?

2013-09-09 Thread Meikel Brandmeyer (kotarak)
Hi, Am Montag, 9. September 2013 14:21:12 UTC+2 schrieb Joachim De Beule: > > So my questions are: > > 1) Is it really required that any non-standard reader-forms are passed to > clojure.tools.reader.edn/read-str > (via the :readers option)? and > > 2) If so, how do I get to the reader-forms of

Re: Putting in alts! - haven't seen it used

2013-09-09 Thread Timothy Baldridge
Or just have multiple takers from the same channel, here's the code I normally use: (def c (let [c (chan 4)] (dotimes [x 4] (go (loop [] (when-let [v (! c "data") With a large enough queue size, you'd get all the benefits you mentioned (the pr

Re: How to pass clojure.core/read-str reader-forms to clojure.tools.reader.edn/read-str?

2013-09-09 Thread Joachim De Beule
Dear Nicola, Meikel, Thanks for the quick replies! But is there a way to get at all reader forms recognized by clojure.core/read-string automatically, so that I don't have to do the bookkeeping of readers myself whenever I define a novel record etc? Of course, I could define my own 'defrecord-a

Re: How to pass clojure.core/read-str reader-forms to clojure.tools.reader.edn/read-str?

2013-09-09 Thread Nicola Mometto
You could use the :default option of the edn-reader e.g (import 'clojure.lang.Reflector) (defn- read-extended-ctor [class map] (Reflector/invokeStaticMethod (Class/forName (name class)) "create" (object-array [map]))) (defrecord x [a b]) (edn/read-string {:defau

Re: Putting in alts! - haven't seen it used

2013-09-09 Thread Philip Potter
I can suggest one, though I haven't used it for real so can't speak for all the design tradeoffs: (alts! [[out val] (timeout N)]) will attempt to write to a consumer, but if the consumer is swamped, will drop the message on the floor and move on. (I can imagine rewriting this using alt! so that i

Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread Ron Toland
At Rewryte, we use Rails for the web frontend and Clojure for the data processing backend for exactly the reasons you described. We use RabbitMQ to communicate between the two. This maintains separation between the two apps (no JRuby required), and lets us scale them both independently, while t

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Julien Eluard
Hi David, that is really nice! Speedup during incremental build is definitively the one thing that would improve my ClojureScript dev workflow. I gave this build a try with lein-cljsbuild and got some unexpected WARNINGS. What I am doing: * lein cljsbuild once => everything is fine * change som

Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
Hello! With this letter I would like to receive an answer from somebody from the development team (if anyone else has something to say, you're surely welcome :) ). I am working for a big multimedia company and recently I have been considering moving to Clojure as the main language of developme

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread albert cortez
I'm getting the same long list of warnings as Julien -- -- 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 with your first

Re: [ClojureScript] ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Tim Visher
On Sun, Sep 8, 2013 at 7:42 PM, David Nolen wrote: > ClojureScript, the Clojure compiler that emits JavaScript source code. > > README and source code: https://github.com/clojure/clojurescript > > New release version: 0.0-1877 > > Leiningen dependency information: > > [org.clojure/clojurescrip

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread David Nolen
Are you trying that with an existing project that may have a stale target directory lying around? If you can reproduce this issue after a `lein cljsbuild clean` then yes please open a ticket with a minimal project that exhibits the issue. Thanks! David On Mon, Sep 9, 2013 at 9:18 AM, Julien Elua

Re: how to use clojure.java.jdbc.sql

2013-09-09 Thread Abraham
Thanks On Monday, September 9, 2013 12:10:13 PM UTC+5:30, Sean Corfield wrote: > > The basic DSL cannot do 'like' so you probably want to look at > HoneySQL which is the recommended way to extend clojure.java.jdbc. > > > On Sun, Sep 8, 2013 at 11:07 PM, Abraham > > wrote: > > > > I want to ge

Re: [ANN] Austin — the ClojureScript browser-REPL, rebuilt stronger, faster, easier

2013-09-09 Thread Norman Richards
On Mon, Aug 5, 2013 at 8:21 AM, Chas Emerick wrote: > As you might know, I've been tinkering with an easier-to-use variant of > ClojureScript's browser-REPL for some time. I've finally wrapped that up > into its own project, Austin: [...] > Is anyone successfully using this with nrepl in emacs

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Sean Grove
Also, a warning about breaking change with the strings no longer being keywords: Previously in ClojureScript, strings could be invoked to look themselves up as keys inside maps, just like keywords. So both (:a {:a 10 "b" 20}) and ("b" {:a 10 "b" 20}) would work (the latter will not work in vanilla

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread Oleksandr Petrov
Forgot to mention, Zweikopf comes as a Ruby gem and as a Clojure library. You should make a decision though wether you're running Ruby scripting container from Clojure or start Clojure runtime from Ruby... On Mon, Sep 9, 2013 at 5:50 PM, Oleksandr Petrov wrote: > I've been working with an appli

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread Jim Crossley
Hi Rodrigo, I'm one of the developers of TorqueBox and Immutant. Your email prompted me to re-watch a screencast [1] I made in March showing how to use them together. I realized things have changed a little since then, so I added a few annotations to the video highlighting the differences. Hopeful

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread david
A large percentage of tests for my core.async based library are failing. Any thoughts? -- -- 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 -

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread David Nolen
Can't have thoughts without a lot more details :) Specific errors, warnings, and a minimal case is always ideal. David On Mon, Sep 9, 2013 at 12:04 PM, wrote: > A large percentage of tests for my core.async based library are failing. > Any thoughts? > > -- > Note that posts from new members a

Re: Building Trees

2013-09-09 Thread Peter Mancini
On Sunday, September 8, 2013 11:26:35 PM UTC-5, puzzler wrote: > > > Rather than describing it in terms of how you'd implement it, can you be > clearer about the shape of the data and what specific sorts of operations > and queries you need to perform quickly on the data? That would make it > e

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread rdelcueto
Hey Ron, Thanks for your response. Digging deeper into my question... When I read about the Torquebox Immutant duet, I thought it was particularly interesting solution, because it was fairly easy to deploy and both processes would live inside a JVM environment. I was impressed by how Clojure da

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Timothy Baldridge
It's worth noting that the restrictions to IFn do not apply to definterface and deftype. Not that solves all (or any) of your problems, I've used definterface before to lock down the actual types used. Timothy On Mon, Sep 9, 2013 at 11:03 AM, Jozef Wagner wrote: > You can typehing ints for loca

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Timothy Baldridge
Also, how much of this is a limit of the OpenGL library you are using? The raw OpenGL API supports glVertex3d and glVertex3f. Is the double version not supported by your java interface library? Timothy On Mon, Sep 9, 2013 at 11:07 AM, Timothy Baldridge wrote: > It's worth noting that the restri

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Jozef Wagner
You can typehing ints for locals (let, loop), restrictions are just for function arguments. AFAIK the reason is combinatorial explosion at https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L91 I have the same problem with char. Because I cannot typehint e.g. my whitespace

Re: Building Trees

2013-09-09 Thread Mark Engelberg
OK, I'm starting to understand the shape of the data better. However, you say, "the ability to arbitrarily look into any node on the tree and then walk up it getting all of the parents until root." What does the query for this look like and specifically what information do you want returned? What

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread Oleksandr Petrov
I've been working with an application that written in Ruby and Clojure. Nothing forbids you from using some messaging system for communication between Ruby and Clj, although we required direct access to Ruby from Clojure and vice versa. That's pretty much how Zweikopf was born: http://github.com/i

Re: [ANN] nativot 0.1.0 (leiningen plugin) public beta

2013-09-09 Thread Alex Fowler
The license section of the plugin page has been updated. The established license is EPL, same as Clojure! среда, 28 августа 2013 г., 14:02:16 UTC+4 пользователь Alex Fowler написал: > > Plugin homepage: https://bitbucket.org/noncom/nativot > > As for the license: I have contacted JDotSoft, they'r

Fwd: Logos-oriented Lisp compiled to Javascript | coect.net

2013-09-09 Thread Mimmo Cosenza
It seems interesting to be watched. Does anyone already know something about it. Mimmo http://www.coect.net/metajs/ -- -- 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 f

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Mikera
+1 for supporting all the JVM primitive types properly. It is worth noting that the benefits would extend much further than just OpenGL, e.g.: - int is a commonly used type in Java interop. Casting to/from it all the time is a minor annoyance/overhead - int is the type used for array indexing

Re: Logos-oriented Lisp compiled to Javascript | coect.net

2013-09-09 Thread Alex Fowler
Well.. reminds me of Scala implicits. When some people think that implicits hurt the pure essense of good, I found them to be particulary useful, especially in some scenarios that involved passing many "boring" arguments. However, with implicits you could run into troubles, hunting invisible er

Re: Building Trees

2013-09-09 Thread Laurent PETIT
2013/9/9 Mark Engelberg : > OK, I'm starting to understand the shape of the data better. However, you > say, "the ability to arbitrarily look into any node on the tree and then > walk up it getting all of the parents until root." What does the query for > this look like and specifically what info

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
Think for youself: how much you gain for storing color in 64 bit instead of 32? How much you gain of storing positions to be projected on a, say, 1920x1080 screen, in 64 bit, not 32? Considering this, how much you gain from manufacturing 64-bit enabled GPUs for average humans to use? And puttin

Re: Logos-oriented Lisp compiled to Javascript | coect.net

2013-09-09 Thread Mimmo Cosenza
Thanks Alex, I'll keep an eye open on them. mimmo On Monday, September 9, 2013 10:24:08 PM UTC+2, Alex Fowler wrote: > > Well.. reminds me of Scala implicits. When some people think that > implicits hurt the pure essense of good, I found them to be particulary > useful, especially in some scena

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Alex Fowler
While there are "double" types for OpenGL, like GLdouble (reference-1, reference-2 ), their use is, softly speaking, not wide-spread: reference-3

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
Thanks for the help all, that gave me some things to think about. Cheers, Mark On Mon, Sep 9, 2013 at 9:22 PM, Meikel Brandmeyer (kotarak) wrote: > Hi, > > Am Montag, 9. September 2013 12:31:30 UTC+2 schrieb Alex Fowler: > >> I would also add that in case, if you *need* to destructure the `op

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
The solution I've actually gone with is: (apply esd/search es-index mapping-type (-> options seq flatten)) Seems the most consise and shows the intent of what I'm trying to do quite well - better than a (relatively) confusing `reduce` statement. Again, the help is appreciated. Mark On Tue, Se

Re: Building Trees

2013-09-09 Thread Mark Engelberg
Let's assume for the moment that you do in fact absolutely need some sort of "bidirectional" querying of the data. In other words, from a parent you need to get to the child, and from the child you need to get to the parent. There's no way to accomplish this with immutable data structures without

Re: Building Trees

2013-09-09 Thread Ben Wolfson
There's an overview of several approaches to the problem here: http://okmij.org/ftp/Scheme/parent-pointers.txt On Mon, Sep 9, 2013 at 4:37 PM, Mark Engelberg wrote: > Let's assume for the moment that you do in fact absolutely need some sort > of "bidirectional" querying of the data. In other wo

Re: Building Trees

2013-09-09 Thread Mark Engelberg
There's one other big downside to the mapping-from-names-to-nodes technique that I forgot to mention. If you plan to delete connections between nodes, and the structure is intricate enough that you don't know whether you can safely delete the node itself, then you can potentially end up with orpha

Re: Putting in alts! - haven't seen it used

2013-09-09 Thread Cedric Greevey
Sounds like that could be useful for gracefully degrading media players. Playback lags due to CPU contention or whatever, drop a frame to keep the audio and video and clock-time roughly in proper sync. Things like that. On Mon, Sep 9, 2013 at 9:09 AM, Philip Potter wrote: > I can suggest one, th

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread Michael Klishin
2013/9/9 Oleksandr Petrov > Forgot to mention, Zweikopf comes as a Ruby gem and as a Clojure library. > You should make a decision though wether you're running Ruby scripting > container from Clojure or start Clojure runtime from Ruby Or integrate the two using messaging, e.g. with [1] and [2].

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-09 Thread rdelcueto
Thank you all for your advice and information provided. It's clear to me now that a message based solution is a good option. I'm still unsure on which messaging framework I should start with. Actually it was Jim's screencast, which got me into thinking in the messaging solution using TorqueBox a

Clojure newbie code review

2013-09-09 Thread Igor Demura
Hi Clojure community, (I tried codereview.stackaxchange.com before, but no responses where) I'm Clojure newbie, and feel very excited about it and functional programming in general. I wrote tiny app (59 lines of code) which renders a directory tree to the terminal, filtering with a regex. I'm s

Re: wally: a alternative way to discover functions

2013-09-09 Thread Marco Shimomoto
That is exactly what http://www.haskell.org/hoogle/ does, you did a fantastic job. Thanks, On Monday, September 9, 2013 5:09:27 AM UTC-3, Islon Scherer wrote: > > Florian: I filter out all functions that end with ! but I can't know for > sure which functions have side effects. > > On Sunday, Se

Re: [ANN] Austin — the ClojureScript browser-REPL, rebuilt stronger, faster, easier

2013-09-09 Thread Nelson Morris
I've been using austin on a project with emacs/nrepl. It works for a C-c C-k, switch to nrepl, interact with app. However, some other features like auto-complete and jump-to-symbol-definition I'm used to in a clojure workflow don't work or cause a core to spin. I'd suspect the eldoc call to show

Re: Building Trees

2013-09-09 Thread Cedric Greevey
If you use a java.util.WeakHashMap (and resist the temptation to mutate it instead of making modified copies) and the name objects are interned (so any two that are equal are identical -- so, as usual, you want to use :clojure :keywords), then name->node mappings get auto-GC'd if the name stops bei

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Brandon Bloom
> a (very) temporary workaround is to use the old code Why not just switch (k coll) to (get coll k) ? If you know that coll is non-nil, you can also just use (coll k). Both forms also accept an optional not-found value. -- -- You received this message because you are subscribed to the Google

ANN: 2nd CFP for 2013 Workshop on Scheme and Functional Programming

2013-09-09 Thread William Byrd
Please note the encouraged shorter paper length (6 pages + references), which should make it easier for first time authors. The workshop will be co-located with Clojure/conj. We encourage Clojure-related submissions, and submissions by first-time authors! Cheers, --Will DEADLINE:

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Leif
Careful - `flatten` recursively flattens sequential things. E.g. (flatten (seq {:in [1 2 3]})) => '(:in 1 2 3), which is probably not what you want. You really want `flatten1`, which doesn't exist in core. A version that works on maps is (apply concat {:in [1 2 3]}) => '(:in [1 2 3]). This ap

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Matt Mitchell
And also: (mapcat identity {:in [1 2 3]}) => '(:in [1 2 3]) But yeah, destructuring with *&* then using *apply* is pretty clear too. - Matt On Monday, September 9, 2013 10:41:12 PM UTC-4, Leif wrote: > > Careful - `flatten` recursively flattens sequential things. E.g. > (flatten (seq {:in [1 2

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
I like that mapcat solution a lot. Very nice. For some reason I can't get the destructuring to work... clearly missing something there. But fair point on the flatten - I had a play with it, and I can clearly see the issue. Thanks for the extra help. Mark On Tue, Sep 10, 2013 at 2:17 PM, Matt

[ANN] CloCoP - constraint programming for Clojure

2013-09-09 Thread Alex Engelberg
http://github.com/aengelberg/clocop CloCoP is a Clojure wrapper of the Java library JaCoP. The acronyms stand for "Clojure/Java Constraint Programming". This invites comparison to the core.logic library, and you may wonder why we need both. There are a few ways in which, in my opinion, the JaCo

[ANN] XCLJB v0.1.0: X protocol Clojure-language Binding

2013-09-09 Thread Vincent Chen
Hello everyone, XCLJB is a Clojure language binding for the X Window System, similar to the XCB (the X protocol C-language Bindings). It allows programmers to communicate with and write GUIs for an X server in Clojure, without having to drop down into C. Source code, README, and examples: https:/

Re: [ANN] CloCoP - constraint programming for Clojure

2013-09-09 Thread David Nolen
Nice work! :) On Mon, Sep 9, 2013 at 9:39 PM, Alex Engelberg < alex.benjamin.engelb...@gmail.com> wrote: > http://github.com/aengelberg/clocop > > CloCoP is a Clojure wrapper of the Java library JaCoP. The acronyms stand > for "Clojure/Java Constraint Programming". This invites comparison to the

Re: Clojure, floats, ints and OpenGL

2013-09-09 Thread Mikera
On Tuesday, 10 September 2013 01:03:12 UTC+8, Jozef Wagner wrote: > You can typehing ints for locals (let, loop), restrictions are just for > function arguments. > AFAIK the reason is combinatorial explosion at > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L91 >

Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Gunnar Völkel
You can also checkout whether my library [1] suits you. Passing option maps to other functions with options and managing doc strings for these options (transitively) are the features it was written for. It will simplify functions with options in your own code but the calls to functions of third