Re: unexpected partition behaviour

2008-12-17 Thread Remco van 't Veer
On Wed, Dec 17, 2008 at 1:55 PM, Rich Hickey wrote: > > > > On Dec 17, 3:43 am, "Remco van 't Veer" wrote: >> Hi all, >> >> First off, thanks for clojure! I've been playing with it for a couple >> days now and love it! >> >

unexpected partition behaviour

2008-12-17 Thread Remco van 't Veer
Hi all, First off, thanks for clojure! I've been playing with it for a couple days now and love it! Doing ruby in my day job, I've found some quirks I don't really understand. Most of them are obviously me being new to clojure and a lisp "beginner". But the following keeps bugging me: user

Re: A Common Lisp format function for Clojure now up

2008-12-22 Thread Remco van 't Veer
Good morning Tom, Skimming through the code I found: (defmacro aif [test then-form else-form] `(let [~'it ~test] (if ~test ~then-form ~else-form))) The test form is evaluated twice, probably not what you want. You could replace this macro with an (or ..) form

Re: Emacs+SLIME+Clojure troubles

2009-01-01 Thread Remco van 't Veer
I got repl to start with a small change to swank-clojure: http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779ad6e79e37a44d84432 On Thu, Jan 1, 2009 at 1:44 AM, Mark Hoemmen wrote: > I've been having trouble with Emacs + SLIME + Clojure. I've been > using Bill Clementson's

android app development with clojure

2009-01-31 Thread Remco van 't Veer
I've been playing around with clojure on the android platform. To my surprise it was pretty easy to get running, after removing the bean method from the clojure.jar as hinted by Rich somewhere. Of course clojure code needs to be compiled AOT and eval doesn't work, as was to be expected, but all

Re: android app development with clojure

2009-01-31 Thread Remco van 't Veer
ArrayList methods = new ArrayList(); ArrayList bridgeMethods = new ArrayList(); On Sat, Jan 31, 2009 at 3:55 PM, Remco van 't Veer wrote: > I've been playing around with clojure on the android platform. To my > surprise it was pretty easy to get running, after removing

Re: Amsterdam.clj

2009-02-02 Thread Remco van 't Veer
Great idea! Maybe you would like to join ACK: http://groups.google.com/group/amsterdam-rb/browse_thread/thread/2a38b6b85f3e7bbb A small get together initiated by Rubyist in Amsterdam. Next meeting is next monday. At least two of us, myself included, are happily hacking clojure. On Mon, Fe

Re: android app development with clojure

2009-02-04 Thread Remco van 't Veer
Caching Reflector.getMethods, as described below, works pretty well. Performance seems acceptable for now. Startup time is still dramatic, need to investigate. Considering releasing changes as a fork on github is anybody is interested. On Sat, Jan 31, 2009 at 8:35 PM, Remco van 't Veer

Re: android app development with clojure

2009-02-04 Thread Remco van 't Veer
tty please. Remco On Feb 4, 2009 3:59 PM, "igorrumiha" wrote: On Feb 4, 10:12 am, "Remco van 't Veer" wrote: > Caching Reflector.getMethods,... I would also be interested in running Clojure on the Android. I tried running a "Hello world" application on the em

Re: android app development with clojure

2009-02-05 Thread Remco van 't Veer
bypassing LispReader. Need to learn more about GeneratorAdapter, and need sleep, before I can speedup the loading of, for instance, seq contants. My changes are available at github; http://github.com/remvee/clojure Remco On Wed, Feb 4, 2009 at 5:55 PM, Remco van 't Veer wrote: > Having a lisp

Re: android app development with clojure

2009-02-06 Thread Remco van 't Veer
Got startup time down to 5 seconds by completely eliminating the use of lispreader and putting of loading the xml, set and zip namespaces. There's no clear bottlenecks left to fix. On Fri, Feb 6, 2009 at 1:06 AM, Remco van 't Veer wrote: > I've managed to get to startup

patch to improve startup time on low end hardware

2009-02-10 Thread Remco van 't Veer
Hi Rich, I've been working on getting clojure in a more usable state for android [1]. One of the challenges was to speedup startup time. A lot of time is spend in the lisp-reader because all constants are stored as lisp expressions. I've replace most of this code by a more direct approach; emi

Re: patch to improve startup time on low end hardware

2009-02-10 Thread Remco van 't Veer
On Tue, Feb 10, 2009 at 1:33 PM, Rich Hickey wrote: > On Feb 10, 3:47 am, "Remco van 't Veer" wrote: >> Hi Rich, >> >> I've been working on getting clojure in a more usable state for android >> [1]. One of the challenges was to speedup start

Re: patch to improve startup time on low end hardware

2009-02-11 Thread Remco van 't Veer
On Tue, Feb 10, 2009 at 1:57 PM, Remco van 't Veer wrote: > On Tue, Feb 10, 2009 at 1:33 PM, Rich Hickey wrote: >> On Feb 10, 3:47 am, "Remco van 't Veer" wrote: >>> Hi Rich, >>> >>> I've been working on getting clojure in a more us

r1265 causes VerifyError on dalvik

2009-02-12 Thread Remco van 't Veer
Should I open in issue for this? W/dalvikvm( 214): VFY: unable to resolve virtual method 6650: Ljava/ lang/StringBuilder;.append (C)Ljava/lang/AbstractStringBuilder; W/dalvikvm( 214): VFY: rejecting opcode 0x6e at 0x0043 W/dalvikvm( 214): VFY: rejected Lclojure/core$slurp__4218;.invoke (Ljav

Re: r1265 causes VerifyError on dalvik

2009-02-12 Thread Remco van 't Veer
Done: http://code.google.com/p/clojure/issues/detail?id=77 On Thu, Feb 12, 2009 at 2:06 PM, Rich Hickey wrote: > > > > On Feb 12, 5:30 am, "Remco van 't Veer" wrote: >> Should I open in issue for this? >> >> W/dalvikvm( 214): VFY: unable t

Re: patch to improve startup time on low end hardware

2009-02-12 Thread Remco van 't Veer
Created issued including patch: http://code.google.com/p/clojure/issues/detail?id=78 The CA is in the mail. On Wed, Feb 11, 2009 at 2:08 PM, Rich Hickey wrote: > > > > On Feb 11, 4:36 am, "Remco van 't Veer" wrote: >> On Tue, Feb 10, 2009 at 1:57

Re: clojure.xml & whitespace

2009-02-18 Thread Remco van 't Veer
Maybe *ignore-whitespace* is a beter name since it doesn't remove anything and will retain some of it. I would prefer it to default to true. On Wed, Feb 18, 2009 at 12:59 PM, Christophe Grand wrote: > > clojure.xml currently removes significant whitespaces. I guess that > people processing xml

Re: clojure.xml & whitespace

2009-02-18 Thread Remco van 't Veer
ssing xml as mark-up don't). What's the best way to accomodate >> > these to use cases? Through a *remove-all-whitespaces* var? > > On Feb 18, 6:29 am, "Remco van 't Veer" wrote: >> Maybe *ignore-whitespace* is a beter name since it doesn't remove

Re: android app development with clojure

2009-03-17 Thread Remco van 't Veer
ve you posted any code or advice/instruction on >> how one could repeat what you did with Clojure on theAndroidphone? >> >> Rob >> >> On Feb 6, 12:29 pm, "Remco van 't Veer" wrote: >> >> > Got startup time down to 5 seconds by completel

Caching reflected methods (Re: Game of Life)

2009-03-19 Thread Remco van 't Veer
I've noticed a related performance bottleneck when working with clojure on dalvik. Without type hints methods get looked up using reflection every time using clojure.lang.Reflector.getMethods. A lot if time is spend in this method while the results can easily be cached. This is probably only rel

Re: Clojure and swank on Android?

2009-03-30 Thread Remco van 't Veer
Dalvik (the VM android uses) only runs AOT compiled Clojure code. Swank needs to be able to compile Clojure code at runtime. This is not (yet) possible on Dalvik because it uses incompatible bytecode; compiled classes need to be translated to DEX files before being deployed on android. I doubt r

Re: Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread Remco van 't Veer
On Wed, Apr 1, 2009 at 12:00 PM, David Sletten wrote: > [snip] > I'm going to move forward with the negotiations, but I need to know > if you, the Clojure community, are on board here. Ultimately the > decision is going to come down to whether or not you find the APRiL > 1.0 technology useful. T

Re: clojure + android

2009-04-07 Thread Remco van 't Veer
On Mon, Apr 6, 2009 at 6:28 PM, Nick Levine wrote: > I've been trying to get clojure + android going but without much > success. In case it's relevant, I'm on Windows (XP) and the java > version is 1.6.0_13. > > I followed http://riddell.us/tutorial/android/android.html and > http://riddell.us/t

Re: clojure + android

2009-04-07 Thread Remco van 't Veer
: > Remco, > > Thanks for the hint. Log follows. > > - nick > > On Apr 7, 8:36 am, "Remco van 't Veer" wrote: > [...] >> What does logcat report?  (use "adb logcat" on the commandline or "M-x >> android-logcat" if you're us

Re: clojure + android

2009-04-07 Thread Remco van 't Veer
AM, Nick Levine wrote: >> >> On Apr 7, 8:36 am, "Remco van 't Veer" wrote: >> >[...] >> > What does logcat report?  (use "adb logcat" on the commandline or "M-x >> > android-logcat" if you're using my emacs minor mode). >

Re: Got a Clojure library?

2009-04-08 Thread Remco van 't Veer
Name: clj-android URL: http://github.com/remvee/clj-android/ Author: Remco van 't Veer Categories: android framework License: MIT Dependencies: clojure Description: Basic application framework for building Android applications using Cl

ANN: clj-android

2009-04-08 Thread Remco van 't Veer
It's still very basic but in light of current interest in running Clojure on Android, I've released my work on setting up a framework for Android application development into the wild. The code is available at: http://github.com/remvee/clj-android/ Beware: it's experimental and incomplete! T

Re: ANN: clj-android

2009-04-09 Thread Remco van 't Veer
On Thu, Apr 9, 2009 at 1:23 PM, Onorio Catenacci wrote: > [..] > > I know you were mentioning some real performance issues when starting > a Clojure app from Android (I see them too).  I wonder if using > TraceView to profile the Dalvik code generated by the conversion from > the Clojure bytecod

Re: ANN: clj-android

2009-04-09 Thread Remco van 't Veer
On Thu, Apr 9, 2009 at 3:17 PM, Rich Hickey wrote: > On Apr 9, 8:03 am, "Remco van 't Veer" wrote: >> On Thu, Apr 9, 2009 at 1:23 PM, Onorio Catenacci wrote: >> > [..] >> >> > I know you were mentioning some real performance issues when starting

Re: ANN: clj-android

2009-04-14 Thread Remco van 't Veer
On Tue, Apr 14, 2009 at 2:40 PM, Rich Hickey wrote: > On Apr 9, 10:28 am, "Remco van 't Veer" wrote: >> On Thu, Apr 9, 2009 at 3:17 PM, Rich Hickey wrote: >> A blocker for dalvik is issue 77; >> >>  http://github.com/remvee/clojure/commit/7c110dc00895

Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread Remco van 't Veer
Cool! Please share the code on github or whatever. I've been looking at reducing the memory footprint so I tend to consider including dex into your app as a bad thing. But it would be really cool to do the slime dance during development. I guess a more efficient approach lures in the bsh imple

Re: Would it be possible to make a "dumped" clojure, a la dumped emacs?

2010-04-04 Thread Remco van 't Veer
AFAIK, there's only one issue keeping the current master (and 1.1) from running on Dalvik: https://www.assembla.com/spaces/clojure/tickets/199-chunked-seqs-support--for--byte-code-can-t-be-converted-to-dex-for-dalvik So clone the 1.1.x branch from Rich and revert commit 306ef6 and it may just wor

Re: ?: create static inner Java class with constructor argument

2010-04-12 Thread Remco van 't Veer
It's: javax.sound.sampled.Line$Info alux writes: > Hello, > > sorry, I'm a bit slow today. I try to create an instance of a Java > class I want to use, and am just confused. > > The Java code is > > import javax.sound.sampled.*; > > ... > > Line.Info li = new Line.Info(Object.class); > > My two

ANN: clj-base64

2010-04-20 Thread Remco van 't Veer
A very basic library of functions for encoding and decoding strings (sequences of characters) using the base64 coding scheme. Code: http://github.com/remvee/clj-base64 Clojars: http://clojars.org/clj-base64 Lein it up with: [clj-base64 "0.0.0-SNAPSHOT"] Usefulness: network protocol rela

Re: clojure.contrib.sql insert id

2010-04-20 Thread Remco van 't Veer
I am doing the following after an insert for a Derby database: (sql/with-query-results res ["VALUES IDENTITY_VAL_LOCAL()"] (first (vals (first res For MySQL it would be something like: (sql/with-query-results res ["SELECT LAST_INSERT_ID()"] (first (vals (first res I

Re: clojure.contrib.sql insert id

2010-04-21 Thread Remco van 't Veer
Nice! That's a lot better than depending on some quirky sql construct. Thanks, Remco Saul Hazledine writes: > On Apr 20, 8:51 pm, Remco van 't Veer wrote: >> I am doing the following after an insert for a Derby database: >> >>   (sql/with-query-results res >

Re: Clojure on Android

2010-05-21 Thread Remco van 't Veer
On 2010/05/20 23:50, Mike Meyer wrote: > Clojure on Android isn't hard to set up, but performance isn't very > good. IIRC, there are two issues: both reflection and GC - which > Clojure tends to use heavily - are slow on Dalvik. Possibly Froyo will > help with that. Froyo will include JIT for dal

Re: Clojure on Android

2010-05-25 Thread Remco van 't Veer
On 2010/05/21 15:32, Remco van 't Veer wrote: > BTW the latest clojure may work on dalvik but probably won't due to > issue #199[1]. Checkout my clojure fork[2] for an ancient version of > clojure that does work on dalvik. I just confirmed the current master branch does run o

Re: Clojure Master on android

2010-05-28 Thread Remco van 't Veer
On 2010/05/28 01:45, MHOOO wrote: > After reading on the dev group about running clojure on android I > figured I might just as well try the hello-dalvik example myself. > However the master branch fails because it is exhausing the heap?: > > ---

Re: Clojure Master on android

2010-05-28 Thread Remco van 't Veer
May 28, 9:26 am, Remco van 't Veer wrote: >> >> Try giving the dx command a bit more memory by adding something like: >> >>   -Jmx1024m >> >> before --dex. >> > Unfortunately that didn't work quite so well. The java process ended > up using

Re: Android 'dex' stage takes a very long time with Clojure

2010-05-29 Thread Remco van 't Veer
Nice! This will speedup development and allow you to workaround the terribly long startup time with a distracting splash screen. On 2010/05/29 01:06, MHOOO wrote: > I've just started with development on android myself, but from what > I've read on the internets, you could probably write a .dex

Re: JIT Compilation on Android

2010-05-29 Thread Remco van 't Veer
The dalvikvm does not run java classes and has a different instruction set. That's why you need to do the dex step before deploying your code on android. George Jahad did get a repl/eval to run on android some time ago. See: http://groups.google.com/group/clojure/browse_thread/thread/14725172

Re: Modify clojure startup behavior

2010-05-31 Thread Remco van 't Veer
On 2010/05/31 14:25, MHOOO wrote: > I'd like to have clojure *not* `(load x)` where x is at least: > clojure.zip, clojure.xml, clojure.set > when starting clojure up. I didn't really find any place in the > clojure code where I could do that except remove the entire subsystem > from the ant build.

Re: On retrieving auto-generated IDs after INSERT

2010-08-11 Thread Remco van 't Veer
There was a thread about this some months ago; http://groups.google.nl/group/clojure/browse_thread/thread/e95d4778301be699/ Somebody came up with his own version of insert-record: http://gist.github.com/373564#LC62 On 2010/08/11 09:10, Shantanu Kumar wrote: > Hi, > > I need to retrieve au

Re: Why Jetty? (web development)

2010-09-01 Thread Remco van 't Veer
On 2010/09/01 09:12, Sean Corfield wrote: > It seems that all the Clojure web frameworks expect you to be using > Jetty - what about deploying to Tomcat or Resin or JBoss or...? I've used Jetty in the past for development because it was (probably still is?) the smallest, lightweight, no nonsense

Re: Web Development - templating?

2010-09-01 Thread Remco van 't Veer
On 2010/09/01 09:24, Sean Corfield wrote: > On Wed, Sep 1, 2010 at 12:16 AM, Meikel Brandmeyer wrote: >> I have good experiences with enlive[1]. There you write your templates >> in normal HTML files and modify them from Clojure via CSS-style >> selectors. > > That's pretty horrible. > > I guess

into map with vectors versus lists (Re: Creating map from string)

2010-12-04 Thread Remco van 't Veer
I expected this to work: (into {} (partition 2 (split (slurp "data") #","))) But unfortunately, `into' doesn't seem to allow pushing lists of pairs into a map. But vectors are allowed: (into {} (map vec (partition 2 (split (slurp "data") #"," Can somebody explain why vectors are allowe

Re: get the total memory used by a data structure?

2010-12-23 Thread Remco van 't Veer
On 2010/12/23 05:51, Robert McIntyre wrote: > I think it would be really cool to have a function that gives the > total number of bytes that a data structure consumes. > > so something like: > > (total-memory [1 2 [1 2]]) > > would return however many bytes this structure is. > > Is there already

Re: Let's see how fast we can make this

2010-12-23 Thread Remco van 't Veer
Simpler and faster: (count (clojure.string/replace s " " "")) On 2010/12/22 18:52, Rayne wrote: > I have a piece of code, and I'd like to see how fast it can be. > > (defn count-num-chars [^String s] > (loop [s s acc 0] > (if (seq s) > (recur (rest s) (if (= (first s) \space) acc

Re: Let's see how fast we can make this

2010-12-23 Thread Remco van 't Veer
On 2010/12/23 18:30, Ken Wesson wrote: > On Thu, Dec 23, 2010 at 3:24 AM, Remco van 't Veer wrote: >> Simpler and faster: >> >>  (count (clojure.string/replace s " " "")) > > Simpler, yes, but not at all faster: > > Time (in nanoseco

Re: A Web Server in Clojure

2011-01-03 Thread Remco van 't Veer
Try adding CR to your LF's. RFC 1945 states: HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker for all protocol elements except the Entity-Body (see Appendix B for tolerant applications). The end-of-line marker within an Entity-Body is defined by its associated media