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 oraclmas...@gmail.com wrote: I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same directory. I started the default clojure editor

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

2010-01-11 Thread Mark Rathwell
/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 oraclmas...@gmail.com wrote: java version 1.6.0_17 clojure 1.1.0 Running on Mac OS X. On Jan 10, 2:46 pm, Mark Rathwell mark.rathw...@gmail.com wrote: your

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

Re: apply with constructors

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

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 similar

Re: Natively Compiled Clojure

2013-01-27 Thread Mark Rathwell
On Sun, Jan 27, 2013 at 1:31 PM, Paul deGrandis paul.degran...@gmail.com 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

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]

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

Re: How To Supply Multiple Values To Function In Map

2011-06-28 Thread Mark Rathwell
except how the symbol col fits into this, unless you're using it as map values. On Jun 28, 3:11 pm, Mark Rathwell mark.rathw...@gmail.com wrote: 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

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/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 mark.rathw...@gmail.com wrote

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 p...@hagelb.org wrote: Mark Rathwell

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 octopusgrab...@gmail.comwrote: Given this function (defn map-func

Re: Filling let local variable from sequence

2011-06-30 Thread Mark Rathwell
? I've tried doseq in the let statement, but get an error. On Jun 30, 2:27 pm, octopusgrabbus octopusgrab...@gmail.com wrote: Thanks. That did it. On Jun 30, 1:22 pm, Mark Rathwell mark.rathw...@gmail.com wrote: One way would be: (defn map-func test map function

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

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: 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, and

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

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=path-to-file -DgroupId=group-id -DartifactId=artifact-id -Dversion=version -Dpackaging=packaging -DgeneratePom=true Where: path-to-file the path to the file to load group-id the

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

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 kumar.shant...@gmail.comwrote: 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.

Re: How to add jar files to leiningen projects?

2011-07-13 Thread Mark Rathwell
: Am glad 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 mark.rathw...@gmail.com wrote: Works great, Shantanu

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 kumar.shant...@gmail.comwrote: On Jul 14, 7:55 am, Mark Rathwell mark.rathw...@gmail.com wrote: The listing is nice...maybe would be nice to be able to limit the listing to one artifact, or a match of artifacts

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

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=%sstreet=%sSTREET2=%sCITY=%sSTATE=%sZIP=%s ] (format url ca street-1 street-2 city state zip))) (client/get (make-url xxx 123 Some St Apt 24 New

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
-params q}) On Wed, Jul 20, 2011 at 10:26 AM, Ulises ulises.cerv...@gmail.com wrote: try passing a map such as {:query-params {CA ca, street street ...}}. On 20 July 2011 16:24, Mark Rathwell mark.rathw...@gmail.com wrote: (require '[clj-http.client :as client]) (defn make-url [ca street-1

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 octopusgrab...@gmail.comwrote: On Jul 20, 10:26 am, Ulises ulises.cerv...@gmail.com

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

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 vincent@gmail.com wrote: that means , if i write a clojure

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

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

2011-07-24 Thread Mark Rathwell
PM, Mark Rathwell mark.rathw...@gmail.com 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 (mainly verbosity and documentation). I'm

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

2011-07-24 Thread Mark Rathwell
, 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:25 PM, James Keats james.w.ke...@gmail.comwrote: On Jul 24, 5:02 pm, Mark Rathwell mark.rathw...@gmail.com wrote

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 histor...@gmail.com wrote: I've gotten the basics working. Haven't had the time to write up a full blog post, though. Basically I used

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

2011-07-25 Thread Mark Rathwell
a troll. ignore me all you want, if that's how you want it then it the world out there will ignore you. (ps. what's quotes below mischaracterizes what my psots) On Jul 25, 1:28 pm, Mark Rathwell mark.rathw...@gmail.com wrote: Colin, I don't think anyone responding was doing so

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

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,

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

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

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 will

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,

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 maris.orbid...@gmail.com wrote: Do you know of any trick to reverse a sequence without reverse or

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

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 mark.rathw...@gmail.com 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 an embedded

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 library

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 kwess...@gmail.com wrote: On Wed, Aug 10, 2011 at 5:20 PM, Mark Rathwell mark.rathw...@gmail.com wrote: The lib B function uses blacklisted Java classes, ... Blacklisted??? -- Protege: What

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.

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

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

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
: Is it? 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 mark.rathw...@gmail.com wrote: deftest is a macro.  Macros are expanded at compile time.  So, in this case, at compile time, a function called namespace2

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
a...@malloys.org 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 same way. On Aug 15, 4:36 pm, Mark Rathwell mark.rathw...@gmail.com

Re: syntax quoting and namespaces misbehaving in test?

2011-08-15 Thread Mark Rathwell
.  [Thrown class java.lang.IllegalStateException] user (ff) #'user/anything5 foo.core2 (in-ns 'foo.core2) #Namespace foo.core2 foo.core2 (def anything6 10) #'foo.core2/anything6 On Mon, Aug 15, 2011 at 9:36 PM, Mark Rathwell mark.rathw...@gmail.com wrote: You are correct, I must have messed something

Re: syntax quoting and namespaces misbehaving in test?

2011-08-16 Thread Mark Rathwell
the def. - Mark On Tue, Aug 16, 2011 at 2:54 PM, Richard Rattigan ratti...@gmail.com wrote: Thanks for your replies. Do you think this is a bug, given that the documentation doesn't seem to concur with this behaviour? On Aug 15, 9:54 pm, Mark Rathwell mark.rathw...@gmail.com wrote: Wow, forget

Re: Problem in downloading StringTemplate using lein deps.

2011-08-22 Thread Mark Rathwell
Stringtemplate is [org.antlr/Stringtemplate 3.2]. Clojure libraries are generally available in Clojars, open source Java libraries are often available in Maven Central. The lein project.clj dependency format is [goupId/artifactId version], from the maven pom format: dependency

Re: Web Services with Clojure

2011-08-24 Thread Mark Rathwell
You can have a look at Compojure [1], Noir[2], and Conjure[3], but if you want the enterprise standard, you will probably need to wrap one of the Java frameworks that do that stuff well. [1] https://github.com/weavejester/compojure [2] https://github.com/ibdknox/noir [3]

Re: is there some gotchas with the contains? function and strings?

2011-08-24 Thread Mark Rathwell
See the doc below. What (contains? [1 2] 1) is testing is whether [1 2] has a value at index 1 (the key value for numerically indexed collections). It does, so it returns true. What you are probably looking for is the Java method .contains of the vector: (.contains [a b] a) ;= true (.contains

Re: ClojureScript and lein?

2011-08-30 Thread Mark Rathwell
The sole alternative to an additional machine in that case is to perform major surgery on an existing one, involving a hard drive repartitioning VirtualBox is free: http://www.virtualbox.org/ On Tue, Aug 30, 2011 at 12:57 PM, Ken Wesson kwess...@gmail.com wrote: On Mon, Aug 29, 2011 at

Re: What are the advantages of clojurescript over straight-forward javascript?

2011-08-30 Thread Mark Rathwell
On Tue, Aug 30, 2011 at 6:06 PM, Mike S mike73...@gmail.com wrote: Two question: 1. Can I use clojurescript with dojo? You should be able to use the advanced compile option with Dojo, it is the only library other than Google Closure to meet the Closure compiler requirements for the advanced

Re: An open call to the community: Let's prepare for 1.3

2011-09-03 Thread Mark Rathwell
I prefer to use ^{:dynamic true} instead of ^:dynamic, unless you're recommending intentionally breaking compatibility with 1.2 so as to encourage people to move to 1.3. What is meant by breaking compatibility? I haven't noticed any issues using ^:dynamic with 1.2, am I missing something?

Re: An open call to the community: Let's prepare for 1.3

2011-09-05 Thread Mark Rathwell
Huh, interesting. I assumed ^:foo meta syntax was new to 1.3, and wouldn't compile at all in 1.2. But now I see that in 1.2 it's equivalent to ^{:tag :foo} - not useful, but not damaging either. I guess I'll start using ^:dynamic myself. Actually, it causes compiler errors, when the compiler

Re: lambda function returning a constant?

2011-09-07 Thread Mark Rathwell
How about this: (#(true)), is this not calling a function that has no arguments and returns true? But it still gives same exception This actually is trying to call 'true' as if it were a function, not a constant. The thing I think you're missing here is: when a symbol is butted up against an

Re: lambda function returning a constant?

2011-09-07 Thread Mark Rathwell
, just for learning. See the other responses for the actual ways to do what you are trying to do. On Wed, Sep 7, 2011 at 8:24 AM, Mark Rathwell mark.rathw...@gmail.com wrote: How about this: (#(true)), is this not calling a function that has no arguments and returns true? But it still gives

Re: ^long vs (long arg)

2011-09-14 Thread Mark Rathwell
The distinction is that you type hint function parameters to tell the compiler that this function parameter will always be of the specified type. You coerce something that may or may not be of a desired type, but is known to cleanly convert to that type. So: (defn add-two [^long x] (+ x 2))

Re: ^long vs (long arg)

2011-09-14 Thread Mark Rathwell
On Wed, Sep 14, 2011 at 2:21 PM, Mark Rathwell mark.rathw...@gmail.com wrote: The distinction is that you type hint function parameters to tell the compiler that this function parameter will always be of the specified type.  You coerce something that may or may not be of a desired type

Re: Is there a reason that def- isn't part of the core lib?

2011-09-17 Thread Mark Rathwell
A previous discussion on the topic can be found here [1]. You can easily add the private metadata yourself: Clojure 1.2: (def ^{:private true} size 25) Clojure 1.3: (def ^:private size 25) I think probably the reason against it is that generally there is not as much reason to use a constant,

Re: clojars question

2011-09-21 Thread Mark Rathwell
Anyone can create their own account on clojars and publish their own forks to their own group name. There are 22 forks of enlive on github, the original is by Chrisotphe Grand [1], [2]. His most recent version published to clojars is 1.0.0. Generally, people try not to publish their own forks

Re: aquamacs, slime and clojure on OS X

2011-09-23 Thread Mark Rathwell
Intentionally avoiding leiningen on ideological grounds will make things more difficult and frustrating for yourself. If you do want to try it out, there are links below to get you started below. You can realistically be up and running with emacs and slime in less than an hour. lein:

Re: can't see the error

2011-09-25 Thread Mark Rathwell
(let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] ((map (print) (iterate ((nextInt dummy) 0) extra parenthesis in three places, and the first argument to iterate is a function, not a long: (let [rand (new java.util.Random) nextInt (fn [a] (.nextInt rand))] (map print

Re: Does macros evaluates its arguments before?

2011-09-26 Thread Mark Rathwell
Use macroexpand-1 to expand a call to this macro, and it should be clear what is going on. The expanded code tries to call 5 as a function. What you are probably trying to do here is make (5 + 2) a list, not a function call. ;; (note the unquote splicing of e) (defmacro infix [e] `(let [[x# f#

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Mark Rathwell
And in this case Closure compiler behave itself also unpredictably and quite the contrary: Where it must evaluate a symbol (like in this case), it doesn't. Symbols need to be namespace resolved in order to be evaluated properly. This is something you need to be aware of, but it is not

Re: unable to resolve symbol: doc

2011-09-30 Thread Mark Rathwell
In 1.3 doc was moved to the clojure.repl namespace. So, at the repl, you can: (use 'clojure.repl) and (doc foo) should work again. On Fri, Sep 30, 2011 at 3:12 PM, Andrew ache...@gmail.com wrote: When I do M-x clojure-jack-in on one project.clj which uses clojure 1.2.1, I'm able to evaluate

Re: newbie, installation problem

2011-10-14 Thread Mark Rathwell
are installation instructions and tutorials for Clooj and Leiningen. Those are generally where you will want to start if you are not familiar with emacs or any of the big Java IDEs. [1] http://dev.clojure.org/display/doc/Getting+Started+for+Beginners Sagar, I had trouble on Windows until Mark

Re: lein not configured properly

2011-10-14 Thread Mark Rathwell
Are you behind a firewall or proxy that would be blocking .zip files? lein search first makes sure it has an updated index from those repositories, and if not tries to download and unzip those index files: http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip

Re: lein not configured properly

2011-10-14 Thread Mark Rathwell
those files from a browser. On Oct 14, 2:17 pm, Mark Rathwell mark.rathw...@gmail.com wrote: Are you behind a firewall or proxy that would be blocking .zip files? lein search first makes sure it has an updated index from those repositories, and if not tries to download and unzip those index

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread Mark Rathwell
Now compare to the proposed change: (set! (. foo :id) my-css-id)) (set! (. ctxt :fillStyle) rgb(255, 150, 0)) In the original discussion in this list, a couple alternatives similar to the following were suggested for property access to remain closer to the Clojure situation: (set! (.:id foo)

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-15 Thread Mark Rathwell
In the original discussion in this list, a couple alternatives similar to the following were suggested for property access to remain closer to the Clojure situation: (set! (.:id foo) my-css-id)) (set! (.:fillStyle ctxt) rgb(255, 150, 0)) Were those thrown out for being too ugly? I didn't

Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-26 Thread Mark Rathwell
The point to think about here is that functions are also lists, the same as your list of integers. The difference is that one is evaluated, the other is not. That is what the quote is saying: don't evaluate me. The quote is not actually a part of the list. It's just the way you tell the reader

Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-26 Thread Mark Rathwell
'(1 2 3) is a list that is not evaluated.  No loss of generality.  it's a special type of list.  One that's not evaluated.  as opposed to a special indicator to the repl. That would essentially be a new data structure, filling a role mostly already filled by vectors. And you would still need

Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-27 Thread Mark Rathwell
Maybe it would be clearer if I proposed some other, lesser-used chars, like %(1 2 3 4) or even 1 2 3 4.  That is, I'm not so much saying, this needs to be treated as data and not eval'd as I am simply saying, this is the 'list' data structure as opposed to some other. A list data structure

Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-28 Thread Mark Rathwell
, 2011 at 1:13 AM, e evier...@gmail.com wrote: On Thu, Oct 27, 2011 at 8:26 PM, Mark Rathwell mark.rathw...@gmail.com wrote: Maybe it would be clearer if I proposed some other, lesser-used chars, like %(1 2 3 4) or even 1 2 3 4.  That is, I'm not so much saying, this needs to be treated

Re: Confusion with doc macro

2011-10-31 Thread Mark Rathwell
It uses (meta (var common/basic-logger)). On Mon, Oct 31, 2011 at 2:28 PM, Sean Devlin francoisdev...@gmail.com wrote: I'm a bit confused by what the doc macro is doing.  Doesn't it simply work of the metadata of what is passed to it? I try this at the REPL: user= (doc common/basic-logger)

Re: Confusion with doc macro

2011-10-31 Thread Mark Rathwell
31, 2:59 pm, Mark Rathwell mark.rathw...@gmail.com wrote: It uses (meta (var common/basic-logger)). On Mon, Oct 31, 2011 at 2:28 PM, Sean Devlin francoisdev...@gmail.com wrote: I'm a bit confused by what the doc macro is doing.  Doesn't it simply work of the metadata of what is passed

Re: Confusion with doc macro

2011-10-31 Thread Mark Rathwell
) (reset-meta! (var ~symbol) m#) (var ~symbol))) Then: (= (meta (var symbol)) (meta init)) ;= true (= (meta (var symbol)) (meta symbol)) ;= true On Oct 31, 4:20 pm, Mark Rathwell mark.rathw...@gmail.com wrote: def already adds metadata on the symbol as metadata on the var.  Did

Re: Empty list type

2011-11-01 Thread Mark Rathwell
On Tue, Nov 1, 2011 at 7:33 PM, David Nolen dnolen.li...@gmail.com wrote: (isa? (type '(:foo :bar)) clojure.lang.IPersistentList) = true (isa? (type ()) clojure.lang.IPersistentList) = true (isa? (type (list)) clojure.lang.IPersistentList) = true (type ()) ;=

Re: appengine-magic + servlets

2011-11-06 Thread Mark Rathwell
I'm not using ring, I have a servlet which I need to feed to appengine-magic. Not sure what you mean by this, could you expand on it a little more? You have an existing Java servlet that you want to handle some url pattern, and you want to integrate that into your appengine-magic app? On Sun,

Re: appengine-magic + servlets

2011-11-06 Thread Mark Rathwell
a ring handler to call def- appengine-app: (appengine-magic.core/def-appengine-app my-app #'my-ring-handler) I have a servlet and want to build an application, something like: (appengine-magic.core/def-appengine-servlet-app my-app #'my-servlet) Razvan On Nov 6, 4:32 pm, Mark Rathwell

Re: appengine-magic + servlets

2011-11-06 Thread Mark Rathwell
at 3:24 PM, Razvan Rotaru razvan.rot...@gmail.com wrote: The servlet is coming from an external jar, which is written in Java. I need appengine-magic for the other services, like datastore. Razvan On Nov 6, 7:45 pm, Mark Rathwell mark.rathw...@gmail.com wrote: I'm still not quite following

Re: appengine-magic + servlets

2011-11-07 Thread Mark Rathwell
. I just want to feed this servlet to appengine-magic. Thanks, Razvan On Nov 6, 10:43 pm, Mark Rathwell mark.rathw...@gmail.com wrote: I'm still having trouble figuring out what it is you are wanting to do, but if you have an existing Java servlet that will handle some url pattern, and you

Re: Including java classes using lein

2011-11-08 Thread Mark Rathwell
J2SE is available by default (since it is included with the JVM). I believe java.lang.* is accessible without importing, and anything else needs to be imported before using, can't remember for sure though. So, (Math/sqrt 25) should just work. On Tue, Nov 8, 2011 at 1:33 PM, megabite

Re: using sqlite3

2011-11-08 Thread Mark Rathwell
Haven't tested, but seems like this should get you started with korma: lein: [korma 0.2.1] [sqlitejdbc 0.5.6] korma [1]: (defdb mydb {:classname org.sqlite.JDBC :subprotocol sqlite :subname db/mydb.sqlite3});; Location of the db [1]

Re: Re: java logging properties and lein

2011-11-14 Thread Mark Rathwell
I put a logging.properties file in the resources directory of the project but it does not seem to pick it up. Do I have to do something else to override the default logging from the java library I am using? You still need to load the properties and tell the logger to use them. Assuming it is

  1   2   3   >