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

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: 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
> 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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Mark Rathwell
27;t see it causing any issues. On Tue, Nov 20, 2012 at 10:47 AM, Kyle R. Burton wrote: > > > On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell > wrote: >> >> You can contact the maintainers at the address found at the bottom of [1] >> and ask them to remove the clj-xp

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Mark Rathwell
You can contact the maintainers at the address found at the bottom of [1] and ask them to remove the clj-xpath group, but you probably don't want to do that if anyone is using the library. [1] https://github.com/ato/clojars-web/wiki/Contact On Tue, Nov 20, 2012 at 10:07 AM, Kyle R. Burton wrote:

Re: First foray into clojure - questions for new project

2012-11-13 Thread Mark Rathwell
> Should I dive into Ring as well? What about Compojure versus Noir? Noir is higher level than Compojure, and usually easier for new people to jump into, but not always as flexible, functional or composable. On Tue, Nov 13, 2012 at 10:27 AM, Jonathon McKitrick wrote: > > Thanks, Michael. > > S

Re: First foray into clojure - questions for new project

2012-11-12 Thread Mark Rathwell
These 4 should help you get from zero to a simple web app running on Heroku pretty quickly: https://github.com/technomancy/leiningen/wiki/Upgrading https://github.com/technomancy/swank-clojure https://github.com/kingtim/nrepl.el https://devcenter.heroku.com/articles/clojure-web-application Some o

Re: ANN: lein-clr for building ClojureCLR projects

2012-10-28 Thread Mark Rathwell
Great work! Really looking forward to NuGet integration. On Sun, Oct 28, 2012 at 9:13 AM, Shantanu Kumar wrote: > Hi, > > I am happy to announce `lein-clr`, a Leiningen plugin for building > ClojureCLR projects: > > https://github.com/kumarshantanu/lein-clr > > As of 0.1.0, dependency mechanism

Re: *foo*

2012-10-09 Thread Mark Rathwell
> It's in there, search Asterisks: Variants, Internal Routines, Mutable Globals Should have noted that's not how it is used in Clojure though On Tue, Oct 9, 2012 at 2:00 PM, Mark Rathwell wrote: > It's in there, search Asterisks: Variants, Internal Routines, Mutable Glob

Re: *foo*

2012-10-09 Thread Mark Rathwell
It's in there, search Asterisks: Variants, Internal Routines, Mutable Globals On Tue, Oct 9, 2012 at 1:58 PM, Grant Rettke wrote: > Gosh I thought it was in there... maybe it is not. Sorry. > > On Tue, Oct 9, 2012 at 12:55 PM, Grant Rettke wrote: >> On Tue, Oct 9, 2012 at 12:54 PM, Brian Craft

Re: What is this function?

2012-10-09 Thread Mark Rathwell
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L588 On Tue, Oct 9, 2012 at 1:03 PM, Larry Travis wrote: > As participants in this googlegroup have often observed, an excellent way to > learn Clojure is to study the source definitions of its API functions. > This advice wo

Re: Clojurejs: a lightweight clojure to javascript compiler

2012-10-08 Thread Mark Rathwell
> Now I'm confused! Isn't clojureScript exactly that? ClojureScript is a Clojure implementation that targets Javascript (meaning that Clojure core, et al, is also necessarily converted to Javascript in the build process and a part of what you ship). I'm assuming this project is a straight transla

Re: Clojure web framework

2012-09-28 Thread Mark Rathwell
> Well there are many usefull libs for web development you can choose this and > that combine them and get something. > But from newbie perspective it's kind of a difficult question where to start > from, what to use, what good practice is. > What lib to use for persistance with Mysql, Postgre, for

Re: Clojure web framework

2012-09-28 Thread Mark Rathwell
> Documentation around libraries (and elsewhere) is recognized > as a primary weakness, but starting a new, larger web Framework project > isn't an obvious solution to that very distributed problem. Agree 100% with this. I think the various libraries are mostly at the right level, and are mostly

Re: Question: Looking at Noir code - hey, are those singletons?

2012-09-13 Thread Mark Rathwell
ake some of that difficult. - Mark On Thu, Sep 13, 2012 at 12:56 PM, Chas Emerick wrote: > On Sep 13, 2012, at 11:57 AM, Mark Rathwell wrote: > >>> If I'm right then defining your 'globals' (for lack of a >>> better word) like this would mean, among oth

Re: Question: Looking at Noir code - hey, are those singletons?

2012-09-13 Thread Mark Rathwell
> If I'm right then defining your 'globals' (for lack of a > better word) like this would mean, among other things, that you really can't > have two independent Noir apps defined/running in the same project - is that > a correct assessment? Just out of curiosity, could you expand on what you mean

Re: function parameters were working, and now I suddenly get a cast error

2012-08-28 Thread Mark Rathwell
See [1]. Valid ServerSocket constructors: ServerSocket() ServerSocket(int) ServerSocket(int,int) ServerSocket(int,int,InetAddress) Your code is trying: ServerSocket(int,string) [1] http://docs.oracle.com/javase/1.4.2/docs/api/java/net/ServerSocket.html On Tue, Aug 28, 2012 at 8:25 PM, larry

Re:

2012-07-29 Thread Mark Rathwell
In your has22 definition, (by-pairs [a]) should be (by-pairs a) On Sun, Jul 29, 2012 at 9:07 AM, John Holland wrote: > I'm doing some exercises in coding that are meant for Java but I'm doing > them in Clojure. I'm stuck on this one. The goal is > to return true if an array of ints contains two c

Re: Experiences developing a crowdfunding site for open source projects in Clojure (from a Python background)

2012-07-27 Thread Mark Rathwell
> Yes, I actually just set it up. Very easy. Thank you. > > Vincent thanks for pointing that out. > > > On Friday, July 27, 2012 3:12:02 PM UTC-5, Mark Rathwell wrote: >> >> > > I haven't setup the "naked" domain, as heroku advises against that. >

Re: Experiences developing a crowdfunding site for open source projects in Clojure (from a Python background)

2012-07-27 Thread Mark Rathwell
ide this capability if you are using them for DNS. On Fri, Jul 27, 2012 at 4:10 PM, Mark Rathwell wrote: > > > I haven't setup the "naked" domain, as heroku advises against that. > > Perhaps I should? > > Usually you can setup a 301 redirect from the naked do

Re: Experiences developing a crowdfunding site for open source projects in Clojure (from a Python background)

2012-07-27 Thread Mark Rathwell
> I haven't setup the "naked" domain, as heroku advises against that. Perhaps I should? Usually you can setup a 301 redirect from the naked domain to www with your registrar. On Fri, Jul 27, 2012 at 4:06 PM, Aaron Lebo wrote: > It is http://www.kodefund.com. > > I haven't setup the "naked" doma

Re: why does this anonymous function work with 'map' but not 'apply'?

2012-07-22 Thread Mark Rathwell
tance. But I want to understand what apply > really does, and I'm clearly missing something. > > > > > > > On Tuesday, July 17, 2012 3:13:04 PM UTC-4, Mark Rathwell wrote: > > your apply will end up doing sometihng like this: > > (#(println

Re: Redefining vars

2012-07-19 Thread Mark Rathwell
partial returns a closure, closing over a at the time b is defined. On Wed, Jul 18, 2012 at 7:18 AM, Alice wrote: > I'm reading Clojure Programming from O'Reilly. > > (defn a [b] (+ 5 b)) > ;= #'user/a > (def b (partial a 5)) > ;= #'user/b > (b) > ;= 10 > (defn a [b] (+ 10 b)) > ;= #'user/a > (b)

Re: why does this anonymous function work with 'map' but not 'apply'?

2012-07-17 Thread Mark Rathwell
> your apply will end up doing sometihng like this: > (#(println %1) "stu" "mary" "lawrence") > > since apply takes @visitors as a collection and passes each item as an > argument to the function you give it. In other words, apply essentially unpacks the collection and passes the items as individu

Re: Light Table on Windows XP

2012-07-05 Thread Mark Rathwell
My guess on this is that you need PowerShell 2.0, just a guess though. It can be download as a part of this package: http://www.microsoft.com/en-us/download/details.aspx?id=16818 On Thu, Jul 5, 2012 at 10:21 AM, Andrew wrote: > fwiw, here's what I see on Windows XP. There are instructions for

Re: Light Table on Windows XP

2012-07-03 Thread Mark Rathwell
What problem are you seeing? I got it working on 64-bit Windows 7, but the instructions on the site set the policy for all users and my user did not have the authority, so I think I had to specify it for the current user only. I also don't remember if I needed RemoteSigned or Unrestricted as the

Re: How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-14 Thread Mark Rathwell
Depending on who else you are wanting to share the dependency with, you may find Phil Hagelberg's s3-wagon-private useful: https://github.com/technomancy/s3-wagon-private On Mon, May 14, 2012 at 4:23 PM, Sean Corfield wrote: > Check out lein-localrepo - a way to install arbitrary JARs in your >

Re: how to get good at clojure?

2012-05-08 Thread Mark Rathwell
> 1. does anyone have advice on getting somewhat > competent for a newb? (alternatively, how did you get good?) - Think of some (smaller) project you've had on your mind for a while, and try to implement it using clojure - Read all of the incoming questions on this list, or StackOverflow if you

Re: Help with clojurescript code for google charts

2012-04-27 Thread Mark Rathwell
Try this: (defn add-rows [] (let [data (js/google.visualization.DataTable.)] (.addColumn data "string" "Topping") (.addColumn data "number" "slices") (.addRows data (clj->js [["Mushrooms" 3] ["Onions" 1] ["Olives" 1]])) data)) (defn chart-options [] (clj->js {:title "How much

Re: Socket Library in Clojure

2012-04-27 Thread Mark Rathwell
Depending on what you are trying to do, you will probably also want to have a look at pallet [1], clj-ssh [2], and clojure-control [3]. [1] http://palletops.com/ [2] https://github.com/hugoduncan/clj-ssh [3] https://github.com/killme2008/clojure-control On Fri, Apr 27, 2012 at 6:15 AM, Baishampa

Re: Clojure alternatives to Esper

2012-04-23 Thread Mark Rathwell
I would start with storm: https://github.com/nathanmarz/storm On Apr 23, 2012, at 9:51 AM, Rogier Peters wrote: > Hi, > > For a java project I have been looking at Esper (esper.codehaus.org), > a component for complex event processing: > > "Complex event processing (CEP) delivers high-speed

Re: Code shared between clj and cljs

2012-04-18 Thread Mark Rathwell
The main options for sharing Clojure and ClojureScript code at this point are: 1. Use lein-cljsbuilds crossover feature [1] 2. Kevin Lynagh's cljx [2] 3. Symlink your .clj source as a .cljs file [1] https://github.com/emezeske/lein-cljsbuild/blob/0.1.8/doc/CROSSOVERS.md [2] https://github.com/lyn

Re: Tornado-like async (web) server framework?

2012-04-15 Thread Mark Rathwell
https://github.com/ztellman/aleph On Sun, Apr 15, 2012 at 9:51 PM, Stefan Arentz wrote: > There is a lovely little web server for Python called Tornado. > > Tornado is an async server that also includes an async http client that plugs > right in the server's event loop. This makes it really simp

Re: noir response

2012-04-13 Thread Mark Rathwell
See [1] for this morning's response to a very similar question ;) There is also a group for Noir-specific questions at [2]. [1] https://groups.google.com/forum/#!msg/clj-noir/mT8L2hnMnNg/jRJ2UdOqKuQJ [2] https://groups.google.com/forum/#!forum/clj-noir On Fri, Apr 13, 2012 at 11:10 AM, Rups wro

Re: Clojurescript standards to integrate other libraries

2012-04-13 Thread Mark Rathwell
Hi, Below are some good resources for the questions you have. Just a note, you can advanced compile your own code that calls out to jQuery, and others, you just can't compile those libraries in. So, there are existing extern files for jQuery, and for other libraries you might be using, you can c

Re: Multiple ClojureScript (sub)projects with shared CLJS libraries per single clojure project

2012-03-30 Thread Mark Rathwell
I haven't tried yet, but lein-cljsbuild [1] is meant to support multiple builds, and I believe something like the below config would be what you are looking for: :cljsbuild { :builds [{:source-path "src/cljs/project1" :compiler {:output-to "resources/public/cljs/script1.js"

Re: Frustrations in being moderated

2012-03-23 Thread Mark Rathwell
>> I'm sure that some level of moderation is necessary to keep the list clean, >> but does it have to be so draconian? > > Hmm, I didn't even know the list was moderated (beyond first post > moderation which I'd assume was the norm on Google Groups). Perhaps > Clojure/core can comment on what the a

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Mark Rathwell
You are trying to call method GetTransform on an instance of vtk.vtkTransform, and this method does not exist (you are probably wanting to call that method on boxWidget, not t). On Thu, Mar 8, 2012 at 12:32 AM, Antonio Recio wrote: > You are right. I have capitalized InteractionEvent and now call

Re: Pretty print defn

2012-03-06 Thread Mark Rathwell
If you are just printing it to the screen, print or println will do what you want. There shouldn't be a need for a pretty printer, the source is already formatted exactly as it was written. On Tue, Mar 6, 2012 at 1:02 AM, Nikem wrote: > Thank you for your help! :) > > I managed to get repl/sour

Re: Pretty print defn

2012-03-02 Thread Mark Rathwell
(clojure.repl/source-fn 'qw) will give you the source. On Fri, Mar 2, 2012 at 10:32 AM, Nikem wrote: > Hi. > > Is it possible to pretty print a source code of the function defined > with defn? I have tried the following: > > (defn qw [] >  (inc 2)) > > (with-pprint-dispatch code-dispatch (pprint

Re: Clojure in Python

2012-02-29 Thread Mark Rathwell
> Currently we have about half of core.clj ported from JVM clojure to > python clojure. I know it's early, but have there been any thoughts/plans around interop and dependency management, possibly providing some sort of bridge between lein and pip/easy_install/virtualenv? And is performance the m

Clojure in Python

2012-02-29 Thread Mark Rathwell
Not sure how many people have seen this, looks interesting though: https://github.com/halgari/clojure-py -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members ar

Re: ClojureScript "use" statement not working

2012-02-25 Thread Mark Rathwell
You must (:use ... :only ...) with ClojureScript On Sat, Feb 25, 2012 at 3:31 PM, Chris McBride wrote: > I have a namespace statement like this: > > (ns alephtest.websocket >  (:require [alephtest.js-utils :as util])) > > If I change this to: > > (ns alephtest.websocket >  (:use alephtest.js-util

Re: lazyness

2012-02-24 Thread Mark Rathwell
Try this (you need to wrap the return val of helper in lazy-seq also): (defn pair-sequences-by ([seq-1 seq-2 f1 f2] "s1 and s2 are guaranteed to be strictly monotonically increasing whith respect to f1 and f2 as keys respectively. The return value is pairs of elements e1 from s1 and e2 fro

Re: Bret Victor - Inventing on Principle

2012-02-24 Thread Mark Rathwell
On Fri, Feb 24, 2012 at 2:25 PM, Jay Fields wrote: > On Fri, Feb 24, 2012 at 2:12 PM, Cedric Greevey wrote: >> On Fri, Feb 24, 2012 at 2:06 PM, gaz jones wrote: >>> Are you Ken Wesson with a new account? >> >> Who? >> >> Wait. Surely you don't think that it's not possible for more than one >> pe

Re: options for a function

2012-02-22 Thread Mark Rathwell
I don't know that there is necessarily a recommended way to offer options. Sometimes people want keyword options, sometime the want to take options as a map, sometimes they need to do it one way or another for various reasons, sometime they do it one way and later learn of a better way. To take o

Re: Print only by clojure code

2012-02-08 Thread Mark Rathwell
other possibilities. Sent from my iPhone On Feb 8, 2012, at 3:15 PM, Tassilo Horn wrote: > Mark Rathwell writes: > >> It's logging, and assuming the logging implementation it is using >> log4j, > > Why do you know that from the information given? > >

Re: Print only by clojure code

2012-02-08 Thread Mark Rathwell
It's logging, and assuming the logging implementation it is using log4j, you can specify the logging properties in a properties file, as system properties, or set the properties in code. The easiest way is to place a file called log4j.properties on the classpath (in the resources directory of your

Re: ClojureScript {:optimizations :advanced}

2012-02-06 Thread Mark Rathwell
In short, yes, if you stick to gClosure, advanced compilation will work fine. Closure advanced compilation is an optimizing compilation that minifies names and removes dead (unused, uncalled) code. Trying to use jQuery without special effort will result in calls to jQuery being unaddressable. Th

Re: How to use goog.dom.query

2012-01-24 Thread Mark Rathwell
You can look at how Pinot does it, some links to get you started: https://github.com/ibdknox/pinot https://github.com/ibdknox/pinot/blob/master/project.clj https://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs https://groups.google.com/forum/#!msg/clj-noir/x5x9vcI-T4E/FaCfb8jhDXoJ On T

Re: Clojure doesn't find java class

2012-01-17 Thread Mark Rathwell
1. Does the mahout-collections jar contain compiled classes? Or only java source? 2. Is the mahout-collections jar making it to the lib directory when you run `lein deps`? On Mon, Jan 16, 2012 at 7:24 PM, joachim wrote: > Hello all, > > I am trying to use the mahout math sparse vector implement

Re: [ANN] ClojureScript One - Getting Started with ClojureScript

2012-01-11 Thread Mark Rathwell
Thank you for this! It looks to be very cohesive and comprehensive, very nice work. On Wed, Jan 11, 2012 at 2:27 PM, Brenton wrote: > Today we are releasing ClojureScript One. A project to help you get > started writing single-page applications in ClojureScript. > > http://clojure.com/blog/2012/0

Re: ClojureScript DOM-manipulation library?

2012-01-06 Thread Mark Rathwell
Pinot [1] provides some dom manipulation [2], mostly wrapping goog.dom stuff. Were you thinking more than that? [1] https://github.com/ibdknox/pinot [2] https://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs On Fri, Jan 6, 2012 at 3:16 AM, Shantanu Kumar wrote: > Is anybody working on

Re: Clojure list syntax sugar: f(x) notation

2011-12-29 Thread Mark Rathwell
The thing about lisps, though, is that code and data are represented with the same structure. Adding sugar that makes them appear to be different things would not help anyone, especially the beginner. It will make grasping macros, among other things, much more difficult down the road. Getting us

Re: same ns multiple file

2011-12-19 Thread Mark Rathwell
in-ns and load are what you are looking for: ;; foo.clj (ns my.foo ... ... (load "foo_a") ;; foo_a.clj (in-ns 'my.foo) ... On Mon, Dec 19, 2011 at 11:37 AM, FD wrote: > Hello, > > In lisp, one can define functions within a package in multiple file. > Files have just to start with (in-package .

Re: Clojurescript, is it ready yet?

2011-12-15 Thread Mark Rathwell
>> >> Is clojurescript ready for wide water? > > > It's getting there. +1 > >> >> How far i can only see obscure compilation env and low level ops on >> html elemnts. > > > I find the compilation environment is quite nice, if there's something you > find confusing you should discuss it. I don't t

Re: help with webserver

2011-12-14 Thread Mark Rathwell
Generally, in production, jetty or tomcat would be fronted by a web server like nginx or apache httpd, and those would be setup to serve your static files. In development, or if you just don't want to set that up, with Compojure you can use compojure.route/files to serve static files [1]. Or, as

Re: Are reader macros and "regular" macros handled differently by the compiler?

2011-12-01 Thread Mark Rathwell
Reader macros are expanded by the reader, "regular" macros are expanded by the compiler. The reader is what translates the text strings that you have typed into Clojure data structures, the compiler translates those data structures into executable code. Clojure does not allow you to define custom

Re: keyword arguments

2011-11-27 Thread Mark Rathwell
> On Nov 27, 8:43 am, Mark Rathwell wrote: >> Also, another way to take keyword arguments is: >> >> (defn foo [& opts] >>   (let [opts (apply hash-map opts)] >>     (println opts))) > > This is what already happens internally with the & {:keys ...} >

Re: keyword arguments

2011-11-27 Thread Mark Rathwell
You can use the :pre and :post assertions on functions. Something like the following would do what you are asking: (defn myfun [& {:keys [arg1 arg2 arg3] :or {arg1 "default-value"} :as args}] {:pre [(every? #{:arg1 :arg2 :arg3} (keys args))]} (println arg1 arg2 arg3 "args:" args)) Also,

Re: Change var in other namespace

2011-11-17 Thread Mark Rathwell
You rebind dynamic vars with binding, so your use would look something like this: (binding [*logger-factory* (log-impl/log4j-factory)] (do-stuff-with-the-logger-factory-rebound)) On Thu, Nov 17, 2011 at 5:17 PM, vitalyper wrote: > clojure.tools.logging defines *logger-factory* and initializes

Re: start-process-shell-command: Spawning child process: invalid argument

2011-11-17 Thread Mark Rathwell
> Do I need Cygwin at all for Clojure work on > Windows/Emacs/Swank/clojure-mode/lein? I don't think so. If lein.bat is on your path and is working, and if emacs and clojure-mode are working, that's really all you need. There are utilities and tools out there that you may want to use at some poi

Re: start-process-shell-command: Spawning child process: invalid argument

2011-11-16 Thread Mark Rathwell
I think there is some path issue in your setup between Cygwin and Windows that will take some work to diagnose. You might try installing everything from scratch, or maybe try a Linux vm with VirtualBox (free) or VMWare. Either way, you can use lein swank and slime-connect in the meantime. On Wed

Re: start-process-shell-command: Spawning child process: invalid argument

2011-11-16 Thread Mark Rathwell
er on port 4005, then M-x slime-connect should connect you and give you a repl). - Mark On Wed, Nov 16, 2011 at 4:15 PM, Andrew wrote: > Having trouble setting up Clojure/Emacs on Windows again. Earlier Mark > Rathwell helped me by pointing out a recipe for Windows that resolved an > iss

Re: Re: java logging properties and lein

2011-11-14 Thread Mark Rathwell
> You still need to load the properties and tell the logger to use them. >  Assuming it is using log4j, something like the following should do > that (completely untested though): > > ... >  (:require [clojure.java.io :as io]) > ... > (with-open [s (io/input-stream (io/resource "logging.properties"

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 i

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] htt

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 wrote: > I

Re: appengine-magic + servlets

2011-11-07 Thread Mark Rathwell
n the external jar. I don't have a > ring handler or a second servlet. I just want to feed this servlet to > appengine-magic. > > Thanks, > Razvan > > On Nov 6, 10:43 pm, Mark Rathwell wrote: >> I'm still having trouble figuring out what it is you are wanting

Re: appengine-magic + servlets

2011-11-06 Thread Mark Rathwell
11 at 3:24 PM, Razvan Rotaru 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 wrote: >> I'm still not quite following.  Wha

Re: appengine-magic + servlets

2011-11-06 Thread Mark Rathwell
e 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) >

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: Empty list type

2011-11-01 Thread Mark Rathwell
On Tue, Nov 1, 2011 at 7:33 PM, David Nolen wrote: > (isa? (type '(:foo :bar)) clojure.lang.IPersistentList) => true > (isa? (type ()) clojure.lang.IPersistentList) => true > (isa? (type (list)) clojure.lang.IPersistentList) => true > (type ()) ;=> clojure.lang.PersistentList$EmptyList EmptyLis

Re: Confusion with doc macro

2011-10-31 Thread Mark Rathwell
~init)] (def ~symbol ~init) (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 wrote: >> def already adds metadata on the s

Re: Confusion with doc macro

2011-10-31 Thread Mark Rathwell
mbol init) > > (= (meta (var symbol)) (meta init)) -> True > > Any suggestions folks? > > Sean Devlin > > On Oct 31, 2:59 pm, Mark Rathwell wrote: >> It uses (meta (var common/basic-logger)). >> >> >> >> >> >> >> >> On

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 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: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-28 Thread Mark Rathwell
On Fri, Oct 28, 2011 at 1:13 AM, e wrote: >> >> >> On Thu, Oct 27, 2011 at 8:26 PM, Mark Rathwell >> wrote: >>> >>> > Maybe it would be clearer if I proposed some other, lesser-used chars, >>> > like >>> > "%(1 2 3 4)" o

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

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 nee

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: [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?

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

Re: lein not configured properly

2011-10-14 Thread Mark Rathwell
ualBox VM (running SimplyMepis) hosted in Windows Vista. > From within the vm I can download those files from a browser. > > On Oct 14, 2:17 pm, Mark Rathwell wrote: >> Are you behind a firewall or proxy that would be blocking .zip files? >> lein search first makes sure it h

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 http://clojars.org/rep

Re: newbie, installation problem

2011-10-14 Thread Mark Rathwell
ouble on Windows until Mark Rathwell suggested > following the instructions at > http://sourceforge.net/apps/wordpress/codesounding/tag/emacs Those instructions are for getting swank-clojure working with emacs on windows. If you want to use emacs as your editor, the workaround presented ther

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 wrote: > When I do M-x clojure-jack-in on one project.clj which uses clojure 1.2.1, > I'm able to evaluate (doc map). > Bu

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Mark Rathwell
> In this point I want to cite Clojure doc, that say nothing about > expansion and runtime,  once more: "..If the operator of a call is a > symbol that names a global var that is a macro function, that macro > function is called and is passed the /unevaluated/ operand forms. " > So, when I write th

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 unpre

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: 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: 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: https://gi

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 to

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, f

Re: ^long vs (long arg)

2011-09-14 Thread Mark Rathwell
On Wed, Sep 14, 2011 at 2:21 PM, Mark Rathwell 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, > but is know

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: lambda function returning a constant?

2011-09-07 Thread Mark Rathwell
r actually use this in real code, 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 wrote: >> How about this: >> >> (#(true)), is this not calling a function that has no arguments and >&

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

Re: coming from statically typed oo languages - how do deal with complex objects graphs in clojure?

2011-09-06 Thread Mark Rathwell
You want an anonymous function: (fn [x] (= x 2)) or the equivalent shorthand form: #(= % 2) Sent from my iPhone On Sep 6, 2011, at 9:35 AM, Dennis Haupt wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > figured it out, i the () were a bit messed up. the working code: > > (def op

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

  1   2   3   >