[ANN]: vmwebadm - a CloudAPI implementation for SmartOS in ClojureScript

2012-03-13 Thread Heinz N. Gies
API to order pizza! Best regards, Heinz -- Heinz N. Gies he...@licenser.net http://licenser.net -- 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 member

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

2011-12-30 Thread Heinz N . Gies
think. -- Heinz N. Gies he...@licenser.net http://licenser.net On Dec 29, 2011, at 18:03, Mark Rathwell wrote: > 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 anyo

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

2011-12-29 Thread Heinz N. Gies
think. -- Heinz N. Gies he...@licenser.net http://licenser.net On Dec 29, 2011, at 18:03, Mark Rathwell wrote: > 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 anyo

Re: lein repl syntax highlighting?

2011-07-02 Thread Heinz N. Gies
Some time ago I wrote a highlighter in clojure: https://github.com/Licenser/clj-highlight I guess it would be possible to integrate something like that in a REPL :) On Jul 2, 2011, at 10:51 PM, Antonio Recio wrote: > Is there any way to highlight syntax in lein repl from a terminal? > > -- > Y

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-14 Thread Heinz N. Gies
On May 13, 2011, at 14:37 , David Nolen wrote: > On Fri, May 13, 2011 at 2:04 AM, Heinz N. Gies wrote: > Hearing Pattern Matching, > do you mean Erlang like Pattern matching? > > Regards, > Heinz > > Erlang, OCaml, SML, Haskell, Scala all have the kind of pattern match

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-12 Thread Heinz N. Gies
Hearing Pattern Matching, do you mean Erlang like Pattern matching? Regards, Heinz smime.p7s Description: S/MIME cryptographic signature

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread Heinz N. Gies
Thanks a lot people :) I see there is no best but a ton of possibilities! Your help is very much appreciated Regards, Heinz smime.p7s Description: S/MIME cryptographic signature

Clojure Code Highlighting in Presentations

2011-04-03 Thread Heinz N. Gies
people use for coloring the code in slides? I'd be very thankful for some hints and pointers in the right direction so I don't have to reinvebt the wheel :). Best regards and thanks in advance, Heinz N. Gies smime.p7s Description: S/MIME cryptographic signature

Re: IDE and editors for Clojure

2010-12-02 Thread Heinz N. Gies
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Nov 22, 2010, at 14:36 , HB wrote: > Hi, > I'm pretty sure that this question is already been asked but failed to > find it. > What is your editor/IDE for Clojure? > I didn't try them all, which IDE has the best Clojure support these > days: Intel

Re: does clojure take advantage of multicore

2010-08-22 Thread Heinz N. Gies
On Aug 22, 2010, at 17:48 , Belun wrote: > does clojure take advantage of my multicore processor ? if i write a > program (not using multiple threads) that is going to take 1 day in a > java environment, then will my program run 4 times faster on my 4 core > processor if i build it in clojure ? Hi

Re: gedit syntax highlighting for clojure.

2010-08-21 Thread Heinz N. Gies
There is clj-highlight :) On Aug 21, 2010, at 2:30 , mitko wrote: > Apparently it is not that hard to create something that does decent > job for syntax highlighting for Clojure. It took me about 3-4 hours > starting from zero knowledge. > > With that, and the other gedit plugins such as auto com

Re: ANN: Emacs auto-complete plugin for slime users

2010-08-15 Thread Heinz N. Gies
Steve, this is awesome! Regards, Heinz -- 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 are moderated - please be patient with your first post. To unsubscr

Re: More urgency for CinC & CLR given Oracle's lawsuit against Google?

2010-08-13 Thread Heinz N. Gies
On Aug 13, 2010, at 13:13 , Seth wrote: > Given Oracle's lawsuit against Google for its use of the JVM, is > anyone else suddenly much more concerned about the states of Clojure > in Clojure and CLR compatibility? As far as I understand those things are absolutely not related, oracle isn't suing

Re: Symbol substitution in macro

2010-08-01 Thread Heinz N. Gies
On Aug 2, 2010, at 3:34 , Kyle Schaffrick wrote: > Hello, > > I'm trying to write a library with two main parts. The first is a > macro, I'll call it 'with-feature, that walks through forms passed > inside it, and any time it sees a call to another function in my > library, 'feature, do some tra

Re: Leiningen and loading hooks

2010-07-29 Thread Heinz N. Gies
On Jul 30, 2010, at 6:07 , Phil Hagelberg wrote: > I discovered a problem in Leiningen 1.2.0 that I am debating how to > fix in 1.2.1. The gist is that it searches the whole classpath for all > namespaces matching leiningen.hooks.*, and this is very slow for large > classpaths. It can add several

Re: ANN: Deview - Better test results

2010-07-14 Thread Heinz N. Gies
On Jul 14, 2010, at 15:15 , Paul Stadig wrote: > > Port forwarding would still require switiching back and forth between a > terminal to a browser, no? It would be cool to have difform used in > clojure.test, so that test runs in a terminal could be grasped more > immediately. Ah that is what

Re: ANN: Deview - Better test results

2010-07-13 Thread Heinz N. Gies
On Jul 14, 2010, at 6:40 , Phil Hagelberg wrote: > This is really cool! > > Unfortunately since I spend all my time in the terminal, (for remote > pairing) I can't really use a web-based interface like this for normal > work. Do you have any plans to create a command-line client? How hard > woul

Re: A DSL for writing scripts which have restricted memory and cpu usage

2010-07-12 Thread Heinz N. Gies
On Jul 13, 2010, at 2:44 , Folcon wrote: > > > On Jul 13, 1:36 am, ngocdaothanh wrote: >>> Are there any ways to restrict how many resources a user has access to? >> >> If you use Linux, you see /etc/security/limits.conf. > > That is useful and I will keep that in mind, however I was thinkin

Re: Databases for a Concurrent World

2010-07-11 Thread Heinz N. Gies
On Jul 10, 2010, at 4:10 , David Nolen wrote: > Some benchmarks thoughts on various databases + aleph. > > http://dosync.posterous.com/22516635 > > Cheers, > David Out of curiosity, mind to give it a try with stupiddb? I am very interested how much the saving of stuff from memory makes things

Re: clj-sandbox

2010-07-10 Thread Heinz N. Gies
Now version 0.4.0 is out, it fixes a evil bug that had problems with forms like (. obj (meth arg)) and also introduces a pretty cool new feature: It allows a somewhat save use of def and defn, this is by far not perfect sadly but it is a step towards the direction of having a sandbox that allows

Re: ClojureDocs.org

2010-07-10 Thread Heinz N. Gies
Hi Zack, first of all, great effort there :) having a place for clojure docs is awesome. Two things come to mind: 1) http://github.com/defn/walton - have a look at it, it might be a good way to fetch examples for functions where none are provided yet. 2) Will it be possible to put other 3rd par

Re: examples (like doc)

2010-07-07 Thread Heinz N. Gies
On Jul 7, 2010, at 21:05 , John Cromartie wrote: > I've whipped up a proof-of-concept of how to implement built-in > examples for functions and macros. The general idea is to add an > attribute to the var that contains a list of docstrings and arg lists > or code that illustrate common usage. >

Re: Java3d and clojure?

2010-07-06 Thread Heinz N. Gies
On Jul 6, 2010, at 10:07 , Thomas Kjeldahl Nilsson wrote: > Hello Heinz, > > I'm currently playing around with Penumbra, an OpenGL wrapper for Clojure. It > cuts away some incidental complexity in OpenGL, renames/binds to > cleaner/simpler naming conventions and makes OpenGL feel more "functi

Java3d and clojure?

2010-07-06 Thread Heinz N. Gies
Greetings my lispy friends, since google only turned up very trivial expamels. Is there anyone who works with 3d in clojure? Any experiences wrappers or the like? Regards, Heinz -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Benchmarking clojure code

2010-07-01 Thread Heinz N. Gies
On Jul 1, 2010, at 21:21 , Hugo Duncan wrote: > On Thu, 01 Jul 2010 13:44:25 -0400, Mike Meyer > wrote: > >> Is anyone using anything more sophisticated than clojure.core/time for >> benchmarking clojure code? > > I wrote a benchmarking lib at http://github.com/hugoduncan/criterium Actually t

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-07-01 Thread Heinz N. Gies
> I did: > "Java arrays 18s" is Java arrays in Clojure. > "Plain Java 2s" is Java arrays in Java. One reason here is that clojures literals as 1 2 and 3 you use for array indexes are longs, the aget methods want int's so you've funny casting there which is slow for comparison I've done it on a p

Re: Clojure's n00b attraction problem

2010-07-01 Thread Heinz N. Gies
Okay my 2 cent, just because I like long threads: Clojure as 2 'noob attraction problems' 1) it has no simple setup that just works (I wonder if I can say 'just works' too often but I doubt it). Neither EMACS, nor Eclips, nor Netbeans, nor IntelliJ just work all have their quirks and most of th

Re: usage examples in clojure api docs

2010-06-29 Thread Heinz N. Gies
There is Walton that covers that. Talk to defn in #clojure if you want to know detail Regards, Heinz Sent from my iPad On Jun 29, 2010, at 6:06 AM, cageface wrote: > Several people have suggested that usage examples in the docs would be > helpful and this is something I often find myself wish

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-25 Thread Heinz N. Gies
On Jun 25, 2010, at 12:19 , Nicolas Oury wrote: > Have you tried manual copying of the perm array (as in the scala version)? > It is probably not much better or worse, but it would be nice to have the > same algorithm than scala, for comparaison purpose. Yes the original version did that, the im

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-25 Thread Heinz N. Gies
On Jun 24, 2010, at 23:17 , David Nolen wrote: > Don't have time to dive into this right now, but all I can say is now you are > starting to have an idea what the "other side" looks like. The kind of hoop > jumping you have to do get within 3x of Scala is absurd. Yes to see what the "other side

New Primitive data types (equal branch) - impact on optimized code.

2010-06-24 Thread Heinz N. Gies
So out of curiosity I did some benchmarking of the new equal branch and wanted to see how much I can get out of clojure if I push the limits. Now that said I know equal isn't done yet but I figured it won't hurt. Bad news first, despite all my attempts clojure was still slower then optimized sca

Re: Enhanced Primitive Support

2010-06-24 Thread Heinz N. Gies
Another thing I noticed, clojures array functions are using int's as index, so to get best performance from them you currently need to cast every counter you use to a int by hand so you have (loop [i (int 0)] ... since otherwise there will be a lot of type casting when accessing arrays. So a goo

Re: Enhanced Primitive Support

2010-06-23 Thread Heinz N. Gies
Hmm yesterday Rick said that the new changes give clojure a chance to put down the 'scala is faster then clojure' argument. So I figured I give it a try and implemented some of the shootouts: fannkucken-redux and the regexdna example. I found some interesting things especially once I got carried

Re: Enhanced Primitive Support

2010-06-23 Thread Heinz N. Gies
Other math functions as max, min and so on should behave the same as +, - I think it is kind of confusing if you've a loop with a max and have to cast it to long by hand :) Regards, heinz. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: STM style disk persistance

2010-06-23 Thread Heinz N. Gies
Not really tried that, but something that goes somewhat in the direction, stupiddb - (see on github or explanations on my blog http://blog.licenser.net ). It is not guaranteed persistent sadly since it's not easy to couple IO and Memory transactions and it might be a bit too heavy for a stupid d

Re: Enhanced Primitive Support

2010-06-22 Thread Heinz N. Gies
We always talk about auto promoting ops, is there a way, and I guess the answer will be no, to have auto demoting ops? as in they get (+ (num 1) (num 1)) and return (long 2) if the calling side desires so? As in the function promises to return a Number or better. I know this might die on the fa

Re: Enhanced Primitive Support

2010-06-22 Thread Heinz N. Gies
I'd like to ask something, is there an (open source) project that really got a speed boost from the move to primitive +,- & Co. and is testable / benchmarkable fairly easy? I sadly don't have any of those :( to do it all on my own. I'm not asking to mock, what I'd like to do (for myself) is loo

Re: Enhanced Primitive Support

2010-06-22 Thread Heinz N. Gies
On Jun 22, 2010, at 7:47 , David Nolen wrote: > If you're going to give example of what the current branch is like, at least > write the code how a primitive Clojurian would write it: > ... I feel his examples were on purpose not given as a 'primitive' clojurian or a 'boxing' one would write th

Re: Enhanced Primitive Support

2010-06-21 Thread Heinz N. Gies
On Jun 21, 2010, at 16:52 , Rich Hickey wrote: > I've added the speculative analysis required to detect when recur arguments > fail to match the type of primitive loop locals, and recompile the loop with > those loop args boxed. When *warn-on-reflection* is true it will issue a > report that t

Re: Enhanced Primitive Support

2010-06-21 Thread Heinz N. Gies
On Jun 21, 2010, at 13:40 , Tim Daly wrote: > This debate happened many years ago for common lisp. ... > Rich explicitly said he did not want this solution. > > Tim Daly it would be more or less trivial to make a macro that switches between non promoting + primitive loop and promoting and box

Re: Enhanced Primitive Support

2010-06-20 Thread Heinz N. Gies
On Jun 21, 2010, at 2:19 , Mark Engelberg wrote: > The arguments seem to be winding down, so I thought this would be a > good time to summarize my thoughts. > > My favorite option of those proposed is: > +, *, -, inc, dec auto-promote. > loop/recur is changed so that primitive bindings are boxed

Re: Enhanced Primitive Support

2010-06-20 Thread Heinz N. Gies
On Jun 20, 2010, at 22:03 , Nicolas Oury wrote: > primitive vs modern might not be the right terminology. The main issue I see is not that primitives vs boxed I think when it is done right both will be accepted by the community, the main issue I see is the consequences primitives cause when it

Re: Enhanced Primitive Support

2010-06-20 Thread Heinz N. Gies
On Jun 20, 2010, at 17:57 , Nicolas Oury wrote: > With what I think is 1.2-MASTER, a few weeks old (I start to be a bit lost > with many clojure.jar): > > user=> (loop [i (long 1)] (recur :a)) > # java.lang.IllegalArgumentException: recur arg for primitive local: i must be > matching primitive

Re: Enhanced Primitive Support

2010-06-20 Thread Heinz N. Gies
On Jun 19, 2010, at 15:58 , Rich Hickey wrote: > I am telling you though, if you continue with these "show stopper", "will > keep people from using Clojure" sky-is-falling histrionics, I will stop > reading your messages. My apologies here, simple reason is I love clojure and it is one of the

Re: Enhanced Primitive Support

2010-06-19 Thread Heinz N. Gies
On Jun 19, 2010, at 14:55 , Rich Hickey wrote: > > Yes, that's a bit Java-ish. All we care about here is returning the canonic > boxed representation of the number. It was suggested before that it is simple to allow automatic promotion, by compiling multiple versions. how about doing this? On

Re: Enhanced Primitive Support

2010-06-19 Thread Heinz N. Gies
On Jun 19, 2010, at 14:18 , David Powell wrote: > > (loop [^int n 1 r 1](if (zero? n) r (recur (dec n) (* r 0.2 > > > Numeric literals would still produce primitives where possible, but > would get auto-boxed in loop initialisers. > > I think this option wouldn't have any nasty surprises.

Re: Enhanced Primitive Support

2010-06-19 Thread Heinz N. Gies
On Jun 19, 2010, at 4:12 , Rich Hickey wrote: > I have to say I'm in the 'pay for what you use' camp - you need a box, you > ask for one. If I don't (and neither do any of those loops), why should I > have to do extra work to avoid it? - 42 I totally and wholeheartedly disagree, as long as the

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 19, 2010, at 0:32 , Heinz N. Gies wrote: > > On Jun 18, 2010, at 22:52 , Rich Hickey wrote: > >> Thanks to all for the feedback, keep it coming! Another one: http://gist.github.com/444344 This is the same problem as with the exception but this time it does not crash j

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 22:52 , Rich Hickey wrote: > Thanks to all for the feedback, keep it coming! Okay you asked for it :P to quote from the IRC: mmarczyk: also, (defn fact [n] (loop [n n r 1] (if (zero? n) 1 (recur (dec n) (* r n) throws on (fact 40) -- that's with *, not *' and it trhow

Re: Possible Clojure Bug

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 18:48 , pleone wrote: > I ran this in a slime REPL on AQUAMACS with clojure 1.1. It appears to > be a bug. Am I mistaken? > > user> (def conj-test-vector ["1" "2" "3" "4"]) > #'user/conj-test-vector > user> conj-test-vector > ["1" "2" "3" "4"] > user> (conj conj-test-vector

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 22:02 , Daniel wrote: > This also seems to break the principle of make it work, make it right, > make it fast. Math in Clojure isn't to the point that it works well > yet. Daniel the decision was to keep things working and add speed as an option by using +' (and friends) sp

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 22:52 , Rich Hickey wrote: > I've revised and enhanced the strategy, based upon the feedback here. I think > it is a nice compromise. I agree this is a very nice compromise :) great work again and it is really cool to see how a community effort shapes clojure itself :D Reg

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 16:24 , Nicolas Oury wrote: > I am not sure (= (* 20 not-a-bottleneck) not-a-bottleneck) > > or more precisely: > (= (* 20 not-a-bottleneck-1 ... not-a-bottleneck-250) not-a-bottleneck) Point is, no one will write 250 variables even less so values by hand, it will be a map

Re: Enhanced Primitive Support

2010-06-18 Thread Heinz N. Gies
On Jun 18, 2010, at 15:11 , Rich Hickey wrote: > So, let's go easy on the hyperbole. The behavior might not be what you > desire, but it is not unsafe. I agree with both actually it isn't unsafe but in my eyes undesired, met me explain. In generally it seems we have two options: 1) We make fas

Re: Colon (:) in comments?

2010-06-13 Thread Heinz N. Gies
comment just is a function that says 'don't evaluate the stuff in here, it still needs to be correct clojure code you can either use: ; TODO: x y z or #_(Todo: x y z) On Jun 13, 2010, at 16:13 , j-g-faustus wrote: > Hi, > > I get an exception whenever I put a colon in a multiline comment: >

Re: update-in oddness

2010-06-04 Thread Heinz N. Gies
On Jun 4, 2010, at 16:23 , Chouser wrote: > > I agree with the spirit of your argument, but not your > implementation: > > (update-in* {nil 2} [nil] (constantly 3)) > ;=> 3 As so often Chouser, you are of cause totally right :). I just realized the flaw when I was about to open a ticket but y

Re: update-in oddness

2010-06-04 Thread Heinz N. Gies
On Jun 4, 2010, at 14:11 , Heinz N. Gies wrote: > > On Jun 4, 2010, at 14:03 , Joost wrote: > >> On Jun 4, 1:42 pm, "Heinz N. Gies" wrote: >>> Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 >>> 3})) >> >> Ye

Re: update-in oddness

2010-06-04 Thread Heinz N. Gies
On Jun 4, 2010, at 14:03 , Joost wrote: > On Jun 4, 1:42 pm, "Heinz N. Gies" wrote: >> Sorry I mixed arguments, it should be (update-in {1 2} [] (constantly {2 3})) > > Yes, that gives {nil {2 3}, 1 2} > > You're not giving any key in the key list, so th

Re: update-in oddness

2010-06-04 Thread Heinz N. Gies
On Jun 4, 2010, at 11:15 , Joost wrote: > On Jun 4, 7:37 am, "Heinz N. Gies" wrote: >> Update-in behaves oddly when getting an empty path. (update-in [] {1 2} >> (constantly {2 3})) returns {nil {2 3} 1 2} not {2 3} as I'd expect. get-in >> works well with

update-in oddness

2010-06-03 Thread Heinz N. Gies
Update-in behaves oddly when getting an empty path. (update-in [] {1 2} (constantly {2 3})) returns {nil {2 3} 1 2} not {2 3} as I'd expect. get-in works well with empty pathes so I think this isn't a good behavior. Regards, Heinz -- You received this message because you are subscribed to the

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-02 Thread Heinz N. Gies
On Jun 1, 2010, at 22:26 , Sina K. Heshmati wrote: > "Heinz N. Gies" said: > >> The DNS is fixed, try-clojure.org is now working too :) > > Not anymore! I was actually using it. I missed C-a C-k though. You make me cry :P thanks for the hint this time it was my evi

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread Heinz N. Gies
gt; > On Mon, May 31, 2010 at 4:41 PM, Heinz N. Gies wrote: >> The problem is known and in work, the background is that not all of the DNS >> entries can be configured directly a request with the DNS provider (which >> also hosts my blog) is already filed so I can't say

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-05-31 Thread Heinz N. Gies
The problem is known and in work, the background is that not all of the DNS entries can be configured directly a request with the DNS provider (which also hosts my blog) is already filed so I can't say how long this takes :). Best regards, Heinz N. Gies aka Licenser On Jun 1, 2010, at

Re: Having trouble getting full performance from a quad-core with trivial code

2010-05-30 Thread Heinz N. Gies
On May 30, 2010, at 18:31 , Zak Wilson wrote: > I'm running Clojure code on an early Mac Pro with OS X 10.5 and Java > 1.6. It has two dual-core Xeon 5150s and 5GB of memory. Just a idea, two dual cores != 4 cores. Parallelism on more then one CPU is always slower then on one cpu with multiple c

Re: Which GUI toolkit would you like to see wrapped in an idiomatic Clojure library?

2010-05-27 Thread Heinz N. Gies
+1 For swing especially since I started this already. Look for clj-swing in github, since this seems quite a load of work I'd be glad for any help so :). Regards, Heinz On May 27, 2010, at 21:30 , Luc Préfontaine wrote: > +1 for Swing. > On Thu, 2010-05-27 at 11:59 -0700, Brian Schlining wrote: >

Re: Symetric function to prn

2010-05-24 Thread Heinz N. Gies
Well read can (read) from a stream and if you don't serialize your data structure in one huge pile: [1] [1] [1] [1] vs. [[1] [1] [1] [1]] you can read it lazily. See http://github.com/Licenser/stupiddb/blob/master/src/stupiddb/core.clj#L75 for an example. regards, Heinz On May 24, 2010, at

Re: matchure becoming clojure.contrib.match

2010-05-24 Thread Heinz N. Gies
On May 24, 2010, at 5:41 , Drew Colthorp wrote: > A few weeks ago I announced a pattern matching library called > matchure. I'm excited to say it's being merged into clojure.contrib as > clojure.contrib.match. I'd like some feedback on ideas for some > backward-incompatible changes I'm planning t

Re: a default value for get-in?

2010-05-18 Thread Heinz N. Gies
On May 18, 2010, at 23:08 , Meikel Brandmeyer wrote: > Hi, ... > It's always a good idea to use things we already have: ... > (get (get-in m (butlast ks)) (last ks) not-found))) Hmm this is slowish, you walk ks twice that way, i think the if-let way is better, performance wise. Not sure if it

Re: functional check slower than imperative?

2010-05-18 Thread Heinz N. Gies
On May 18, 2010, at 16:18 , braver wrote: > user=> (time (reps-sorted2? > dreps)) > "Elapsed time: 127606.905 msecs" > true > user=> (time (reps-sorted1? dreps)) > "Elapsed time: 8368.616 msecs" > true > > As you can see, the imperative solution vastly outperforms the > functional one, even thou

Re: with-meta

2010-05-18 Thread Heinz N. Gies
On May 18, 2010, at 14:38 , gL wrote: > Yes, (count mat8x8) is the appropriate method > > Using meta was my mistake to avoid passing the matrix dimension over > and over again. well you can make a function matrix-dim that memorizes the return values :) -- You received this message because you

Re: with-meta

2010-05-18 Thread Heinz N. Gies
On May 18, 2010, at 14:13 , gL wrote: > Hi > > is it good coding style to > > (def mat8x8 > (with-meta > [[0 0 0 0 0 0 0 0] ... > [0 0 0 0 0 0 0 0]] > {:dim 8})) > > and later on to retrieve the matrix dimension with "(:dim (meta > )"? I personally would say no, since th

Re: ANN: try clojure

2010-05-16 Thread Heinz N. Gies
On May 13, 2010, at 7:31 , Heinz N. Gies wrote: > Anyway, enjoy: http://www.try-clojure.org Since Rayens original repo has improved to the point where it had become better then my quick hack fork I've changed the running version back to his original, enjoy! -- You received this

Re: ANN: try clojure

2010-05-14 Thread Heinz N. Gies
On May 13, 2010, at 9:11 , Michael Wood wrote: > By the way, I don't get StackOverflowErrors when I expect to. e.g.: > > ((fn blah [] (+ 1 (blah > > just sits there, apparently doing nothing. On May 13, 2010, at 10:10 , Wilson MacGyver wrote: > Great work, but the tryhaskell link is wr

ANN: try clojure

2010-05-12 Thread Heinz N. Gies
Hi people Raynes and me have figured the community has given us so much so it is time to give something back. We took the effort of making a try-clojure - hence since we are the sandbox guys who is more made for that then us :P. Anyway, enjoy: http://www.try-clojure.org It is not perfect, but i

Re: Calling apply on java methods

2010-05-11 Thread Heinz N. Gies
On May 11, 2010, at 19:39 , Alexandre Patry wrote: > I am trying to call a java method using apply, like : > > (apply .println [System/out "hello" "world"]) > > But I get an error: "Unable to resolve symbol: .println in this context" > > Am I missing something? Apply only works on clojure met

Re: Annoying auto-signature

2010-05-11 Thread Heinz N. Gies
On May 11, 2010, at 19:05 , Marc Spitzer wrote: > it is annoying +1 > > marc > > On Tue, May 11, 2010 at 12:55 PM, Mike Meyer > wrote: >> [format recovered from top postgin.] >> > On May 7, 2:13 am, Mibu wrote: > Am I the only one driven mad by the new auto-appended signature to

Re: History Question

2010-05-07 Thread Heinz N. Gies
usualy pr and pr-str is for that, since str/print does not guarantee you that you can read the stuff back, think of str'ing a str, it looses it's ". On May 6, 2010, at 23:49 , Razvan wrote: > I think it returns :a rather than just a so that you can print stuff, then > read it back in and it woul

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
On May 7, 2010, at 3:34 , gary ng wrote: > > > On Thu, May 6, 2010 at 10:49 AM, Heinz N. Gies wrote: > If I may :) since I'm the sandbox guy. > > > Is it possible to use the sandbox functionalities without the future/thread > part ? Currently no, if it is reall

Re: History Question

2010-05-06 Thread Heinz N. Gies
okay another suggestion: (defn nstr [& ss] (apply str (map #(if (keyword? %) (n-word-function-i-dont-mention %) %) s))) On May 6, 2010, at 21:44 , Sean Devlin wrote: > Okay, next guy to mention name gets shot. Nothing personal. > > On May 6, 2:42 pm, Jeff Heon wrote: >> You could use

Re: History Question

2010-05-06 Thread Heinz N. Gies
(name :a) gives you "a" :), and I think the reason is that str shows the type somewhat, just as (str '(1 2 3)) or (str [1 2 3]) Regards, Heinz On May 6, 2010, at 21:33 , Sean Devlin wrote: > Why does (str :a) return ":a" and not "a"? I have to work around this > a lot, and I'm just curios what

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
On May 6, 2010, at 20:57 , Anniepoo wrote: > Mibu - I've kind of gone around this track as well. > My first reaction to the 'whitelist' was that it was kind of kludgy, > and fought it for a long time, but after a lot of looking for other > ways, I'm with Licenser, it's the best way to do it. Whit

Re: Restricted eval

2010-05-06 Thread Heinz N. Gies
If I may :) since I'm the sandbox guy. On May 6, 2010, at 18:18 , Mibu wrote: > I mentioned in the first message that javaop should also be disabled > in a restricted eval. > > On May 6, 5:18 pm, gary ng wrote: >> On Thu, May 6, 2010 at 4:19 AM, Mibu wrote: >>> As far as I can tell, clj-sandbo

Re: StackOverflow exception problem in filter

2010-05-03 Thread Heinz N. Gies
On May 3, 2010, at 20:20 , Stuart Halloway wrote: > Not all the way to a solution, but here is a trivial example that > demonstrates the issue: > > (def x > (loop [ct 0 > s (lazy-seq)] >(if (> ct 1) > s > (recur (inc ct) (lazy-seq (filter identity s)) > > x > =>

Re: Calling for advice on a parser's location data

2010-05-02 Thread Heinz N. Gies
On May 3, 2010, at 3:29 , joshua-choi wrote: > Can you think of an instance where the location would not be a line > number and column number, such as {:line 3, :column 25}? I'd also add :file there (while this does not need to be a physical one it can come in handy) -- You received this mess

Re: clojure 1.2 seq fn enhancement FAQ

2010-05-01 Thread Heinz N. Gies
On Apr 30, 2010, at 14:33 , Rich Hickey wrote: > > 'contains?' and 'get' abstract over fast lookup. They are polymorphic on the > collection type and on the nature of the looked-up thing. For maps the > looked-up thing is a key, for sets: a value, for vectors, strings and arrays: > an index.

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-30 Thread Heinz N. Gies
On Apr 30, 2010, at 9:15 , ataggart wrote: > > > On Apr 29, 10:43 pm, David Nolen wrote: >> My rule of thumb is: >> >> use + :only >> require + :as > > > (inc *1) (inc *1) (conj *2 " Also use is handy for your own nameslaces, if you've a project that consists out of more then one to help y

Re: seq-contains? in practice

2010-04-29 Thread Heinz N. Gies
On Apr 29, 2010, at 15:10 , Stuart Halloway wrote: > "In theory, there is no difference between theory and practice. In practice, > there is." -Yogi Berra (maybe). ... > Also, AFAICT, there are *no* examples of using instance checks to select the > right containment function. So the theoretical

Re: tutorial on clojure protocols 1.2

2010-04-27 Thread Heinz N. Gies
On Apr 26, 2010, at 18:20 , Stuart Halloway wrote: > I have created a short (30 min) tutorial on clojure protocols at > http://vimeo.com/11236603. Hope some of you will find it useful. Stuart, this was a awsome tutorial, I've never really gasped what protocols are and do from the talks on #cloj

Re: How to deal with clojure versions in libs

2010-04-22 Thread Heinz N. Gies
On Apr 19, 2010, at 7:52 , Heinz N. Gies wrote: > Hi phil, > thanks for the answer many good points there. So just to be sure, if I don't > add a :gen-class (which I don't need to in my case) I can use the lib with > both 1.1 and 1.2 w/o problems (save for the named ones)

Re: Execute a string containing a form?

2010-04-22 Thread Heinz N. Gies
On Apr 22, 2010, at 14:28 , Douglas Philips wrote: > eval can be a dangerous thing to use, you have to be very careful about where > the source has come from, in terms of trusting that the code your programs > 'eval's will not be malicious or dangerous in some way. There are no absolute > rules

Re: Examples of Clojure in production?

2010-04-21 Thread Heinz N. Gies
On Apr 19, 2010, at 5:55 , Daniel Glauser wrote: > I would like to start a thread about Clojure use in production. Who > is using it? And for what? What kind of load do you have on the > system in terms of approximate transactions per day? Would you mind > if your example was featured in a pr

Re: version compatibility between clojure and clojure-contrib

2010-04-20 Thread Heinz N. Gies
On Apr 20, 2010, at 4:01 , John Sanda wrote: > I am working with a simple leiningen project with the build defined as > follows,' > > ; project.clj > (defproject myproject "1.0.0-SNAPSHOT" > :description "FIXME: write" > :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"] >

Re: New Recruit

2010-04-18 Thread Heinz N. Gies
Welcome llcawthorne! Glad to have you here :) also as a advice :visit the IRC channel #clojure (on freenode) since the community there is incredible :) Regards, Heinz On Apr 18, 2010, at 16:54 , llcawthorne wrote: > > Hello! > > I normally lurk on lists a bit before introducing myself (if I e

Re: How to deal with clojure versions in libs

2010-04-18 Thread Heinz N. Gies
tch. This gets > tedious if there are many. > > Hope that helps. This is a relatively new problem for clojure, so the issues > haven't been totally figured out yet. > > - Phil > > >> On Apr 18, 2010 6:22 AM, "Heinz N. Gies" wrote: >&g

How to deal with clojure versions in libs

2010-04-18 Thread Heinz N. Gies
Hi I'm not certain how to approach this problem the best, since libraries are compiled class files they are statically linked to the clojure and c.c version they were compiled with. Please correct me if I'm wrong. Now also between 1.1 and 1.2 some namespaces changed entirely so some code had to

Re: ANN: lein-search

2010-04-09 Thread Heinz N. Gies
On Apr 9, 2010, at 9:10 , Alex Osborne wrote: >> per regular expression matching. > > I've cronned a job to dump out the list of jars, both as relative paths > to the POM files and in Leiningen syntax. See this wiki page for the > details: > > http://wiki.github.com/ato/clojars-web/data > > It

ANN: lein-search

2010-04-08 Thread Heinz N. Gies
Some people might have had to endure my complains about maven already (no worries this isn't one of them). Them aside I usually don't complain without attempting to do something against the problem I see. So here you go lein-search. It's by far not perfect and surely not the nicest or best way

Re: Choosing a Clojure build tool

2010-03-25 Thread Heinz N. Gies
On Mar 25, 2010, at 19:55 , Chas Emerick wrote: > I published a blog post earlier today, along with a short screencast that > might be of interest: > > "Like any group of super-smart programmers using a relatively new language, a > lot of folks in the Clojure community have looked at existing

Re: How to use Clojure with Robocode

2010-03-20 Thread Heinz N. Gies
On Mar 19, 2010, at 8:56 , ubolonton wrote: > Hi, > > Has anyone been able to use Clojure with Robocode? > I've followed this http://www.fatvat.co.uk/2009/05/clojure-and-robocode.html > but got the error Hi, I hope that in a week or two I am able to release a 'mini game' as a tech demo for som

Re: lazy-xml returns 503 from w3.org

2010-03-20 Thread Heinz N. Gies
On Mar 20, 2010, at 7:20 , Brian Sletten wrote: > Turn off validation. Google around, you will find the parameters to do so. I read a article about this some while ago. the java XML parser aheads the standard definition be downloading the DTD from the w3c. While the w3c made up this silly guid

  1   2   >