Re: dynamically generated let bindings

2011-07-29 Thread Ken Wesson
On Fri, Jul 29, 2011 at 7:35 AM, Sam Aaron samaa...@gmail.com wrote: On 29 Jul 2011, at 12:11, Ken Wesson wrote: Why not just (vec (interleave names (take (count names) (repeat `(count ~foos)? That seems to blow up How so? The actual end goal is to be able to define a macro

Re: ClojureQL: consistent select queries?

2011-07-29 Thread Ken Wesson
On Fri, Jul 29, 2011 at 7:41 AM, László Török ltoro...@gmail.com wrote: Hi, is there a way to execute multiple select queries on a table using clojureql in a transaction? sg. like    (with-results [res1 query1     res2 query2]    .. do sg) and res1 and res2

Re: Question regarding structural sharing, records, and maps

2011-07-29 Thread Ken Wesson
On Fri, Jul 29, 2011 at 4:33 PM, Trenton Strong trenton.str...@gmail.com wrote: Thanks for clearing that up. ... Thanks for taking the time to craft such a thoughtful reply, it is really helpful. You're welcome. -- Protege: What is this seething mass of parentheses?! Master: Your father's

Re: dynamically generated let bindings

2011-07-29 Thread Ken Wesson
P.S. Thanks everyone for your help so far. My brain is overheating but I am learning a lot. You're welcome. To do what you're proposing you will probably need the emitted function to look like: (fn [ args] (let [foo (some logic goes here) bar (some logic goes here) ...]

Re: Possible Issue with Listing 11.5 from the Joy of Clojure

2011-07-29 Thread Ken Wesson
On Fri, Jul 29, 2011 at 3:19 PM, Julien julien.c.chast...@gmail.com wrote: This listing is an attempt to make the function safe for concurrent modification. My claim is that count and seq should also be locking around a for exactly same reason as aget and aset. In particular, locking is not

Re: better community docs: getting started

2011-07-29 Thread Ken Wesson
On Fri, Jul 29, 2011 at 5:33 PM, Laurent PETIT laurent.pe...@gmail.com wrote: Sorry to make things look different than the apparent consensus of the participants to this thread, but isn't it a little bit too prematurate to put that pressure on Clooj ? I understand the desire to have Clooj for

Re: Java object field access

2011-07-29 Thread Ken Wesson
On Sat, Jul 30, 2011 at 1:00 AM, Petr Gladkikh petrg...@gmail.com wrote: I tried this since I have not used macroses for real problem so far. And it actually works. But I do not understand why it works. I have class: class Foo {    public String s;    public int v;    public String

Re: format and printf can't be used with BigInt

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 3:05 AM, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Jul 27, 2011 at 5:56 PM, Ken Wesson kwess...@gmail.com wrote: In Clojure 1.2: (type (bigint 2)) = java.math.BigInteger In Clojure 1.3: (type (bigint 2)) = clojure.lang.BigInt (type 2N

Re: format and printf can't be used with BigInt

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 7:28 PM, Sean Corfield seancorfi...@gmail.com wrote: On Thu, Jul 28, 2011 at 1:53 PM, Ken Wesson kwess...@gmail.com wrote: Chas has already pointed you at the rationale / discussion but I'm a Discussions about primitive arithmetic, not BigInteger arithmetic. I take

Re: Calling clojure from java.

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 1:58 PM, Meikel Brandmeyer m...@kotka.de wrote: If the thing you want to call is a macro, you have to hope that the library other provided the logic as star function (as in Nicolas' case). If there is no function containing the actual logic, you have to re-implement

Re: dynamically generated let bindings

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 6:48 PM, Sam Aaron samaa...@gmail.com wrote: Hi there, I'm trying to create a fn which does the following: * returns a fn which takes an arbitrary number of args * calls a helper fn, passing the incoming args returning a vector of alternating symbols and vals *

Re: Java 7 is out!

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 7:32 PM, Kenny Stone kennethst...@gmail.com wrote: Can clojure take advantage of  some features if they are available?  I know the JRuby dudes are pretty excited about invoke dynamic... I'm not really sure there's a single answer to that question. On the one hand,

Re: format and printf can't be used with BigInt

2011-07-28 Thread Ken Wesson
On Thu, Jul 28, 2011 at 9:03 PM, pmbauer paul.michael.ba...@gmail.com wrote: That wasn't called for. ?? Given Stu linked to the page (and is linked in the 1.3 release notes), it's reasonable to assume the permission error is merely a mistake and not some nefarious plot to withhold 

Re: How to write `when-lets`

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 10:51 AM, Dmitry Gutov raa...@gmail.com wrote: This would be a straightforward solution: (defmacro when-lets [bindings body]  `(let ~bindings     (when (and ~@(map first (partition 2 2 bindings)))       ~@body))) It works well in simple cases, but breaks e.g. in

Re: Code structure/design problems

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 10:04 AM, Oskar oskar.kv...@gmail.com wrote: I have an atom with characters (a map of maps) in my main file. But because I don't want to make that file too big I have, for example, a file called ai.clj with AI stuff, that I require from the main file. For the monsters'

Re: Additional delay after pcalls?

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 11:44 AM, mc4924 claudio.potenza...@gmail.com wrote: Hello everyone, I am a beginner with clojure and I am playing around with pcalls (I am using clojure 1.2.1). I see different behavior if I run some code from inside the REPL or launching it form the command line. I

Re: problem with take-while

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 1:51 PM, axyzxp axy...@gmail.com wrote: thanks guys, now everything is clearer to me. I really apreciate your help You're welcome. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as

Re: How to write `when-lets`

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 2:13 PM, Alan Malloy a...@malloys.org wrote: On Jul 27, 11:11 am, Alan Malloy a...@malloys.org wrote: On Jul 27, 5:50 am, Feng Shen shen...@gmail.com wrote: Clojure core.clj has a macro when-let, I am wondering how to write a macro `when-lets` (when-lets [symbol-1

Re: How to write `when-lets`

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 2:35 PM, Aaron Cohen aa...@assonance.org wrote: I may be wrong, but don't you need to swap the order of the arguments to f? You can do that by writing f itself appropriately. Usually either it will be a closure or it won't matter (core +, etc.). -- Protege: What is this

Re: How to write `when-lets`

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 2:57 PM, Aaron Cohen aa...@assonance.org wrote: On Wed, Jul 27, 2011 at 2:39 PM, Ken Wesson kwess...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:35 PM, Aaron Cohen aa...@assonance.org wrote: I may be wrong, but don't you need to swap the order of the arguments to f

Re: How to write `when-lets`

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 3:23 PM, Alan Malloy a...@malloys.org wrote: On Jul 27, 11:56 am, Dmitry Gutov raa...@gmail.com wrote: First: Why doesn't macroexpand expand the inner when-lets? It's not supposed to, see the doc. To do full expansion, you can use `clojure.walk/macroexpand-all`. Is

Re: format and printf can't be used with BigInt

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 4:33 PM, Alan Malloy a...@malloys.org wrote: On Jul 27, 11:45 am, Andrea Tortorella elian...@gmail.com wrote: Hi everyone, I don't know where to post about bugs (if this is a bug). Anyway in clojure 1.3 with the new numerics: (format %d 2N) throws

Re: format and printf can't be used with BigInt

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 8:25 PM, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Jul 27, 2011 at 4:32 PM, Ken Wesson kwess...@gmail.com wrote: = (.format (java.util.Formatter.) %d (into-array Object [(bigint 2)])) #Formatter 2 (2N isn't recognized as a BigInteger literal by Clojure 1.2

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 8:38 PM, Anthony Grimes disciplera...@gmail.com wrote: Sorry for the terrible subject line. I couldn't think of an easy way to describe the problem in a single line. (def net (node/require net)) (defn portal   [port host] (.createConnection net port host)) (defn -main

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:05 PM, Anthony Grimes disciplera...@gmail.com wrote: That's actually what I thought at first, but the node example that ships with ClojureScript actually does the same thing (uses a node function outside of -main and then calls that function from -main) I did and it

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:21 PM, Anthony Grimes disciplera...@gmail.com wrote: The first argument to Javascript's 'call' is a 'this' argument. All generated functions are called like this. If portal.core.net is an instance rather than a class variable then a null this would explain it not

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:30 PM, Anthony Grimes disciplera...@gmail.com wrote: It looks like main is called the same way. Like I said, my example is not much different than the one that comes with cljs. (ns nodels   (:require [cljs.nodejs :as nodejs])) (def fs (nodejs/require fs)) (def path

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:48 PM, Anthony Grimes disciplera...@gmail.com wrote: Hah! That was it! You, sir, are one clever fellow. Thank you very much. Damn. I didn't think of that. In normal Clojure, defn'ing x.y/x doesn't clobber the Java package named x with a function named x. But it looks

Re: determining whether state has changed in a thread safe manner

2011-07-26 Thread Ken Wesson
On Tue, Jul 26, 2011 at 4:00 AM, Sam Aaron samaa...@gmail.com wrote: However, it seems remarkably kludgy to encode the old value into the contract of the atom and *all* update fns when really this could be achieved in a much cleaner fashion with a version of swap! that returned a vec of new

Re: determining whether state has changed in a thread safe manner

2011-07-26 Thread Ken Wesson
On Tue, Jul 26, 2011 at 4:56 AM, Sam Aaron samaa...@gmail.com wrote: Hey Ken, Thanks for this :-) You're welcome. Actually I was just looking at compare-and-set! just now. This solution seems nicer than Nick's 'place changed/old-val in atom' but still not particularly clean as you have

Re: Java object field access

2011-07-26 Thread Ken Wesson
On Tue, Jul 26, 2011 at 6:02 AM, Petr Gladkikh petrg...@gmail.com wrote: On Tue, Jul 26, 2011 at 3:28 PM, Alan Malloy a...@malloys.org wrote: On Jul 25, 11:10 pm, Petr Gladkikh petrg...@gmail.com wrote: I am trying to construct java object and assign it's fields from a map. That is given Java

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

2011-07-26 Thread Ken Wesson
On Tue, Jul 26, 2011 at 9:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: I wish I had a plug I could pull to stop this thread right n LOL -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random

Re: problem with take-while

2011-07-26 Thread Ken Wesson
On Tue, Jul 26, 2011 at 8:27 PM, Stephen C. Gilardi squee...@mac.com wrote: user= (take-while #(= (mod 20 %) 0) (apply (fn [x y] (rest (range (max x y [10 20])) (1 2) but i expect to have (1 2 5 10) because of (apply (fn [x y] (rest (range (max x y [10 20]) returns (1 2 3 4 5 6 7 8

Re: better community docs: getting started

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:28 AM, pmbauer paul.michael.ba...@gmail.com wrote: +1 on clooj. One click and you have a working build environment, REPL, and REPL-aware editor. https://github.com/downloads/arthuredelstein/clooj/clooj-0.1.5-standalone.jar This URL is somewhat unfortunate. For some

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

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com wrote: Absolutely nothing to add to the argument as such except to say that I am quite surprised at the level of resistance to James' thread.  I can see the argument if this was the 'dev' mailing list. I have been reading this

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

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 8:28 AM, Mark Rathwell mark.rathw...@gmail.com wrote: 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

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

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:59 PM, nchurch nchubr...@gmail.com wrote: +1 to writing an etiquette document.  I have to confess I wrote a long post a few weeks ago without realizing these sorts of posts belonged on blogs Not everyone *has* a blog, you know. Ken was helpful to me then when he

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

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 1:23 PM, nchurch nchubr...@gmail.com wrote: nchurch, I arrest you, try you, and find you guilty of the heinous charge of top-posting, thou knave, thou scum, thou waster of bandwidth! I confess that I have erred and strayed from thy ways like a lost sheep For

Re: better community docs: getting started

2011-07-24 Thread Ken Wesson
On Sun, Jul 24, 2011 at 10:28 PM, nchurch nchubr...@gmail.com wrote: The community getting started page could be much better. In particular, people have opined that there should be a clear, no-choices- to-make path For Newbies section.Help welcome! I just got edit privileges on dev.clojure

Re: Why is this code so slow?

2011-07-22 Thread Ken Wesson
On Thu, Jul 21, 2011 at 9:32 AM, Oskar oskar.kv...@gmail.com wrote: Hi! I was doing some project euler problems and I wrote the following code. It is really slow, and I would like to know why and how it can be made faster. Not that I care much about this code in particular, but I want to

Re: How to Return Vector of Vectors

2011-07-22 Thread Ken Wesson
On Fri, Jul 22, 2011 at 8:47 AM, octopusgrabbus octopusgrab...@gmail.com wrote: On Jul 21, 10:15 pm, Ken Wesson kwess...@gmail.com wrote: On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson kwess...@gmail.com wrote: On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus octopusgrab...@gmail.com wrote

Re: Why is this code so slow?

2011-07-22 Thread Ken Wesson
On Fri, Jul 22, 2011 at 11:02 PM, Oskar oskar.kv...@gmail.com wrote: Thanks for the replies everyone! About the Python version not being recursive: Oh yeah, didn't even think about that, but it shouldn't matter that much, or? With all the right type hints the clojure version should be much

Re: How to Return Vector of Vectors

2011-07-21 Thread Ken Wesson
On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus octopusgrab...@gmail.com wrote: And do you have a suggestion for a functional way? Yes. Change (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row)

Re: How to Return Vector of Vectors

2011-07-21 Thread Ken Wesson
On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson kwess...@gmail.com wrote: On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus octopusgrab...@gmail.com wrote: And do you have a suggestion for a functional way? Yes. Change (doseq [one-full-csv-row all-csv-rows]  (let [accumail-csv-row one-full-csv

Re: The Last Programming Language

2011-07-20 Thread Ken Wesson
On Tue, Jul 19, 2011 at 9:04 PM, daly d...@axiom-developer.org wrote: I believe that Robert missed the fundamental point though. It is NOT just the space of ideas that makes lisp the right language. Another key reason is impedance matching. (An impedance mismatch is when you hook a soda straw

Re: [ANN] clojure.java.jdbc 0.0.5 available

2011-07-20 Thread Ken Wesson
On Wed, Jul 20, 2011 at 7:15 AM, Mark Nutter manutte...@gmail.com wrote: * Add support for databases that cannot return generated keys (e.g., HSQLDB)  - insert operations silently return the insert counts instead of generated keys  - it is the user's responsibility to handle this if you're

Re: (count-all str1 str2)

2011-07-20 Thread Ken Wesson
On Wed, Jul 20, 2011 at 7:32 AM, Baishampayan Ghose b.gh...@gmail.com wrote: On Wed, Jul 20, 2011 at 11:04 AM, Payam Mahmoudian pa...@mahmoudian.info wrote: It's appreciated if you could help me to convert following C code into clojure: float qTR(char *s1, char *s2) {    int    

Re: (count-all str1 str2)

2011-07-20 Thread Ken Wesson
By the way, if I had to hazard a guess I'd say he's computing a distance of some kind between the two strings, possibly the Hamming distance, and possibly for a spellchecker or something similar. Though spellcheckers generally do their comparisons on strings small enough that O(n^3) asymptotic

Re: The Last Programming Language

2011-07-19 Thread Ken Wesson
On Mon, Jul 18, 2011 at 1:36 PM, TimDaly d...@axiom-developer.org wrote: Robert Martin argues that Clojure could be the seed of the last programming language. http://skillsmatter.com/podcast/agile-testing/bobs-last-language I don't see how that claim can be drawn from the textual content on

Re: The Last Programming Language

2011-07-19 Thread Ken Wesson
On Tue, Jul 19, 2011 at 6:54 AM, daly d...@axiom-developer.org wrote: Watch the video. What video? The only video I see linked from there is over an hour long. Obviously you can't mean that one, since no one around here has that kind of spare time at this hour on a Tuesday. :) -- Protege: What

Re: The Last Programming Language

2011-07-19 Thread Ken Wesson
On Tue, Jul 19, 2011 at 6:00 AM, Adam Richardson simples...@gmail.com wrote: Watch the video and you'll see the comment Tim is referencing. Are you aware of the length of that video? -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language

Re: The Last Programming Language

2011-07-19 Thread Ken Wesson
On Tue, Jul 19, 2011 at 10:05 AM, Colin Yates colin.ya...@gmail.com wrote: I find his videos very easy to watch - I think it was around a hour, but the time flies by. An hour of Will Smith blasting aliens flies by. An hour of a talking head is better presented as text. An hour of talking head +

Re: use of subseq on a vector which I know is already sorted

2011-07-18 Thread Ken Wesson
If the input is always going to be sorted, consider using a sorted-set or similar collection type to hold it in the first place. If you're going to need to refer to a particular subsequence repeatedly, and it's held in a vector, you might also consider using subvec after using loop/recur to find

[meta] Google Groups/gmail support?

2011-07-18 Thread Ken Wesson
I can no longer find any forum or submission form for reporting problems to Google. You're a bunch of tech-savvy people using Google Groups and, probably in many cases, gmail. Do any of you know either: 1. How to report problems to Google nowadays, in such a way that they will actually receive

Re: Construct map without associng nil values..

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 6:09 PM, Andreas Liljeqvist bon...@gmail.com wrote: Thanks, but I still feel that it's a little verbose though. Is there some sort of thrush that returns nil if any steps are nil? One might do something like this: (-- e .getComments (hashmap :comments)) There's -? in,

Re: [meta] Google Groups/gmail support?

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 7:14 PM, Joop Kiefte iko...@gmail.com wrote: Google is introducing Google+-like feedback buttons now. I don't see anything like that yet in gmail in Chrome ... -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language

Re: Threading operator generalisation

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 10:04 PM, Chas Emerick cemer...@snowtide.com wrote: Just as a general comment: just because any of our idiosyncratic functions and macros aren't accepted for inclusion in Clojure proper does _not_ mean that they can't find a full and vigorous life in their own

Re: [meta] Google Groups/gmail support?

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 10:07 PM, Chas Emerick cemer...@snowtide.com wrote: Can we *please* refrain from posting such incredibly off-topic content to the list?  If one is even tempted to add a [meta] or [OT] to a subject line, just let it go. If I'd known of *any*where else where I could

Re: clooj, a lightweight IDE for clojure

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 5:14 PM, abp abp...@googlemail.com wrote: Why is it necessary to press TAB at all? Couldn't auto-indent be the default for a line and only manually reindented lines opt-out until one opts in again using TAB or something? This is an interesting thought. On the other

Re: [meta] Google Groups/gmail support?

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 11:20 PM, Lars Nilsson chamael...@gmail.com wrote: On Mon, Jul 18, 2011 at 10:52 PM, Ken Wesson kwess...@gmail.com wrote: Eh. The problem seems more likely to be in either Chrome or gmail. And that looks like a bit-buckety sort of place anyway, where reports may well

Re: clooj, a lightweight IDE for clojure

2011-07-18 Thread Ken Wesson
On Tue, Jul 19, 2011 at 1:33 AM, Arthur Edelstein arthuredelst...@gmail.com wrote: This is a very helpful discussion -- I'm going to think about tabs on the hammock. Thanks. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true

Re: how to preserve the natural reading order in clojure program?

2011-07-17 Thread Ken Wesson
On Sun, Jul 17, 2011 at 7:33 AM, Jevgeni Holodkov jevgeni.holod...@gmail.com wrote: Hello,  Usually, when I write a program, I tend to organize the function to keep with higher abstraction on the top and the details implementation in the end of the file like this:  start() {  

Re: FleetDB or other NoSQL store for Clojure?

2011-07-17 Thread Ken Wesson
On Sun, Jul 17, 2011 at 3:53 PM, Tim Robinson tim.blacks...@gmail.com wrote: I wasn't saying that MongoDB was similar in terms of master-master vs. master-slave, I was saying MongoDB was similar in that it implements conflict resolution rather that transactions.

Re: monads macros

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 7:19 AM, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 13 Jul 2011, at 05:04, Ken Wesson wrote: One approach that has been proposed to improve composability of macros is to adopt a continuation-passing style. This would make macros a candidate

Re: monads macros

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 1:37 PM, Raoul Duke rao...@gmail.com wrote: On Wed, Jul 13, 2011 at 5:20 AM, Ken Wesson kwess...@gmail.com wrote: Oh, I'm not saying my own is exploding -- just that macros can be tough for some people to get their heads around, and monads even more so, so combining

Re: Results from 2011 State of Clojure survey

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 2:41 PM, Phil Hagelberg p...@hagelb.org wrote: Albert Cardona sapri...@gmail.com writes: It seems that relatively few people are taking advantage of some of Clojure’s most sophisticated and unique features: metadata; protocols, records, and types; and multimethods.  

Re: Repeating a vector n times

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 11:21 AM, Bhinderwala, Shoeb sabhinderw...@wellington.com wrote: Thanks Tamreen. Your solution will have to be wrapped in another vec call. I will use Miekel’s:    (reduce into [] (repeat n xs)). What about (vec (take n (cycle xs)))? -- Protege: What is this

Re: Repeating a vector n times

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 5:17 PM, Sam Ritchie sritchi...@gmail.com wrote: Ken, that'll result in the original vector back out again. (vec (take 3 (cycle [1 2 3]))) = [1 2 3]. I think you mean: (vec (take (* n (count xs)) (cycle xs I wasn't using n to mean the number of repetitions of the

Re: Build tool for mixed Clojure/Java projects

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 7:49 PM, Mike Meyer m...@mired.org wrote: On Tue, 12 Jul 2011 22:21:39 -0400 Ken Wesson kwess...@gmail.com wrote: Which means it's not really case 4 at all. Well, it's very clearly not cases 1, 2 or 3. No, it's case zero: standard multi-developer, multi-computer

Re: meta data question

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 9:35 PM, Tim Robinson tim.blacks...@gmail.com wrote: I know I can get the meta data using the following form: = (meta #'get) {:ns #Namespace clojure.core, :name get, :file clojure/ core.clj Is there a means to get the meta data from the stored function without

Re: Expanding symbols and expression in macros.

2011-07-13 Thread Ken Wesson
On Wed, Jul 13, 2011 at 10:33 AM, Andrea Tortorella elian...@gmail.com wrote: I'm not an expert in macros, and maybe this is a stupid question but i think there should be a general pattern for this. I' ve a function: (defn choose* [f choices]  Applies f to one of the choices . .)

Re: Build tool for mixed Clojure/Java projects

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 3:52 AM, Michael Wood esiot...@gmail.com wrote: Hi Ken On 12 July 2011 03:12, Ken Wesson kwess...@gmail.com wrote: On Mon, Jul 11, 2011 at 7:51 PM, Mike Meyer m...@mired.org wrote: I was with you until you said stored remotely. Well, the source code is being worked

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 4:22 AM, Sergey Didenko sergey.dide...@gmail.com wrote: Public relations -- Project status and activity. This area seems to suggest the main Clojure page should be covered in tickers and feeds of various kinds I think the main site needs just a pane with a big

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 8:20 AM, Adam Burry abu...@gmail.com wrote: You've never seen a surgery up close. Many of the tools are wrapped in plastic and you need a helper to find them, open them, hand them to you, and clean them. You've got so many layers on you can't feel anything. The patient

Re: Build tool for mixed Clojure/Java projects

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 2:31 PM, Mike Meyer m...@mired.org wrote: You write clearly enough that misinterpretation isn't likely. You were simply making false statements. I do not do that, and I won't tolerate being called names and badmouthed in public. This discussion is over. -- Protege:

Re: Build tool for mixed Clojure/Java projects

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 3:11 PM, Mike Meyer m...@mired.org wrote: On Mon, 11 Jul 2011 21:12:20 -0400 Ken Wesson kwess...@gmail.com wrote: 2. Many developers, one computer. No remote storage and if the developers are co-located no server; otherwise a terminal server. The former is obviously

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 8:55 AM, Sergey Didenko sergey.dide...@gmail.com wrote: You know that from inside. A Clojure outsider can have a completely other point of view. He can choose between Python Not new server side Javascript Not new new C# Despite what you just said, not new Go

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 6:27 PM, Tamreen Khan histor...@gmail.com wrote: What does something being shiny and new have to do with how good its libraries, community, platforms, and support are? See below. Heck, I'd say something being new would detract from it library-wise. Not necessarily, if

Re: Build tool for mixed Clojure/Java projects

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 7:47 PM, Mike Meyer m...@mired.org wrote: Another misunderstanding. Many developers working at one physical, co-located computer has the keyboard and monitor as a single global lock. In the terminal server case there could be a finer locking granularity. As for still

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 9:45 PM, Jeremy Dunck jdu...@gmail.com wrote: On Tue, Jul 12, 2011 at 5:48 PM, Ken Wesson kwess...@gmail.com wrote: ... It's not hard to think up the likely objections from a lot of people, too, and why they'd be looking for something new: ... Python: poor performance

Re: monads macros

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 3:01 PM, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 12 Jul 2011, at 15:40, James Keats wrote: My humble understanding is that macros complicate composability, whereas monads facilitate it. The composability issue with macros lies in writing them, not using

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Ken Wesson
On Tue, Jul 12, 2011 at 11:06 PM, Jeremy Dunck jdu...@gmail.com wrote: On Tue, Jul 12, 2011 at 9:47 PM, Ken Wesson kwess...@gmail.com wrote: ... Python's major weakness, in this multicore age, is the global interpreter lock -- has there been any progress on creating a viable Python breed

Re: Build tool for mixed Clojure/Java projects

2011-07-11 Thread Ken Wesson
On Sun, Jul 10, 2011 at 2:01 AM, mike.w.me...@gmail.com m...@mired.org wrote: [snip most of post whose sole purpose seems to be to gainsay anything I write] The only source control system I know that uses an ACID database doesn't need a back end server. How exactly is this possible? Databases

Re: Build tool for mixed Clojure/Java projects

2011-07-11 Thread Ken Wesson
On Mon, Jul 11, 2011 at 11:29 AM, Alessio Stalla alessiosta...@gmail.com wrote: [snip most of another post whose sole purpose seems to be to gainsay anything I write] Database and DBMS are used more-or-less synonymously (when database isn't used more broadly than ACID/SQL/etc.) and the S in

Re: a lazy version of shuffle.

2011-07-11 Thread Ken Wesson
On Mon, Jul 11, 2011 at 1:13 PM, Alan Malloy a...@malloys.org wrote: If the sequence is already realized, or is cheap, and you want only a very small random subset of it, you can do better than shuffling the whole thing. Fliebel and I played around with several solutions to this, some time

Re: Results from 2011 State of Clojure survey

2011-07-11 Thread Ken Wesson
Nice analysis. A few remarks: * The results seem to confirm the arguments here that there's a problem with documentation and with the lack of a good starter kit. Making the command line REPL better might help in that regard too (tab completion would not even be too difficult, given Clojure's

Re: Build tool for mixed Clojure/Java projects

2011-07-11 Thread Ken Wesson
On Mon, Jul 11, 2011 at 7:39 PM, Mike Meyer m...@mired.org wrote: On Mon, 11 Jul 2011 07:51:33 -0400 Ken Wesson kwess...@gmail.com wrote: On Sun, Jul 10, 2011 at 2:01 AM, mike.w.me...@gmail.com m...@mired.org wrote: [snip most of post whose sole purpose seems to be to gainsay anything I

Re: Build tool for mixed Clojure/Java projects

2011-07-11 Thread Ken Wesson
On Mon, Jul 11, 2011 at 7:51 PM, Mike Meyer m...@mired.org wrote: On Mon, 11 Jul 2011 16:21:45 -0400 Ken Wesson kwess...@gmail.com wrote: So, repository does not imply server at all, This is getting silly. Repository is a word that brings immediately to mind typing checkin and checkout

Re: Results from 2011 State of Clojure survey

2011-07-11 Thread Ken Wesson
On Mon, Jul 11, 2011 at 8:40 PM, Phil Hagelberg p...@hagelb.org wrote: Ken Wesson kwess...@gmail.com writes: * How would you characterize your use of Clojure *today* -- you do know that HTML supports true italics, right? :) Obviously *today* is meant to be rebound to a new value

Re: 1.3 compatible clojure.contrib.gen-html-docs ?

2011-07-10 Thread Ken Wesson
On Sun, Jul 10, 2011 at 1:31 AM, Mark Derricutt m...@talios.com wrote: Hi all, Does anyone know if theres a 1.3 compatible version of the clojure.contrib.gen-html-docs library at all?  There's nothing listed under http://dev.clojure.org/display/design/Contrib+Projects and with the version I

Re: Local bindings w/o let

2011-07-10 Thread Ken Wesson
On Sun, Jul 10, 2011 at 5:42 PM, octopusgrabbus octopusgrab...@gmail.com wrote: From Clojure api for max (defn max  Returns the greatest of the nums.  {:added 1.0}  ([x] x)  ([x y] (if ( x y) x y))  ([x y more]   (reduce max (max x y) more))) Question 1: Why can y be introduced as a

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 2:19 AM, Lee Spector lspec...@hampshire.edu wrote: Certainly true, and this is one of the other reasons that I taught with Eclipse/CCW rather than an emacs setup last year. But with a well-configured modern emacs some of this can be ameliorated; e.g. there are Mac

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 11:46 AM, Jonathan Fischer Friberg odysso...@gmail.com wrote: You probably don't mean an actual hello world program, but let's compare them anyway. python: print hello world clojure: (print hello world) Not that much harder, is it? And probably slightly *easier*

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 12:02 PM, Timothy Baldridge tbaldri...@gmail.com wrote: As a quick compare... Python: python-pygame Clojure: JDK-lein-clojure-penumbra If you download and install Eclipse or NetBeans they will install a JDK by default, and if you then use their internal plugin browsers

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 12:38 PM, Vivek Khurana hiddenharm...@gmail.com wrote: On Fri, Jul 8, 2011 at 9:47 PM, Phil Hagelberg p...@hagelb.org wrote: Have you tried the Vagrant approach? It's a one-button Emacs/Clojure/Leiningen hacking VM setup[1]:

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 2:23 PM, nchubrich nchubr...@gmail.com wrote: Read my blog post (written a year ago; updated several times to ensure it works with newer versions of Clojure and Leiningen): http://corfield.org/blog/post.cfm/getting-started-with-clojure Now replace

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 3:30 PM, James Keats james.w.ke...@gmail.com wrote: May I also add that I found remapping some keyboard keys quite useful for a sane emacs lisp editing experience. It gives me 3 ctrl keys on the right and 3 ctrl keys on the left so I could basically use any of my

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 7:02 PM, Lee Spector lspec...@hampshire.edu wrote: I think I said recently that several setups are about 95% the way to being newbie-friendly, and while the missing 5% for emacs/lein is mostly in installation/configuration the missing 5% for Eclipse is in project

Re: Help on a Clojure performance question

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 7:05 PM, Christopher vth...@gmail.com wrote: ;; mapper.clj (use ['clojure.java.io :only '(reader)]) (use ['clojure.string :only '(split)]) (defn mapper [lines]  (doseq [line lines]    (doseq [word (split line #\s+)]      (println (str word \t1) (mapper

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

2011-07-08 Thread Ken Wesson
On Fri, Jul 8, 2011 at 7:18 PM, Michael Klishin michael.s.klis...@gmail.com wrote: 2011/7/9 Ken Wesson kwess...@gmail.com e.g. Python interpreter Sorry, why does Clojure starter kit need to embed Python? I couldn't figure it out from a few recent posts. Leiningen is a script, and I thought

<    1   2   3   4   5   6   7   8   9   10   >