Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread AtKaaZ
what would this do: (let [a 1, a 2] a) becomes: (let [a 1, a123 2] a) or (let [a 1, a123 2] a123) or exception[I prefer] On Tue, Feb 12, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Processing a hygienic AST relieves the burden of worrying about shadowing >

Re: Clojure + Web Services + Web Sockets

2013-02-12 Thread Feng Shen
I updated http-kit's server documentation: http://http-kit.org/server.html How http-kit is used to serve both HTTP and websocket: http://http-kit.org/server.html#routing Cheers, Feng On Tuesday, February 12, 2013 7:36:46 AM UTC+8, Ryan T. wrote: > > Thanks both for your answers. > > @Bob, I did

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread AtKaaZ
seems similar to this concept with "new": =>* (new java.lang.RuntimeException "msg")* ;works this way # => *(def a java.lang.RuntimeException)* #'runtime.q/a => *a* java.lang.RuntimeException => *(new a "msg")* ;nope CompilerException java.lang.IllegalArgumentException: Unable to resolve classnam

who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread faenvie
hi clojure-users, as i am thinking about using enfocus (http://ckirkendall.github.com/enfocus-site/) for building up the clientside-logic for a new site, i am interested in reports of people who have done so already. i am esp curious about how the development-process works out and what main-pr

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread Michael Wood
On 12 February 2013 12:28, AtKaaZ wrote: > what would this do: > > (let [a 1, a 2] a) > becomes: > (let [a 1, a123 2] a) > or > (let [a 1, a123 2] a123) > or > exception[I prefer] It would be the second option, i.e.: (let [a 1, a123 2] a123) The original code is valid, so it would not throw an

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread Meikel Brandmeyer (kotarak)
Hi, if you want to resort to eval you can define your own function on the fly. (defn call-fn [& args] {:arglists ([class method & args])} (let [o (gensym) [class method & args] (map symbol args)] (eval `(fn [~o ~@args] (. ~(with-meta o {:tag class}) (~

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Herwig Hochleitner
I have successfully used ClojureScript to write a Car2Go App for Blackberry: http://appworld.blackberry.com/webstore/content/19205189/ The big challenge there was actually the volatile platform (mandatory battery pulls after reading the geolocation anyone?), while ClojureScript has played along gor

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Herwig Hochleitner
Also, my dev setup: - two build profiles via lein-cljsbuild: one debug, one optimized - "lein ring server" for local dev, handler accepts ?debug=true - "lein cljsbuild auto" in the background - occasionally a browser-repl in emacs inferior-lisp The main difficulty regarding ClojureScript itself i

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread AtKaaZ
it makes sense to not throw now that I think about it, when using "_" instead of "a" I'm also thinking of cases like: => (let [a 1] (let [b 2 a 3] (println a b))) 3 2 nil is there something that would let me know I'm overwriting "a" ? I figure if something like this would slip by would

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread AtKaaZ
wow that's pretty epic! => (def f (call-fn "java.lang.String" "substring" "startpos" "endpos")) #'runtime.q/f => (f "abcdef" 2 4) "cd" => (f (str "123" "45") (+ 1 1) 4) "34" Thank you Meikel On Tue, Feb 12, 2013 at 1:51 PM, Meikel Brandmeyer (kotarak) wrote: > Hi, > > if you want to resort

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread ckirkendall
ClojureScript/Enfocus is being used by several people to build production software. If you want an unbiased opinion you might hop on the Clojure IRC channel and chat with Robert Stuttaford(@RobStuttaford). He is currently a very active user. Enfocus was originally envisioned to allow designer

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread ckirkendall
I recently added support for xpath and custom selectors in addition to the standard ccs3 selector. I added these to get around some of the limitations of goog.dom.query and querySelector. I would be interested in your specific use case to see if we can't provide a custom selector to handle it

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread Meikel Brandmeyer (kotarak)
You can also do away with the argument names. You just need the number of arguments. (defn call-fn [class method n-args] (let [o(gensym) args (repeatedly n-args gensym) [class method] (map symbol [class method])] (eval `(fn [~o ~@args] (. ~(with-meta o {

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Giacomo Cosenza
We use the following setup: - server side: ring/compojure/valip/friend/enlive/hiccup (plus the libs to support any rdbms or nosql db) - client side: valip/domina/enfocus/hiccups (and d3 + c2 for data visualization). We were able to share both valip validator and the html template between the c

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Herwig Hochleitner
2013/2/12 ckirkendall > I recently added support for xpath and custom selectors in addition to the > standard ccs3 selector. I added these to get around some of the > limitations of goog.dom.query and querySelector. I would be interested in > your specific use case to see if we can't provide a

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Giacomo Cosenza
oops, I forgot to cite shoreleave..for ajax stuff. mimmo On Feb 12, 2013, at 3:00 PM, Giacomo Cosenza wrote: > We use the following setup: > > - server side: ring/compojure/valip/friend/enlive/hiccup (plus the libs to > support any rdbms or nosql db) > - client side: valip/domina/enfocus/h

Re: Jormungandr: Prototype-based OO on top of functions

2013-02-12 Thread Mikera
I had a quick experiments with some of these idea in case there is interest: https://github.com/mikera/clobber The key difference in this approach is that the functions go first, and work as regular functions. If you get a chance take a look and let me know what you think. On Tuesday, 12 Febru

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread juan.facorro
Awesome :) On Tuesday, February 12, 2013 9:51:01 AM UTC-3, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > if you want to resort to eval you can define your own function on the fly. > > (defn call-fn > [& args] > {:arglists ([class method & args])} > (let [o (gensym) > [class method

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread ckirkendall
I would be very interested in your code. Awhile back I did add support for most enlive selectors to enfocus. So you can use something like [:td :#id1] in your enfocus templates. This does have limitations though. I also have been working on adding string css3 selector support to enlive thro

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread Timothy Baldridge
This sort of pattern is used quite a lot in clojure (even in core): (let [data (if (string? data) (read-string data) data) data (if (string? (first data)) (first data) (next data)) data (if (string? (first data)) (first data) (next data))] data) Throwing exceptions on overridden

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread Michael Wood
It might be useful, though, to be able to enable warnings for shadowed variables. On 12 February 2013 17:38, Timothy Baldridge wrote: > This sort of pattern is used quite a lot in clojure (even in core): > > (let [data (if (string? data) (read-string data) data) > data (if (string? (first d

Re: recommended way to write loop where a binding depends on a previous 'useless binding' operation?

2013-02-12 Thread George Oliver
@Baishampayan, I'm just experimenting at the repl right now so there's no stopping condition yet. It's a socket server. On Monday, February 11, 2013 11:56:22 PM UTC-8, Evan Mezeske wrote: > > Generally when you are calling functions that have (and depend on) > side-effects, you will end up usin

Re: Can't use Clojure 1.5 with emacs and swank

2013-02-12 Thread JvJ
Thanks for that. It works. In fact, I thought I had already tried this, but I wrote :plugin instead of :plugins in the project file. On Tuesday, 12 February 2013 00:04:52 UTC-5, Daniel Glauser wrote: > > The momentum is definitely headed the nrepl direction but if you do want > to get Clojure

Clojurians in sg?

2013-02-12 Thread Omer Iqbal
Hey, any folks from Singapore here? I have heard that a couple of banks here use scala and possibly clojure, but don't know the extent. -- -- 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

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread AtKaaZ
is there a way to use nested transactions, yet? I am looking at [1] and [2] [1] https://github.com/thinkaurelius/titan/wiki/Multi-Threaded-Transactions [2] https://github.com/tinkerpop/blueprints/wiki/Graph-Transactions On Mon, Feb 11, 2013 at 6:37 PM, Michael Klishin < michael.s.klis...@gmail.

Re: recommended way to write loop where a binding depends on a previous 'useless binding' operation?

2013-02-12 Thread Evan Mezeske
The big advantage to my reorganization of your loop is that it doesn't have an unused "x" binding. The other advantage is that the expressions bound to "x" and "y" are not repeated at the beginning of the loop and at the end. Also, (and this is less clear cut, more opinion), it's typical for a lo

Re: ANN: NEVER use clojure.core/read or read-string for reading untrusted data

2013-02-12 Thread Phil Hagelberg
Andy Fingerhut writes: > It isn't just clojure.core/read executing code that can consume CPU > cycles that is the issue, it is clojure.core/read executing code that > can wreak havoc with your system and allow attackers to gain remote > control of it. Are there specific known problems with bindi

Re: ANN: NEVER use clojure.core/read or read-string for reading untrusted data

2013-02-12 Thread Andy Fingerhut
On Feb 12, 2013, at 9:57 AM, Phil Hagelberg wrote: > > Andy Fingerhut writes: > >> It isn't just clojure.core/read executing code that can consume CPU >> cycles that is the issue, it is clojure.core/read executing code that >> can wreak havoc with your system and allow attackers to gain remote

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread faenvie
thank you for the replies. it is also no surprise, that there are rough edges and uncertainties at the moment. enfocus is on my radar because i have worked with enlive on the serverside before. So herwigs argument "The same selector syntax (and semantics) for server- and client side" holds for

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Jeroen van Dijk
Looks interesting. I'm just wondering if you had a look at hermes [1], and if so, how is it different? [1] https://github.com/gameclosure/hermes On Tue, Feb 12, 2013 at 6:39 PM, AtKaaZ wrote: > is there a way to use nested transactions, yet? > I am looking at [1] and [2] > > [1] > https://gith

Bootstrapping Web Apps

2013-02-12 Thread Ari
Hi, How does one bootstrap web apps comprised of ring + compojure (and/or aleph) + hbase/mongodb? Is there a best practice or recommended way? For example, in Rails based apps a series of predetermined "initialization" files are executed to fulfill various tasks, i.e. connect to dbs, message q

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread AtKaaZ
I did not look at hermes, wasn't aware of it, but I'll look, thanks. On Tue, Feb 12, 2013 at 8:56 PM, Jeroen van Dijk wrote: > Looks interesting. I'm just wondering if you had a look at hermes [1], and > if so, how is it different? > > [1] https://github.com/gameclosure/hermes > > > On Tue, Feb

Re: Bootstrapping Web Apps

2013-02-12 Thread Mimmo Cosenza
I would try to do same thing I do when I need to initialise a simulated universe before running test. just a little bit more deep and less wide. mimmo On Feb 12, 2013, at 9:10 PM, Ari wrote: > Hi, > > How does one bootstrap web apps comprised of ring + compojure (and/or aleph) > + hbase/m

Re: Bootstrapping Web Apps

2013-02-12 Thread Sven Johansson
On Tue, Feb 12, 2013 at 9:10 PM, Ari wrote: > How does one bootstrap web apps comprised of ring + compojure (and/or > aleph) + hbase/mongodb? Is there a best practice or recommended way? For > example, in Rails based apps a series of predetermined "initialization" > files are executed to fulfill

Re: Natively Compiled Clojure

2013-02-12 Thread Aaron
I have been working on a library for ClojureCLR that actually uses a Clojure DSL to generate, compile, and load C code live into a running REPL. It's called c-in-clj (see https://github.com/aaronc/c-in-clj). It works quite well for me so far, but is still in what I would call Alpha stage. Ev

Re: Bootstrapping Web Apps

2013-02-12 Thread Feng Shen
Hi, here is what I did for rssminer (A Clojure web app): https://github.com/shenfeng/rssminer/blob/master/src/rssminer/main.clj define a main function, accept args from stdin, parse them, save the argument, call `start-server`, do init, bind to port, accept request On Wednesday, February

Clojure job opportunity near Princeton, NJ

2013-02-12 Thread Aaron
Our company is looking for a developer in the Princeton, NJ area. We code in Clojure (ClojureCLR to be specific), C#, and C. The work would be in the area of medical diagnostics, RFID tagging, and laboratory robotics automation. You would be working on desktop, embedded, and mobile applicati

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Zack Maril
Primary author of Hermes here. We've put a fair amount of work into getting transactions right from the very beginning. Try reading: https://github.com/gameclosure/hermes/wiki/Transaction-Management And: https://github.com/gameclosure/hermes/wiki/Opening-graphs I'm working on a project now tha

Re: ANN: NEVER use clojure.core/read or read-string for reading untrusted data

2013-02-12 Thread Phil Hagelberg
Andy Fingerhut writes: > Examples of dangerous side effects that can occur with > clojure.core/read and read-string in Clojure 1.4 and earlier: > > ;; This causes precious-file.txt to be created if it doesn't > ;; exist, or if it does exist, its contents will be erased (given > ;; appropriate JVM

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread AtKaaZ
Thanks Zack. I wouldn't have looked at hermes if ccw would actually not show-stop my attempts to load titanium into eclipse, so I've filed some ccw issue here: https://code.google.com/p/counterclockwise/issues/detail?id=531&sort=-id Even so, as far as I could tell, they didn't (yet!) implement tran

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread Pablo Nussembaum
Hey, I really appreciate your help guys. This is very useful. On 02/12/2013 10:45 AM, Meikel Brandmeyer (kotarak) wrote: > You can also do away with the argument names. You just need the number of > arguments. > > (defn call-fn > [class method n-args] > (let [o(gensym) > args (rep

Re: How to invoke java method obtained using clojure.reflect

2013-02-12 Thread Aaron Cohen
You're actually probably better off using clojure's reflector (clojure.lang.Reflector/invokeStaticMethod ...) or (clojure.lang.Reflector/invokeInstanceMethod ...) That way you get type coercions that match clojure's behaviour. On Tue, Feb 12, 2013 at 9:16 AM, juan.facorro wrote: > Awesome :) >

multiple nrepl sessions in emacs

2013-02-12 Thread Leonardo Borges
Hi all, I tried googling this info but came up with nothing. I often find myself working in at least two different Clojure projects daily so I have one repl for each constantly running on my terminal. What doesn't seem optimal is that I have to disconnect one nrepl session in emacs before connec

Re: Clojurians in sg?

2013-02-12 Thread Lim Yu-Xi
There's a LinkedIn group, though meetups are infrequent (organizers welcome). On Wednesday, February 13, 2013 1:38:39 AM UTC+8, Omer Iqbal wrote: > > Hey, any folks from Singapore here? I have heard that a couple of banks > here use scala and possibly clojure, but don't know the extent. > > > -

"IF"?

2013-02-12 Thread Dies_Felices
Hi there, Before I go on, I'll apologize as this might get long and vague in parts. That will just be my showing where I'm even more confused than I generally am. I have only recently started trying to learn Clojure and by inference Lisp. Last night, I watched this video - http://blip.tv/cloju

Re: multiple nrepl sessions in emacs

2013-02-12 Thread Hugo Duncan
Leonardo Borges writes: > Is there an efficient way to work with multiple nrepl sessions in > emacs? I hope I'm just missing something obvious. nrepl.el master has support for this [1]. Should be available via MELPA. Hugo [1] https://github.com/kingtim/nrepl.el/pull/238 [2] https://github.co

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Michael Klishin
2013/2/12 AtKaaZ > is there a way to use nested transactions, yet? > I am looking at [1] and [2] Some initial tx support is in master, more coming soon. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message because you are subscribed to th

Re: "IF"?

2013-02-12 Thread Brandon Bloom
Clojure, like most Lisps, has a top-to-bottom, inside-out, left-to-right, eager evaluation strategy. All Clojure forms are expressions, and thus must return a value. Given these two design requirements, (if test then else) is the natural branching primitive. It implies serialize execution (top-

Re: multiple nrepl sessions in emacs

2013-02-12 Thread Leonardo Borges
Excellent! Thanks, will give it a shot soon! Cheers, Leonardo Borges www.leonardoborges.com On Wed, Feb 13, 2013 at 11:23 AM, Hugo Duncan wrote: > Leonardo Borges writes: > >> Is there an efficient way to work with multiple nrepl sessions in >> emacs? I hope I'm just missing something obvious

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Michael Klishin
2013/2/12 Jeroen van Dijk > Looks interesting. I'm just wondering if you had a look at hermes [1], and > if so, how is it different? We started thinking about developing Titanium and what it may look like before Hermes was released (or before I heard about it). I did not look at the Hermes code

Re: ANN Titanium, a Clojure library on top of Titan

2013-02-12 Thread Michael Klishin
2013/2/13 Zack Maril > From a philosophical standpoint, I'm not comfortable with the idea that an > API written to wrap a REST endpoint should serve as inspiration for the API > to wrap the in process interactions with the database I'd like to point out that we won't try to make Titanium "a Neo

Library naming etiquette?

2013-02-12 Thread Jim Klucar
I have a library that I'm getting ready to push to github / clojars and had a question about the naming of it. During development I called it clojure-xxx, where xxx is the application it interacts with. This is mostly because I didn't want to think of something clever. At any rate I'd like to k

Re: multiple nrepl sessions in emacs

2013-02-12 Thread Sean Corfield
Nice! Any idea when the next release to marmalade will happen so those of us who prefer to work off stable releases can get this multi-buffer goodness? (I could've really used it yesterday!! :) On Tue, Feb 12, 2013 at 4:23 PM, Hugo Duncan wrote: > Leonardo Borges writes: > >> Is there an efficie

Re: Library naming etiquette?

2013-02-12 Thread Michael Klishin
2013/2/13 Jim Klucar > This is mostly because I didn't want to think of something clever. At any > rate I'd like to know if that naming convention would be frowned upon > because it isn't coming from the official clojure dev group. > clj-* is a much more popular naming scheme. It is more import

Re: recommended way to write loop where a binding depends on a previous 'useless binding' operation?

2013-02-12 Thread George Oliver
On Tuesday, February 12, 2013 9:52:35 AM UTC-8, Evan Mezeske wrote: > > The big advantage to my reorganization of your loop is that it doesn't > have an unused "x" binding. [] > Good points Evan, thank you! -- -- You received this message because you are subscribed to the Google Groups

Re: Clojurians in sg?

2013-02-12 Thread Mikera
On Wednesday, 13 February 2013 01:38:39 UTC+8, Omer Iqbal wrote: > Hey, any folks from Singapore here? I have heard that a couple of banks > here use scala and possibly clojure, but don't know the extent. > > I'm a Clojure enthusiast and quite often in Singapore. There have been a few good meetu

Re: Jormungandr: Prototype-based OO on top of functions

2013-02-12 Thread eduardoejp
> I wonder what are the specific advantages of putting the objects first / making them functions? There wasn't any specific advantage. I did it because I could and I thought it was an interesting approach. I didn't just want to create Yet-Another-OO-System. I wanted it to be different. Alterna

Re: Building a REST API / efficient RPC interface in Clojure

2013-02-12 Thread bernardH
On Monday, February 11, 2013 2:48:30 AM UTC+1, Mikera wrote: > > Thanks bernardH - these are great links, probably pretty close to what I > was looking for. > > Will try some experiments with these over the next few days. > Hi, I, for one, would be interested by the results of those experiments

Re: Clojure Position

2013-02-12 Thread Chris Ford
Murtaza, I'm guessing you probably didn't want to send us all your resume... Cheers, Chris On 13 February 2013 09:57, Murtaza Husain wrote: > > Alex are you still looking for clojure developers. I am attaching my > resume. > > On Saturday, June 16, 2012 11:44:41 PM UTC+5:30, Alex Baranosky wrot

Re: who uses enfocus/clojurescript in the wild ?

2013-02-12 Thread Herwig Hochleitner
2013/2/12 ckirkendall > I would be very interested in your code. Awhile back I did add support > for most enlive selectors to enfocus. So you can use something like [:td > :#id1] in your enfocus templates. Have a look at https://gist.github.com/bendlas/4942735 Feel free to use what you like,

Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-12 Thread Ambrose Bonnaire-Sergeant
IMO that's the job of a "linter"-style tool, which can be written easily with `analyze`. On Tue, Feb 12, 2013 at 11:58 PM, Michael Wood wrote: > It might be useful, though, to be able to enable warnings for shadowed > variables. > > On 12 February 2013 17:38, Timothy Baldridge wrote: > > This s

Re: "IF"?

2013-02-12 Thread Herwig Hochleitner
+1 for Brandon's response Additionally I'd like to note that it's not strictly necessary to have IF as a primitive. You can build IF out of thin lambda, by defining TRUE as a function calling its first argument and FALSE as a function calling its second argument. In a strict language like clojure