Re: Trouble with running in jline editor. (newbie question)

2010-01-10 Thread Mark Rathwell
your syntax looks fine. are you running on unix or windows? what java version? what clojure version? On Sun, Jan 10, 2010 at 11:54 AM, piscesboy wrote: > I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same > directory. I started the default clojure editor using: > > java -cp

Re: Trouble with running in jline editor. (newbie question)

2010-01-11 Thread Mark Rathwell
ework/Versions/1.5/Commands/java -cp jline-0.9.94.jar:clojure.jar jline.ConsoleRunner clojure.main On Sun, Jan 10, 2010 at 9:08 PM, piscesboy wrote: > java version "1.6.0_17" > clojure 1.1.0 > > Running on Mac OS X. > > On Jan 10, 2:46 pm, Mark Rathwell wrote: >

Re: Natively Compiled Clojure

2013-01-27 Thread Mark Rathwell
> Embedding in applications - Python is used very often as a scripting language > in 3d apps, games, mapping software, etc. I've yet to hear of the JVM ever > being used for this. Related to this, do you have any thoughts on the viability of embedding clojure-py into a C++ application for simila

Re: Natively Compiled Clojure

2013-01-27 Thread Mark Rathwell
On Sun, Jan 27, 2013 at 1:31 PM, Paul deGrandis wrote: > As far as embedding Clojure is concerned, another option is > ClojureScript-Lua + LuaJit + C. > I've recently started going through the CLJS-Lua source to see how viable > this is. Thanks, I had forgotten about ClojureScript-Lua. (And hope

Re: Natively Compiled Clojure

2013-01-27 Thread Mark Rathwell
I haven't hit any hard limits at this point, but you hit on a use case where Python and Lua currently hit a sweet spot that I think would be nice to use Clojure: C/C++ systems that want to expose scripting capabilities to users (e.g. game engines, robotics systems). For these types of use cases,

Re: What is the status of Clojure on LLVM or C?

2013-03-27 Thread Mark Rathwell
A previous thread that covers a lot of ground, but should give you a lot of the information you are looking for [1]. There aren't too many use cases that couldn't be covered with ClojureScript+V8 or some of the other suggestions. [1] https://groups.google.com/forum/?fromgroups=#!topic/clojure/UWB

apply with constructors

2010-06-02 Thread Mark Rathwell
I apologize for my ignorance, I've been struggling with this one for a couple hours and can't figure it out. Why does apply not work with constructors, special forms, etc.? Is there some other standard way to unpack a list? My question is outlined below, I have a variable length list of paramete

Re: apply with constructors

2010-06-02 Thread Mark Rathwell
again. - Mark On Wed, Jun 2, 2010 at 7:34 AM, Meikel Brandmeyer wrote: > Hi, > > On Jun 2, 2:51 am, Mark Rathwell wrote: > > > ;; can do it with eval, but what is the correct way? > > user=> (eval `(ConnectionConfiguration. ~...@params)) > > (eval

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
:reload reloads the specified namespace There is also :reload-all, which reloads the specified namespace as well as all namespaces import'ed, use'd, and require'd in the specified namespace. ex: (require '[some.ns.foo :as foo] :reload-all) On Mon, Jul 19, 2010 at 4:09 PM, Meikel Brandmeyer w

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
>>In my stupidity I chose prn as function name, which removed from the namespace on >>reload, because clojure.core/prn „overwrites“ the Var again. Maybe such a functionality >>could be also implemented for normal reload? But then what happens to other >>namespaces which refer to this Var? I admit,

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
ng. There is only one some.ns.foo2. It doesn't matter where things are loaded from. You are correct, my mistake. For some reason I had been operating under this assumption. On Mon, Jul 19, 2010 at 5:42 PM, Meikel Brandmeyer wrote: > Hi, > > Am 19.07.2010 um 23:01 schrieb Mark

Re: What is the Clojure way to build

2010-07-20 Thread Mark Rathwell
There are several ways to do it, but one example using list comprehension: (let [nums [1 2 3]] (for [n1 nums] (for [n2 nums] (* n1 n2 => ((1 2 3) ( 2 4 6) (3 6 9)) - Mark On Tue, Jul 20, 2010 at 10:44 AM, Michael Harrison (goodmike) < goodmike...@gmail.com> wrote: > I'm worki

Re: Slightly Off Topic: .NET books

2010-08-06 Thread Mark Rathwell
+1 for: _The C# Programming Language, 3rd Edition_ by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, and Peter Golde Pretty decent book, but I'm not sure if it's been updated since 2.0 (a lot of cool stuff came in 3.0 and 4.0 [LINQ, implicit type (inference), initializers, extension methods,

lein-daemon problems

2010-08-06 Thread Mark Rathwell
Anyone using lein-deamon and have success getting it working? When trying to start a daemon with 'lein daemon start daemon-name', I'm getting java.lang.IllegalArgumentException: No matching method: with-bindings (daemonProxy.clj:27). The entire error log is at http://gist.github.com/512327. I get

Re: Slightly Off Topic: .NET books

2010-08-07 Thread Mark Rathwell
> My copy of Third Edition covers C# 3.0. Sorry about that, I just copied and pasted your entry, I have Second Edition. On Fri, Aug 6, 2010 at 7:34 PM, Dan Moniz wrote: > On Fri, 06 Aug 2010 17:49 -0400, "Mark Rathwell" > wrote: > > > +1 for: > > > > _T

Re: Blocked read on a thread of execution

2010-08-24 Thread Mark Rathwell
It's not send and send-off that are blocking, it is your (println "Final"... send expects a function, so it is waiting for "(println..." to return some function to apply to the agent. On Tue, Aug 24, 2010 at 9:16 AM, Timothy Washington wrote: > Ok, I have a dumb question here. Using Clojure's c

Re: Question re Mikael Sundberg's Getting started with compojure

2010-08-31 Thread Mark Rathwell
I'm not sure if this is the question you are asking, but to reload a namespace in a repl, depending on whether you are use-ing the ns or require-ing it, there are :reload and :reload-all keyword arguments accepted: (require '[foo.something :as something] :reload) (require '[foo.something :as some

Re: Tutorial: clojure.zip

2010-09-02 Thread Mark Rathwell
Meant to thank you for this. It was very timely for me, and very understandable. On Thu, Sep 2, 2010 at 10:34 AM, Brian Marick wrote: > I've written a short tutorial for clojure.zip: > > > http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/ > > - > Brian Marick

Re: matching with wild-cards in clojure multi-methods

2010-09-05 Thread Mark Rathwell
You can add essentially one more level of indirection to your dispatch function logic and return an integer (or string or whatever) and match on that. So, with your example, when you want "method1" called, return 1 from the dispatch function, when you want "method2" return 2, you get the idea: (d

Re: RabbitMQ

2011-03-24 Thread Mark Rathwell
I just wrapped their java client library: http://www.rabbitmq.com/java-client.html On Thu, Mar 24, 2011 at 11:15 AM, Max Weber wrote: > What is the best Clojure library to work with RabbitMQ? > > Best regards > > Max > > -- > You received this message

Re: How to add a java library (that is not in maven) as a dependency for a clojure library?

2011-04-07 Thread Mark Rathwell
The easiest way would be to install the library to you local maven repository with the command below (assuming you have maven installed. That way, you can add the dependency to all of your projects on your local box. If you do not want to use maven, you make sure the library is on your classpath

Re: How to add a java library (that is not in maven) as a dependency for a clojure library?

2011-04-07 Thread Mark Rathwell
Oops, just reread your question, looks like you may be more interested in deployment. For deployment, try 'lein uberjar' to bundle all dependencies into one distributable jar file. Hopefully answered the right question this time ;) - Mark On Thu, Apr 7, 2011 at 9:54 AM, Mark Rath

Re: How to add a java library (that is not in maven) as a dependency for a clojure library?

2011-04-07 Thread Mark Rathwell
ition the library's developer to get it into a common repo or do it yourself. Sorry for any confusion. - Mark On Thu, Apr 7, 2011 at 9:56 AM, Mark Rathwell wrote: > > Oops, just reread your question, looks like you may be more interested in > deployment. For deployment, try '

Re: How to add a java library (that is not in maven) as a dependency for a clojure library?

2011-04-07 Thread Mark Rathwell
uild file to clojars? My understanding of clojars was > that it was for clojure libraries? > > Thanks. > > On Apr 7, 3:19 pm, Mark Rathwell wrote: > > Wow, I really shouldn't be reading this early in the morning. Just > realized > > you want to publish to clojars.or

Re: partial vs anonymous function?

2011-04-14 Thread Mark Rathwell
Try this: (eval (mapper `(partial + 1) [10 11 12])) On Thu, Apr 14, 2011 at 9:46 AM, David McNeil wrote: > I am puzzled by the results below. Can anyone explain the difference > in behavior? > > -David > > > > (defn mapper [f stream] > `(map ~f ~stream)) > > (eval (mapper #(+ 1 %) [10 11

Re: partial vs anonymous function?

2011-04-14 Thread Mark Rathwell
I think it has to do with partial's use of apply, but you would need someone smarter than me to tell you for sure ;) On Thu, Apr 14, 2011 at 9:58 AM, David McNeil wrote: > Mark - Thanks. I am able to permute it to make it work. However, I > cannot explain why the original code fails. > > -David

Re: partial vs anonymous function?

2011-04-14 Thread Mark Rathwell
ed. user> (eval (mapper (fn [x] (+ 1 x)) [1 2 3])) (2 3 4) On Thu, Apr 14, 2011 at 10:17 AM, Mark Rathwell wrote: > > I think it has to do with partial's use of apply, but you would need > someone smarter than me to tell you for sure ;) > > > On Thu, Apr 14, 2011 at 9:58

Re: Strange error

2011-04-25 Thread Mark Rathwell
It's probably a paren off, but it would be easier to tell for sure if you posted the code to a github gist, or here. On Mon, Apr 25, 2011 at 10:02 AM, WoodHacker wrote: > Can anyone help me with this? I get the following error: > > Exception in thread "main" java.lang.IllegalArgumentException:

Re: New to Clojure

2011-05-20 Thread Mark Rathwell
In the clojars repository, looks like the most recent versions are: [work "0.1.2-SNAPSHOT"] http://clojars.org/work [clj-time "0.3.0"] http://clojars.org/clj-time On Fri, May 20, 2011 at 1:01 PM, dudaroo wrote: > I am trying to help with an existing project and have no developer > notes on

Re: New to Clojure

2011-05-20 Thread Mark Rathwell
> Look at the code on github: > http://github.com/clj-sys/work This has moved to: https://github.com/getwoven/work You might also ask the maintainers of this project if they would be able to upload more recent versions to clojars. - Mark

Re: New to Clojure

2011-05-20 Thread Mark Rathwell
om the project website. > > Then, install it using the command: > mvn install:install-file -DgroupId=clj-sys -DartifactId=plumbing > -Dversion=0.1.2-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file > > Alternatively, if you host your own repository you can deploy the > file there: >

Re: lein usage

2011-05-21 Thread Mark Rathwell
A project.clj with clojure.contrib: (defproject foo "1.0.0-SNAPSHOT" :description "FIXME: write description" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"]]) To find libraries, search http://clojars.org Documentation for lein is in

Re: New to Clojure

2011-05-24 Thread Mark Rathwell
woven about uploading the most current version of the work build to > clojars? :) > > On May 20, 5:20 pm, Mark Rathwell wrote: > > A couple things going on here, I think: > > > > First, it looks like maven is having problems communicating with the > Woven &g

Re: lein and private locally installed classes

2011-05-24 Thread Mark Rathwell
Yes, this key was recently added, and is currently only available in the development snapshot (1.6.0-SNAPSHOT). You have the most recent stable version, 1.5.2, which is what lein upgrade pulls down. The current development version is available at: https://github.com/technomancy/leiningen/raw/mast

Re: Best Installation Option

2011-06-05 Thread Mark Rathwell
Leiningen, via maven, will handle your clojure dependencies for you, no need to copy and paste any jar files. Lein is actually the only thing you need to install, and it will take care of everything else. I think the easiest way to start learning about leiningen is reading the readme and all of t

Re: Free Compojure Hosting? (or mostly free)

2011-06-08 Thread Mark Rathwell
Also released since this thread started, not free, but starting at about $14/month USD, Amazon's Elastic Beanstalk ( http://aws.amazon.com/elasticbeanstalk/) . And VMWare has their Cloud Foundry hosting in beta for free, but it will cost money once it is out ( http://www.cloudfoundry.com/). GAE i

Re: Using slurp to read changing JSON string

2011-06-10 Thread Mark Rathwell
I don't think the issue you are having is with slurp. If you could post more of the code that is causing you problems, it would be easier to debug. Entering the following at the repl seems to work fine for me (you can just do (slurp "http://tycho.usno.navy.mil/cgi-bin/timer.pl";) and notice that

Re: bug in partition?

2011-06-13 Thread Mark Rathwell
This, or wrap user-pass with seq in the conditional, which will return nil for an empty list: (defn authenticate? [uri name pass] (loop [user-pass (seq (partition 2 (.getStringArray *conf* "authentication")))] (if (seq user-pass) (if (re-matches (re-pattern (ffirst user-pass)) uri)

Re: Having trouble figuring out dependencies

2011-06-15 Thread Mark Rathwell
Just to be clear, you do not need to download and build all of your dependencies, and you do not need to worry about whether they are on your classpath. I don't know cake, but I assume it is similar to leiningen in that is manages all of your dependencies for you, via maven, and again, if like lei

Re: Why is class name not found?

2011-06-15 Thread Mark Rathwell
It is standard to name your filenames with underscores, but your clojure names with dashes (so 'ns test_csv' should be 'ns test-csv'). Also update that in your project.clj :main key. That may or may not be the cause of the problem here. On Wed, Jun 15, 2011 at 1:19 PM, octopusgrabbus wrote: > I

Re: Why is class name not found?

2011-06-15 Thread Mark Rathwell
-- > (ns test-csv > (:import (java.io BufferedReader FileReader) > (:use clojure-csv))) > > (defn -main [& args] > (println "Hello world!")) > > I took the[clojure-csv/clojure-csv "1.2.4"] for project.clj right > from cl

Re: Why is class name not found?

2011-06-15 Thread Mark Rathwell
See Ken's post, there is a paren out of place in test_csv.clj. On Wed, Jun 15, 2011 at 2:02 PM, octopusgrabbus wrote: > Yes, I did all that. > > On Jun 15, 2:01 pm, Mark Rathwell wrote: > > Did you run the command to re-pull the dependencies, then rebuild your > jar? &

Re: Properly including clojure-contrib

2011-06-16 Thread Mark Rathwell
The clojure.contrib.string namespace contains many function names which are already defined clojure.core. So, by :use-ing clojure.contrib.string, you will be replacing the core functions with the string functions. Rarely do you really want to do this. It is generally best to :require instead of

Re: Am I getting back a vector of lines and can I split each line?

2011-06-17 Thread Mark Rathwell
Some resources, in case they help: 1. http://clojuredocs.org/ has documentation for core and contrib, and often has examples 2. http://clojure.org has a lot of reading material about the language, including a nice cheat sheet ( http://clojure.org/cheatsheet) 3. http://ww

Re: Java interop: casting

2011-06-17 Thread Mark Rathwell
In Java, varargs are actually converted to arrays at compile time. It is really just some syntactic sugar allowing you to use nicer syntax for array arguments, and you can pass the arguments as an array, or as a comma delimited sequence of arguments. On Fri, Jun 17, 2011 at 10:57 AM, Gregg Reyno

Re: Java interop: casting

2011-06-17 Thread Mark Rathwell
{1, 2, 3}); } On Fri, Jun 17, 2011 at 1:35 PM, Gregg Reynolds wrote: > On Fri, Jun 17, 2011 at 10:17 AM, Mark Rathwell > wrote: > > > > In Java, varargs are actually converted to arrays at compile time. It is > > really just some syntactic sugar allowing you to use nic

Re: Trying to set up clojure... and failing

2011-06-19 Thread Mark Rathwell
Agreed, you should definitely start with lein. If you have ~/bin on your path (and curl): 1. Get lein: curl -L https://github.com/technomancy/leiningen/raw/stable/bin/lein > ~/lein chmod a+x ~/lein 2. Create a new project with lein (in current working directory) lein new first-time 3. Get a re

Re: Trying to set up clojure... and failing

2011-06-19 Thread Mark Rathwell
I think lein runs 'deps' with the 'repl' task, but just in case you may also want to include a 'lein deps' in step 3: 3. Get a repl to play around with: cd first-time lein deps lein repl On Mon, Jun 20, 2011 at 2:17 AM, Mark Rathwell wrote: > > Agreed, y

Re: Conversion of one java example to clojure?

2011-06-23 Thread Mark Rathwell
It looks like you may also be thinking that you are creating local bindings in the 'add' call, but you actually need to create those bindings in a let. Also,'app' is bound to 'this' but never used. I think something like this may be closer to what you are trying to do: (defn -init [this] (let

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread Mark Rathwell
map takes a function and a collection. So, that function can be: 1. named: - define the function on it own, using the defn macro - pass it as first argument to map (def coll [[1 2] [3 4] [4 5]]) (defn foo [x y] (println x y)) (map foo coll) 2. anonymous: - use shorthan

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread Mark Rathwell
> symbol col fits into this, unless you're using it as map values. > > On Jun 28, 3:11 pm, Mark Rathwell wrote: >> map takes a function and a collection. So, that function can be: >> >> 1. named: >>- define the function on it own, using the

Re: How do Clojure functions update def variables

2011-06-30 Thread Mark Rathwell
Clojure data structures are immutable by default (see http://clojure.org/functional_programming). For mutability, see the following: http://clojure.org/vars http://clojure.org/atoms http://clojure.org/refs http://clojure.org/agents http://clojure.org/transients On

Re: How do Clojure functions update def variables

2011-06-30 Thread Mark Rathwell
and I'll go look at the links you > posted. > > I'm wondering why conj worked in the first of the function that > operated on the mtr-map defined by def, and not in the version where > mtr-map was passed in as the first parameter. > > On Jun 30, 11:48 am, Mark Rathwell

Re: How do Clojure functions update def variables

2011-06-30 Thread Mark Rathwell
True, I did not mean to imply that they should be used in situations such as this, only that they are data structures in the language that are mutable, and have situations where they may be useful. - Mark On Thu, Jun 30, 2011 at 12:17 PM, Phil Hagelberg wrote: > Mark Rathwell wri

Re: Filling let local variable from sequence

2011-06-30 Thread Mark Rathwell
One way would be: (defn map-func "test map function" [] (let [mtr-seq (vector "a" 1 "b" 2 "c" 3 "d" 4) read-map (apply hash-map mtr-seq) (println read-map))) On Thu, Jun 30, 2011 at 1:09 PM, octopusgrabbus wrote: > > Given this function > > (defn map-func >"test m

Re: Filling let local variable from sequence

2011-06-30 Thread Mark Rathwell
t;d" 4] > ["e" 5 "f" 6 "g" 7 "h" 8] > > How can I break up each row? > > I've tried doseq in the let statement, but get an error. > > > On Jun 30, 2:27 pm, octopusgrabbus wrote: > > Thanks. That did it. > &g

Re: Please stand firm against Steve Yegge's "yes language" push

2011-07-04 Thread Mark Rathwell
A function is a function, whether it is bound to a Var or not. I think that was Ken's point, that you need to wrap a Java method in a function (anonymous or named) in order to pass to an HOF, as Java methods are not first class. So, that is one instance where a function whose sole purpose is to w

Re: Thread Macro For Inserting In Arbitrary Positions

2011-07-05 Thread Mark Rathwell
> Is there a reason something like this does not exist in clojure.core? > Is this an oversight or is there a reason this is not there? Previous discussions on this subject: 1. http://groups.google.com/group/clojure/browse_thread/thread/e826fc303e440b7c/0e7bdba707b7982d (in particular Rich's re

Re: Please stand firm against Steve Yegge's "yes language" push

2011-07-06 Thread Mark Rathwell
> And ending up here with a thread titled "stand firm > against..." seems to be exactly the sort of community problem that he > is worried about. To be fair, this post and its title were the work of an individual who has only been in this community for about 3 weeks. And while that individual, an

Re: Confused about sequential definition

2011-07-07 Thread Mark Rathwell
What it means exactly is that there is an interface called Sequential (defined in https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Sequential.java) that some other interfaces and abstract classes implement or extend, and some clojure data structures that you use implement or exte

Re: Please stand firm against Steve Yegge's "yes language" push

2011-07-08 Thread Mark Rathwell
> > I think we need to be careful here about the association between Java > > and Clojure. Sure, they run on the JVM, but that is their *only* > > relationship (from a consumer's point of view) as far as I can see. > Clojure != Java - different paradigms, different mindsets, different > beasts

Re: How to add jar files to leiningen projects?

2011-07-11 Thread Mark Rathwell
To install the jars to your local maven repository (~/.m2): mvn install:install-file -Dfile= -DgroupId= -DartifactId= -Dversion= -Dpackaging= -DgeneratePom=true Where: the path to the file to load the group that the file should be registered under the artifact

Re: How to add jar files to leiningen projects?

2011-07-11 Thread Mark Rathwell
I haven't seen that it can (doesn't mean it can't though ;). It would seem to be a natural option for the 'lein install' task, to add a three argument option: [path-to-jar project-name version], where project-name is the same as in the two argument version (group-id/artifact-id). - Mark On Mon,

Re: How to add jar files to leiningen projects?

2011-07-11 Thread Mark Rathwell
It works for me on OS X (at least install does), however, it requires you to be in a project directory to use. Not really an inconvenience, but it may not be completely obvious to a user installing with the intention of using the dependency in multiple projects that they won't need to repeat this

Re: How to add jar files to leiningen projects?

2011-07-12 Thread Mark Rathwell
Works great, Shantanu. Thanks! On Tue, Jul 12, 2011 at 3:12 AM, Shantanu Kumar wrote: > > It would be ideal if it could be run outside of the project structure, as > > would be the case if an additional arity was added to the install > function > > in leiningen.install. > > Thanks for the report

Re: How to add jar files to leiningen projects?

2011-07-13 Thread Mark Rathwell
lad it worked for you. I have updated the plugin to version 0.2 > with "list" functionality. Will appreciate any feedback/suggestion. > > https://github.com/kumarshantanu/lein-localrepo > > Regards, > Shantanu > > On Jul 12, 6:40 pm, Mark Rathwell wrote: > >

Re: How to add jar files to leiningen projects?

2011-07-14 Thread Mark Rathwell
Looks good to me ;) On Thu, Jul 14, 2011 at 4:31 PM, Shantanu Kumar wrote: > > > On Jul 14, 7:55 am, Mark Rathwell wrote: > > The listing is nice...maybe would be nice to be able to limit the listing > to > > one artifact, or a match of artifacts with wildcards, not

Re: Fixing Java Apache Class error

2011-07-20 Thread Mark Rathwell
Is there a reason you can't just use 'lein repl' (or 'cake repl') since this appears to be a lein or cake project? Then you don't need to worry about specifying classpaths, everything in your project is automatically placed on the classpath. On Wed, Jul 20, 2011 at 9:35 AM, octopusgrabbus wrote:

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
(require '[clj-http.client :as client]) (defn make-url [ca street-1 street-2 city state zip] (let [url " http://MailVerify/Lookup/chkAddr.asp?CA=%s&street=%s&STREET2=%s&CITY=%s&STATE=%s&ZIP=%s "] (format url ca street-1 street-2 city state zip))) (client/get (make-url "xxx" "123 Some St" "A

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
24" "CITY" "New York" "STATE" "NY" "ZIP" "10026"}) (client/get "http://MailVerify/Lookup/chkAddr.asp"; {:query-params q}) On Wed, Jul 20, 2011 at 10:26 AM, Ulises wrote: > try passing a map such as {:query-params

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
You need to specify the base url string as the first argument, and the map is an optional second argument: (client/get "http://..."; {:query-params {"CA" ...}}) On Wed, Jul 20, 2011 at 10:46 AM, octopusgrabbus wrote: > On Jul 20, 10:26 am, Ulises wrote: > > try passing a map such as {:query-pa

Re: [ANN] ClojureScript

2011-07-22 Thread Mark Rathwell
The main target use case seems to be browser based apps that would make heavy use of javascript, the kind of apps that would otherwise be built using with libraries/frameworks such as Google Closure Library, Dojo, SproutCore, Backbone w/ jQuery, etc. Michael Fogus has also mentioned command line s

Re: [ANN] ClojureScript

2011-07-22 Thread Mark Rathwell
No, you cannot use java libraries with ClojureScript, you would instead use the Google Closure Library or pure clojure. Same as with the CLR version, you can only make use of .NET libs. On Fri, Jul 22, 2011 at 1:48 PM, Vincent wrote: > that means , if i write a clojure program using javax.swin

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-24 Thread Mark Rathwell
Wasn't it just a couple weeks ago that you were arguing that everything should be more like Java? Now you're arguing that Google Closure is bad because it has some similarities to Java development (mainly verbosity and documentation). I'm honestly not sure if you are just trying to be controversi

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-24 Thread Mark Rathwell
On Jul 24, 2011 9:32 PM, "Mark Rathwell" wrote: > > Wasn't it just a couple weeks ago that you were arguing that everything > > should be more like Java? Now you're arguing that Google Closure is bad > > because it has some similarities to Java development (mainl

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-24 Thread Mark Rathwell
will be writing code in Clojure (with a "j"), only using the functionality of google's library, in the much the same way as you use the functionality of the JDK, so I'm not sure exactly what it is you are wanting with ClojureScript and jQuery. - Mark On Sun, Jul 24, 2011 at 1:2

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
Colin, I don't think anyone responding was doing so with the mindset of "my way or the highway" and "we must defend the great leader's achievements". Speaking for myself, I responded to an argument that did not make sense, that argument being basically: "Crockford says javascript can be written a

Re: ClojureScript on Windows

2011-07-25 Thread Mark Rathwell
Also, VirtualBox (http://www.virtualbox.org/) is free, if you were interested in linux for some development. On Mon, Jul 25, 2011 at 11:06 AM, Tamreen Khan wrote: > I've gotten the basics working. Haven't had the time to write up a full > blog post, though. Basically I used Cygwin so that I coul

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
heritance and Rich should instead of apologizing for having once > taught it to people apologize for teaching them clojure. > > Fine, I am done with this (-> back to scala); I have better things to > do than being called a "troll". "ignore" me all you want, if that&

Re: [Clojurescript] Any of this in the pipeline?

2011-07-26 Thread Mark Rathwell
Re widgets, see [1] for the ui library documentation. There is a fairly decent widget offering. For custom widgets, you would generally be building on Component, Container, or Control, I would think. Re compilation options, I think there are just the 3 options: Whitespace, Simple, and Advanced.

Re: [Clojurescript] Any of this in the pipeline?

2011-07-26 Thread Mark Rathwell
The thing with GWT is that it is a Java *source* to Javascript compiler, not a JVM byte code to Javascript compiler. So, in order to write Clojure code targetting GWT, you would need to have a Clojure to Java source compiler, something like Mirah offers. On Tue, Jul 26, 2011 at 11:46 AM, Joop Kie

Re: [Clojurescript] Any of this in the pipeline?

2011-07-26 Thread Mark Rathwell
I think there is a lot still to do to get to that point. Closure Inspector [1] provides the ability to map back to JavaScript source, but then you still need to map from that back to the Clojure source, and as you noted, existing Clojure stack traces leave much to be desired. And IDE integration

Re: Cake CLASSPATH Error

2011-07-27 Thread Mark Rathwell
Namespace file locations start from the src directory, in your project directory. So, a file that declares namespace addr-verify should be located in src/addr_verify.clj. A file that declares namespace addr-verify.addr-verify would be found in src/addr_verify/addr_verify.clj. On Wed, Jul 27, 20

Re: Libraries and build management hell

2011-07-28 Thread Mark Rathwell
The problem with jar downloads as the default distribution method is that non-Java people, and even plenty of Java people, seem to have problems consistently setting classpaths correctly. Seems much more straightforward to just have lein take care of that for you. As for complicated installation

Re: Libraries and build management hell

2011-07-30 Thread Mark Rathwell
I'm all for a better, easier solution that is better in most ways. What I'm saying is: 1. I don't want to go back to downloading jar files from the websites of all of the libraries I want to use in a project and tracking different versions, no matter how large or small the project is, as suggeste

Re: Where Are Clojure's (Cake') Build Steps Document

2011-08-01 Thread Mark Rathwell
I don't know much about cake other than that it is basically lein with a persistent JVM and a defines tasks differently, but: 1. lein uses Maven to fetch dependencies. The documentation for Maven can be found at [1]. 2. I'm not sure what type of setup you are looking for in production, but if yo

Re: Best Way To Remove vector from vector of vectors?

2011-08-01 Thread Mark Rathwell
A few more things: - I don't know if you want to be passing the start val to reduce in this case ([]), it's not doing anything here - you have the arguments to > backwards. (> 0 2) in prefix is (0 > 2) in infix notation, so this will always return false in your code since the vector count wil

Re: Including additional js in clojurescript compilation

2011-08-02 Thread Mark Rathwell
Some basic information and tips (start at page 5 or so on [1]): [1] http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t [2] http://code.google.com/closure/compiler/docs/api-tutorial3.html#dangers On Tue, Aug 2, 2011 at 7:59 AM, A

Re: reverse a sequence without reverse or rseq

2011-08-08 Thread Mark Rathwell
user> (source reverse) (defn reverse "Returns a seq of the items in coll in reverse order. Not lazy." {:added "1.0"} [coll] (reduce conj () coll)) On Mon, Aug 8, 2011 at 2:29 PM, MarisO wrote: > Do you know of any trick to reverse a sequence without reverse or > rseq ? > > I wrote i

rebind var for all threads

2011-08-10 Thread Mark Rathwell
There is a function in a library I am using that I want to have rebound to a function of mine for all threads, and can't seem to figure this out, or if it is even possible. binding, push-thread-bindings, in-ns with def, etc. are not working, seemingly because they are only rebinding for the curren

Re: rebind var for all threads

2011-08-10 Thread Mark Rathwell
> alter-var-root It is still somehow using the original binding. I am trying change the binding from aot compiled code, would that change anything? > Even if you can, I don't think you want to. I agree, I don't want to, however, I am trying to get multiple third party libraries to play together

Re: rebind var for all threads

2011-08-10 Thread Mark Rathwell
10, 2011 at 4:54 PM, Mark Rathwell > wrote: > >> alter-var-root > > It is still somehow using the original binding. I am trying change the > > binding from aot compiled code, would that change anything? > > Yes. The compiler probably optimized away the var lookup to a

Re: rebind var for all threads

2011-08-10 Thread Mark Rathwell
Thank you both for the help. >If it's really this serious of an issue, then perhaps the >makers of the libraries will at least accept a patch from you that >adds a hook that will swap out parts of the libraries. Not a serious issue by any means, but I will see what the sentiment is with the libra

Re: rebind var for all threads

2011-08-10 Thread Mark Rathwell
Or, more accurately, not whitelisted, on App Engine. On Wed, Aug 10, 2011 at 6:34 PM, Ken Wesson wrote: > On Wed, Aug 10, 2011 at 5:20 PM, Mark Rathwell > wrote: > > The lib B function uses blacklisted Java classes, ... > > "Blacklisted"??? > > -- > P

Re: tasting pinot noir

2011-08-10 Thread Mark Rathwell
> i would love to read other community-member's opinion > on pinot noir ... I've gotten into these over the last week, and I've got to say, Chris is doing a very nice job on these frameworks. They are really turning into a nicely integrated offering to develop Clojure and ClojureScript web apps.

Re: rebind var for all threads

2011-08-11 Thread Mark Rathwell
(This is all moot at this point, since the author or Noir has made changes that allow it to be compatible with App Engine.) Background: This was with noir version 1.1.0, and appengine-magic version 0.4.3. appengine-magic needs a ring handler, which noir provided with noir.server/gen-handler. H

Re: rebind var for all threads

2011-08-11 Thread Mark Rathwell
>Is the app store for more than just Android >device apps then? Apple has one central app store for iPhone/iPad apps, and now even has one for Mac apps. Android's situation I haven't exactly figured out, but I think there is a central app store somewhat managed by Google, but Amazon also has an a

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
deftest is a macro. Macros are expanded at compile time. So, in this case, at compile time, a function called namespace2 is def'd with meta data :test set to the body of your deftest. All of that body is namespace resolved in macro expansion, before in-ns is ever executed (which happens when you

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
That's neat; I guess I've never thought about how the compiler > treats def. Thanks for the explanation. > > On Aug 15, 3:03 pm, Mark Rathwell wrote: >> deftest is a macro.  Macros are expanded at compile time.  So, in this >> case, at compile time, a function called

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
g 15, 2011 at 8:56 PM, Alan Malloy wrote: > I either disagree or don't understand. The deftest macro doesn't touch > your &body arg; it's expanded as-is. For example, (let [x 'foo] `(inc > ~x)) doesn't result in foo getting qualified, and most macros behave > the

  1   2   3   >