Re: Graph API

2013-06-17 Thread Rob Lachlan
Loom was indeed working on this, and it's a very nice library. One thing that I particularly liked about Justin's design, was the ability to run a graph algorithm without worrying about conforming to a particular graph representation. See for example the bread first search function, here:

Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-11 Thread Rob Lachlan
Doesn't anyone use not-empty? http://clojuredocs.org/clojure_core/clojure.core/not-empty On Saturday, May 11, 2013 1:36:57 AM UTC-7, Nico Balestra wrote: I'm not sure this question has been asked already, but I really want to know the principle behind (not (empty? coll)) not being

Re: [ANN] Clojure Cup 2013

2013-04-28 Thread Rob Lachlan
That looks like so much fun; can't wait! On Sunday, April 28, 2013 2:59:23 AM UTC-7, Tero Parviainen wrote: I've started putting together Clojure Cup, a global programming competition for Clojure and ClojureScript programmers. The idea is to have a 48-hour hackathon, similar to Rails Rumble

Re: Coding while running the program

2013-03-23 Thread Rob Lachlan
Ring offers functionality for automatic reloading if you happen to be developing a web app. See here: https://github.com/mmcgrana/ring/wiki/Interactive-Development On Saturday, March 23, 2013 7:22:14 AM UTC-7, Oskar Kvist wrote: Hi! I saw this video

Re: core.matrix proposal

2013-01-05 Thread Rob Lachlan
I really like this idea -- I think there's a need for a dedicated matrix computation library in clojure. I really like the idea of having matrix operations implemented in clojure (I think that you have this in persistent_vector.clj) but also being able to call on java libraries. On Saturday,

Re: Function minimizer a la fminunc

2012-06-10 Thread Lachlan
maybe http://commons.apache.org/math/apidocs/index.html will help? - lk On Jun 10, 2012 7:09 AM, David Jacobs da...@wit.io wrote: Thanks! That section of Incanter must be new, I haven't seen it till now. Will check it out and report back. On Friday, June 8, 2012 at 7:15 AM, Lars Nilsson

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Rob Lachlan
Many of the links off of the main page are ajax. I don't think that wget can scrape that very easily. On Oct 12, 11:10 am, Tassilo Horn tass...@member.fsf.org wrote: jingguo yaojing...@gmail.com writes: Hi! When programming in Clojure, I use the Reference documentation on clojure.org a

Re: Is it possible to make a mirror of clojure.org?

2011-10-12 Thread Rob Lachlan
what you want. On Oct 12, 12:06 pm, Rob Lachlan robertlach...@gmail.com wrote: Many of the links off of the main page are ajax.  I don't think that wget can scrape that very easily. On Oct 12, 11:10 am, Tassilo Horn tass...@member.fsf.org wrote: jingguo yaojing...@gmail.com writes

Re: date-clj clojure date/time library

2011-07-05 Thread Lachlan
Just FYI I ended up using joda time in a project and it seemed to be a good immutable match for clojure http://joda-time.sourceforge.net/ - Lachlan On 30 June 2011 06:42, Islon Scherer islonsche...@gmail.com wrote: Thanks for the critic Laurent. set-date is not destructive, it creates a new

Re: Most concise way to determine that a sequence is consecutive integers starting with one?

2011-07-01 Thread Rob Lachlan
Using map-indexed: (defn f [xs] (every? true? (map-indexed #(= (inc %1) %2) xs))) On Jul 1, 12:28 pm, .Bill Smith william.m.sm...@gmail.com wrote: I want a concise function that, given an arbitrary length sequence, determines whether the sequence is of consecutive integers starting with one.

Re: Debian packages

2011-05-25 Thread Rob Lachlan
I'm curious about this as well, because of the ICFP programming contest. The contest organizers are soliciting requests for Debian packages to be installed on the contest environment. I don't suppose that this is the reason that you're asking? On May 24, 9:41 pm, Phil Hagelberg p...@hagelb.org

Re: extending types

2011-05-19 Thread Lachlan
out i've got some function arguments around the wrong way :) Cheers, - Lachlan On 19 May 2011 11:17, Ken Wesson kwess...@gmail.com wrote: On Wed, May 18, 2011 at 7:19 PM, Lachlan lachlan.kana...@gmail.com wrote: A further example of this proxy method not working would be trying to add methods

Re: extending types

2011-05-18 Thread Lachlan
[clojure.lang.PersistentArrayMap user.A] [] (dosomething [] (println (:akey this) - nil (.dosomething (proxy [clojure.lang.PersistentArrayMap user.A] [(into-array Object [:akey :aval])] (dosomething [] (println (:akey this) - :aval ahh corners! - Lachlan -- J Lachlan Kanaley M 0413 191 194 E

Re: Ring startup processing?

2010-11-27 Thread Rob Lachlan
The servlet interface includes the init method for this exact purpose. In java, this would be used by subclassing one of the abstract servlet classes, and filling in the init method with whatever initialization you need. Or by implementing the servlet interface directly. From the javadoc, the

Re: Keyword names and namespaces

2010-10-19 Thread Rob Lachlan
that we shouldn't count on the current behaviour continuing. Rob On Oct 18, 9:24 pm, Phil Hagelberg p...@hagelb.org wrote: On Mon, Oct 18, 2010 at 3:02 PM, Rob Lachlan robertlach...@gmail.com wrote: There seems to be a discrepancy between what keyword names are supposed to be allowed, according

Re: Behaviour of clojure.set functions with non-sets.

2010-10-19 Thread Rob Lachlan
It's not free. (defn set Returns a set of the distinct elements of coll. {:added 1.0} [coll] (clojure.lang.PersistentHashSet/create ^clojure.lang.ISeq (seq coll))) It seems to go element by element, irrespective of whether it was given a hashset. Rob On Oct 18, 9:43 pm, Phil Hagelberg

Keyword names and namespaces

2010-10-18 Thread Rob Lachlan
There seems to be a discrepancy between what keyword names are supposed to be allowed, according to the reader documentation, and which the reader actually allows. For instance, periods are supposed to be disallowed in keyword names, and only one forward slash allowed, but no errors are thrown at

Re: BUG: Clojure hierarchies (affects 1.2-beta1)

2010-07-22 Thread Rob Lachlan
was planning to do a patch for. Rich, can you check and see if CAs have arrived from Rob Lachlan and Michał Marczyk? Stu Made a ticket for this here (including the simple diagnosis): https://www.assembla.com/spaces/clojure/support/tickets/406-typo-in-u... No patch, since my CA wasn't ack'd yet

Re: bioinformatics toolkit in clojure: what would that look like?

2010-06-29 Thread Rob Lachlan
+1 if you make the function not just for vector but for any seqs. That way of we need special BioSeqs someday... Yes, I concur. I think that the default in-memory data format for (DNA, RNA, Protein sequences) should be a vector, but that the functions should take sequences. Mind you in some

Re: bioinformatics toolkit in clojure: what would that look like?

2010-06-28 Thread Rob Lachlan
The clojure way seems to be to do as much as possible with functions on raw (immutable) data, rather than building up object systems. The sequence is already one of clojure's primary abstractions, and it may not always *need* to wrapped in something like defrecord. (Though for some applications,

Re: classpath and require

2010-06-19 Thread Rob Lachlan
I was wondering whether putting a dot in a directory on the classpath makes a difference. On OS X, the answer is no. Unfortunately, I don't have a windows machine, so I can't check for certain what the situation is there. Another issue: I ignored case-sensitivity in my answer above. Are

Re: need help understanding two issues

2010-06-19 Thread Rob Lachlan
I'll take a whack at it. 1. How come APersistentMap$KeySet doesn't implement IPersistentSet? Because keys and vals are designed to return (lazy) sequences. More important, these two functions return those two sequences in the same order. The laziness avoids having to incur the overhead of

Re: Enhanced Primitive Support

2010-06-19 Thread Rob Lachlan
The main example for recur on the special forms page (http:// clojure.org/special_forms#Special%20Forms--(recur%20exprs*)) is: (def factorial (fn [n] (loop [cnt n acc 1] (if (zero? cnt) acc (recur (dec cnt) (* acc cnt)) I may not be be clojure jedi, but

Re: Enhanced Primitive Support

2010-06-19 Thread Rob Lachlan
Actually, Mike, your two functions work just fine. (Equal branch). Mind you I checked that out over two hours ago, so this information might be out of date. Rob On Jun 19, 6:59 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Sat, 19 Jun 2010 20:40:13 -0400 David Nolen

Re: Enhanced Primitive Support

2010-06-19 Thread Rob Lachlan
without getting bored though. -- Aaron On Sat, Jun 19, 2010 at 10:19 PM, Rob Lachlan robertlach...@gmail.com wrote: Actually, Mike, your two functions work just fine.  (Equal branch). Mind you I checked that out over two hours ago, so this information might be out of date. Rob

Re: Enhanced Primitive Support

2010-06-19 Thread Rob Lachlan
, because it used to work just fine. Rob On Jun 19, 8:22 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: Rob Lachlan robertlach...@gmail.com wrote: Actually, Mike, your two functions work just fine.  (Equal branch). Mind you I checked that out over two hours ago, so this information

Re: classpath and require

2010-06-18 Thread Rob Lachlan
have you tried starting with: c:\clojure-contrib\clojure-contrib.jar;c:\clojure\clojure.jar;c: \projects.clj clojure.main On Jun 18, 2:00 pm, Mohammad Khan beepl...@gmail.com wrote: C:\Projects.cljjava -cp c:\clojure-contrib\clojure-contrib.jar;c:\clojure\clojure.jar clojure.main Clojure

Re: classpath and require

2010-06-18 Thread Rob Lachlan
Whoops, that should read: java -cp c:\clojure-contrib\clojure-contrib.jar;c:\clojure \clojure.jar;c: \projects.clj clojure.main On Jun 18, 2:51 pm, Rob Lachlan robertlach...@gmail.com wrote: have you tried starting with: c:\clojure-contrib\clojure-contrib.jar;c:\clojure\clojure.jar;c

Re: Possible Clojure Bug

2010-06-18 Thread Rob Lachlan
I think he retracted this post in a separate new thread not long after posting this. cheers Rob On Jun 18, 2:56 pm, Heinz N. Gies he...@licenser.net wrote: 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

Re: Enhanced Primitive Support

2010-06-17 Thread Rob Lachlan
I think the enhanced support for primitives is fantastic. I'm looking forward to doing more numerical work in clojure. Quibble: Using a multiple-recursive algorithm for calculating fibonnaci values. user (defn fib-2 [n] (if (= n 1) (loop [i 0 f0 0 f1 1]

Re: Enhanced Primitive Support

2010-06-17 Thread Rob Lachlan
Ah -- well that makes sense then. Bravo! Rob On Jun 17, 2:15 pm, Rich Hickey richhic...@gmail.com wrote: On Jun 17, 5:10 pm, Rob Lachlan robertlach...@gmail.com wrote: I think the enhanced support for primitives is fantastic.  I'm looking forward to doing more numerical work in clojure

Re: Serious problem with underive (for hierarchies), an attempt to fix, and request for code review.

2010-06-16 Thread Rob Lachlan
Lachlan robertlach...@gmail.com wrote: Oh God.  What broken formatting.  Sorry about that. On Jun 15, 4:24 pm, Rob Lachlan robertlach...@gmail.com wrote: I think that the underive function for removing hierarchy relationships between keywords is broken.  I'll illustrate with an example

Re: Serious problem with underive (for hierarchies), an attempt to fix, and request for code review.

2010-06-16 Thread Rob Lachlan
I like the reference counting idea, YD. I don't think that we want to go that route, though, if underive will be called comparatively rarely by most people. But it would be a good way to do it if that performance were needed. Rob On Jun 15, 10:39 pm, YD ydong.pub...@gmail.com wrote: Another

Re: Recommendations on prepping a library for 1.2 release?

2010-06-16 Thread Rob Lachlan
Do I need any branches? What are the branches? I thought that when a branch was stable it would be merged back into master (if I'm using the right terms). The master branch for clojure is the main development branch for 1.2 (someone correct me if I'm wrong). It's the one I'm using, and I'm

Serious problem with underive (for hierarchies), an attempt to fix, and request for code review.

2010-06-15 Thread Rob Lachlan
I think that the underive function for removing hierarchy relationships between keywords is broken. I'll illustrate with an example and describe what I think the problems are. I've got some code for a function which (I hope!) performs underive correctly, and I'd love it if people had a look.

Re: Serious problem with underive (for hierarchies), an attempt to fix, and request for code review.

2010-06-15 Thread Rob Lachlan
Oh God. What broken formatting. Sorry about that. On Jun 15, 4:24 pm, Rob Lachlan robertlach...@gmail.com wrote: I think that the underive function for removing hierarchy relationships between keywords is broken.  I'll illustrate with an example and describe what I think the problems

Re: Serious problem with underive (for hierarchies), an attempt to fix, and request for code review.

2010-06-15 Thread Rob Lachlan
be fine. If anyone were to make large hierarchies which had to be modified efficiently, though, I think something like in the first message would be required. On Jun 15, 4:29 pm, Rob Lachlan robertlach...@gmail.com wrote: Oh God.  What broken formatting.  Sorry about that. On Jun 15, 4:24 pm, Rob

Re: Mac Emacs users: which version do you prefer (Aquamacs, Carbon Emacs, other?)

2010-06-13 Thread Rob Lachlan
Nilsson tho...@kjeldahlnilsson.net wrote: Weird - I installed the Cocoa build last night, and got everything set up via elpa including swank-clojure. Some local problem? Regards, Thomas Kjeldahl Nilsson On Sun, Jun 13, 2010 at 2:02 AM, Rob Lachlan robertlach...@gmail.com wrote: I agree

Re: Mac Emacs users: which version do you prefer (Aquamacs, Carbon Emacs, other?)

2010-06-12 Thread Rob Lachlan
I agree that the cocoa builds are the nicest. But there is one problem that I've had with them: I wasn't able to successfully install swank-clojure through elpa from within that emacs. Curiously, I was able to install it through elpa in aquamacs, and then I had no problem using swank-clojure

Re: new Clojure Compiler...

2010-05-16 Thread Rob Lachlan
for the persistent data.. well all this laziness and dinamic types, and on top of that immutability should not perform well in pure clojure Why? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Extremely silly benchmarks, on types, records and maps.

2010-05-13 Thread Rob Lachlan
Ah. That makes sense, thanks very much. Rob On May 12, 10:36 pm, Harvey Hirst hhi...@gmail.com wrote: It's slow because it has to use reflection to determine the type. Use (set! *warn-on-reflection* true) and you'll see the warning. Try something like this and you'll see significantly

Extremely silly benchmarks, on types, records and maps.

2010-05-12 Thread Rob Lachlan
Is there some reason why accessing the values in a type (from deftype) should be slower than for a record? The type seems to be very fast to instantiate, but slow to access. (I was just playing around, trying to get a feel for the relative performance characteristics of types records and maps.

Re: Has deftype changed?

2010-04-18 Thread Rob Lachlan
For deeftype, has the syntax for field accessors changed too? I can't get it to work: user (deftype someType [b f]) user.someType user (def y (new someType 2 3)) #'user/y user (:b y) nil user (:f y) nil defrecord works as expected, though. On Apr 17, 6:16 pm, Andrew Stein steinl...@gmail.com

Re: compojure/defservlet

2010-01-19 Thread Rob Lachlan
I can't find it either. The closest thing seems to be the servlet macro: (definline servlet Create a servlet from a sequence of routes. Automatically updates if the routes binding is redefined. [routes] `(proxy [HttpServlet] [] (~'service [request# response#] (request-handler

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Rob Lachlan
I've reverted to the setup that you listed, Ramakrishnan. I spent quite a few hours trying to figure out how to use ELPA + the forked slime + the new swank clojure, but failed miserably (despite the kind assistance of Phil and others on another thread). I would agree that it would be nice to

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Rob Lachlan
-clojure, I get an error: java.lang.ClassNotFoundException: swank.swank And I can't find swank-clojure.jar anywhere on my system. Should I have built that separately? Anyway, thanks very much for all your help. Rob On Jan 7, 9:05 am, Phil Hagelberg p...@hagelb.org wrote: Rob Lachlan robertlach

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-06 Thread Rob Lachlan
 am, Phil Hagelberg p...@hagelb.org wrote: Rob Lachlan robertlach...@gmail.com writes: I have src and test in the directory I'm passing in.  The problem however, seems to be on the emacs end.  In the mini-buffer when I enter in Project root: path-to-project and press return, the cursor just

Having difficulties with compilation in slime, emacs and clojure-project

2010-01-05 Thread Rob Lachlan
I've been trying to compile clojure files from emacs. The issue I run into is of my own clj files not being found on the classpath. (If I'm trying to compile a standalone file, which references only clojure core, there's no problem. It's when I have multiple files, and I'm trying to include a

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-05 Thread Rob Lachlan
is getting stuck right at that spot. On Jan 5, 11:01 pm, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 06.01.2010, at 07:26, Rob Lachlan wrote: but when I put it in .emacs, and invoked it, the function seemed to get stuck.  I'm asked in the mini-buffer for the project root, and I write

Status of bounded search on sorted-map?

2009-12-30 Thread Rob Lachlan
About a year and a half ago, there was some discussion about having a function that would enable some kind of bounded search on a sorted map: http://groups.google.com/group/clojure/browse_thread/thread/949cae6c085d3d39/65b4082085c19a60?q= Does this exist, currently? I haven't looked at the gory

Re: seeking rudimentary defprotocol + deftype help

2009-12-30 Thread Rob Lachlan
Thanks alot guys! On Dec 30, 1:41 pm, Raoul Duke rao...@gmail.com wrote: p.p.s. i was using -alpha- and changed to -new- (and pulled today) and now i get a slightly different error. am i just flubbing the syntax in some way i can't see for the trees?! user= (defprotocol P (foo [x])) P

Re: Status of bounded search on sorted-map?

2009-12-30 Thread Rob Lachlan
this. Sean On Dec 30, 5:37 pm, Rob Lachlan robertlach...@gmail.com wrote: About a year and a half ago, there was some discussion about having a function that would enable some kind of bounded search on a sorted map: http://groups.google.com/group/clojure/browse_thread/thread/949cae6c0

Re: Status of bounded search on sorted-map?

2009-12-30 Thread Rob Lachlan
I should have said: since the keys are already in a tree. If they were in a linked list, I'd expect to have to iterate over most of the list. On Dec 30, 3:10 pm, Rob Lachlan robertlach...@gmail.com wrote: This would work, but would require iterating over the keys, for something like O(n

Re: Status of bounded search on sorted-map?

2009-12-30 Thread Rob Lachlan
6. On Dec 30, 6:10 pm, Rob Lachlan robertlach...@gmail.com wrote: This would work, but would require iterating over the keys, for something like O(n) performance.  I'm hoping that we can do better, since the keys are already in an ordered collection. On Dec 30, 3:04 pm, Sean Devlin

Re: Status of bounded search on sorted-map?

2009-12-30 Thread Rob Lachlan
timothyprat...@gmail.com wrote: 2009/12/31 Rob Lachlan robertlach...@gmail.com: About a year and a half ago, there was some discussion about having a function that would enable some kind of bounded search on a sorted Does this exist, currently?  I haven't looked at the gory details of subseq

Re: seeking rudimentary defprotocol + deftype help

2009-12-29 Thread Rob Lachlan
I'm also looking for some help on deftype, and rather than start another thread, I thought I'd toss it in here. Basically, how do I type hint for a deftype. For example, suppose I want a nested type, something that looks like this: (deftype A [#^somePrimitive someField]) (deftype B

Re: Order of keys within a map?

2009-09-01 Thread Rob Lachlan
As, Patrick Sullivan, said, the built-in sorted-map guarantees that the keys will be in order. I'm probably missing something here, but wouldn't that fit the bill? http://clojure.org/api#sorted-map Rob Lachlan On Aug 27, 12:35 pm, Howard Lewis Ship hls...@gmail.com wrote: Is the order