a simple macro to tame the run-away loop-recurs

2013-12-28 Thread Sunil S Nandihalli
Hi Everybody, I just wrote a simple macro to tame the run-away loop-recur infinite loops. Some of you may find use for it. It only handles loop-recur pairs not fn-recur combination. It is trivial but useful .. so thought of sharing. (defmacro limit [max-recurs loop-expr] (let [[_ bindings

How to place unicode characters in span tag in reagent (formerly known as cloact)

2014-01-27 Thread Sunil S Nandihalli
Hi Everybody, Can somebody help me figure out as to how I can place a unicode character. What I have tried is [:span #8634;] with the correct header but it renders it as-is. Thanks, Sunil. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

webgl and reagent(cljs wrapper for reactjs)

2014-02-01 Thread Sunil S Nandihalli
Hi Everybody, I am new to web-programming but have done some stuff with clojurescript. Now I was looking add an webgl based canvas to render a cube. I am using reagent https://github.com/holmsand/reagent which is a cljs-wrapper around reactjs. I am unable to decide, due to my inexperience in both

rseq for subvec in clojurescript

2014-02-16 Thread Sunil S Nandihalli
Hi Everybody, I get the following error when I do a rseq on a subvec in clojurescript Uncaught Error: No protocol method IReversible.-rseq defined for type cljs.core/Subvec: [(:red :clockwise) (:blue :clockwise) (:yellow :clockwise) (:yellow :clockwise) (:orange :clockwise)] Is this a known

Re: rseq for subvec in clojurescript

2014-02-17 Thread Sunil S Nandihalli
thanks Michal for the fix. On Mon, Feb 17, 2014 at 12:58 AM, MichaƂ Marczyk michal.marc...@gmail.comwrote: It is now, thanks for the report! Ticket with patch: http://dev.clojure.org/jira/browse/CLJS-765 On 16 February 2014 17:48, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote

Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
You can't call a clojurescript function from java. However you can call clojure-code from Java and clojurescript code from javascript. On Tue, Feb 18, 2014 at 5:09 PM, sorin cristea srncris...@gmail.com wrote: Hi do you know how I can call a clojure script from a java method ? Thanks,

Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
sorry I misread the email! On Tue, Feb 18, 2014 at 6:17 PM, Michael Klishin michael.s.klis...@gmail.com wrote: 2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli sunil.nandiha...@gmail.com : You can't call a clojurescript function from java. However you can call clojure-code from Java

Re: emacs-clojure-vagrant: a sane development virtual environment

2011-07-07 Thread Sunil S Nandihalli
Hi I am new to both vagrant and ruby. I followed the steps in the readme up to step 3 .. but after running vagrant up I get /var/lib/gems/1.8/gems/vagrant-0.7.6/bin/vagrant:2:in `require': no such file to load -- vagrant (LoadError) from /var/lib/gems/1.8/gems/vagrant-0.7.6/bin/vagrant:2 can

Re: Discovering a function's closure

2011-07-07 Thread Sunil S Nandihalli
Oded, If you look at the source of source .. you will notice that the source is not stored in the meta information but it just picks up the filename and line-number form the meta info of the function and reads the corresponding files to obtain the source.. This would not be possible if you

find works on transient vector but not on transient map while get works on both transient vector and map .. ?

2011-07-08 Thread Sunil S Nandihalli
Hello everybody, find works on transient vector but not on transient map while get works on both transient vector and map .. ? bitvector.core (find {:a 1} :a) [:a 1] bitvector.core (find (transient {:a 1}) :a) nil bitvector.core (get (transient {:a 1}) :a) 1 bitvector.core (get

a lazy version of shuffle.

2011-07-11 Thread Sunil S Nandihalli
Hello everybody, I think a lazy version of shuffle would be a good addtion to the core. I tried googling for one and found http://ytakenaka.blogspot.com/2011/05/lazy-shuffle-clojure.html which was infact slower than original shuffle and was unable to reproduce the performance claims made there

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

2011-07-18 Thread Sunil S Nandihalli
Hi everybody, I have a situation where I know that the sequence I have at hand is sorted but does not implement the Sorted interface. How can I use subseq for example on a vector without actually creating a sorted-set out of it which I think may be wasteful.. Am I mis-informed about creation of

Re: following Rich's talk at NYC Clojure this Wednesday

2011-07-18 Thread Sunil S Nandihalli
awesome!! looking forward to the talk.. like everybody else, I think it will be great to have the time and time-zone info posted.. Sunil. On Mon, Jul 18, 2011 at 9:28 PM, Stuart Halloway stuart.hallo...@gmail.comwrote: Several people have asked about access to Rich's upcoming talk this

Re: converting a string into a set

2011-07-18 Thread Sunil S Nandihalli
(set abc) will do it... On Tue, Jul 19, 2011 at 9:20 AM, Tuba Lambanog tuba.lamba...@gmail.comwrote: Hello, My apologies for this newbie question. I couldn't find a way to convert a string to a set, thus: abc = #{a b c} Thanks. tuba -- You received this message because you are

Re: converting a string into a set

2011-07-18 Thread Sunil S Nandihalli
(some (set str1) str2) will give you what you want.. Sunil On Tue, Jul 19, 2011 at 10:06 AM, Tuba Lambanog tuba.lamba...@gmail.comwrote: (thank-you Sean A Corfield) On Mon, Jul 18, 2011 at 10:29 PM, Sean Corfield seancorfi...@gmail.comwrote: On Mon, Jul 18, 2011 at 9:17 PM, Tuba Lambanog

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

2011-07-20 Thread Sunil S Nandihalli
thanks Miekel, Bennyand Ken for your responses.. Sunil. On Mon, Jul 18, 2011 at 7:15 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi everybody, I have a situation where I know that the sequence I have at hand is sorted but does not implement the Sorted interface. How can I use

clojure.contrib.profile crashes

2011-07-21 Thread Sunil S Nandihalli
Hello everybody, I have used the profiler successfully in the past. But some how it is repeatedly crashing with the following stack trace. Value out of range for int: 17069635385 [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [QUIT] Quit to the SLIME top level

Re: clojure.contrib.profile crashes

2011-07-21 Thread Sunil S Nandihalli
The reason I am not posting the code is because I am not able to reproduce this on a simple case. I was just hoping some of you may have some insight with out the code.. Thanks, Sunil. On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I

Re: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
On 07/21/2011 06:12 PM, Sunil S Nandihalli wrote: The reason I am not posting the code is because I am not able to reproduce this on a simple case. I was just hoping some of you may have some insight with out the code.. Thanks, Sunil. On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli

Re: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
|-- clojure-source-1.2.1.jar |-- debug-repl-0.3.1.jar `-- swank-clojure-1.4.0-20110601.165758-9.jar 1 directory, 9 files On Mon, Jul 25, 2011 at 12:10 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Aaron Bedra, Thanks for your quick response. Sorry I could not get back

timed termination of iterative algorithm

2011-07-31 Thread Sunil S Nandihalli
Hello everybody, I would like to have a long running process to return its current solution after some pre-determined amount of time. It so happens that the iteration is happening at a deeper nested function. I would like to have a way to return from this nested function when its time ... How can

Re: timed termination of iterative algorithm

2011-07-31 Thread Sunil S Nandihalli
, Sunil. On Sun, Jul 31, 2011 at 7:59 PM, Ken Wesson kwess...@gmail.com wrote: On Sun, Jul 31, 2011 at 10:25 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I would like to have a long running process to return its current solution after some pre-determined amount

Re: Out of memory using pmap

2011-08-06 Thread Sunil S Nandihalli
Just a guess. If your daily data is huge you will be loading the data for only one day when using map and you will be loading the data for multiple days (equal to number of parallel threads) .. and may be this is the cause of the problem. Sunil. On Sat, Aug 6, 2011 at 11:40 PM, Shoeb Bhinderwala

Re: Argslist of fn?

2011-08-09 Thread Sunil S Nandihalli
Hey, This may be not be the answer you are expecting but here it goes anyways.. (defmacro fnd [ rest] `(with-meta (fn ~@rest) {:source '~form})) would associate the source of the function with the function as its meta data you are defining and you can extract any subset of it for whatever

Re: Creating a map algorithmically

2011-08-09 Thread Sunil S Nandihalli
you should considering looking at clojure.contrib.lazy-seqs/primes to get an idea it is implemented there.. Sunil. On Wed, Aug 10, 2011 at 1:48 AM, Chouser chou...@gmail.com wrote: On Tue, Aug 9, 2011 at 12:50 PM, Kevin Sookocheff kevin.sookoch...@gmail.com wrote: Hi, I have a question

using custom zippers from clojure.zip

2011-08-26 Thread Sunil S Nandihalli
Hello everybody, I am trying to figure out how to use the zippers. And I wrote the following code https://gist.github.com/1172883 It seems to get in-to an infinite loop ..can somebody help me figure it out. The purpose of the last s-expression is to simply return a new s where all the values

Re: using custom zippers from clojure.zip

2011-08-26 Thread Sunil S Nandihalli
. On Fri, Aug 26, 2011 at 12:52 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I am trying to figure out how to use the zippers. And I wrote the following code https://gist.github.com/1172883 It seems to get in-to an infinite loop ..can somebody help me figure

how to create a ordered data structure which would efficiently return the element before and after it

2011-09-01 Thread Sunil S Nandihalli
Hi Everybody, I would like to create a sorted-data-structure which would enable me to efficiently 1. insert new elements into it maintaining the sorted-nature of the data structure. 2. query as to which element is immediately before and after a value that I present. one can assume that the value

Re: how to create a ordered data structure which would efficiently return the element before and after it

2011-09-01 Thread Sunil S Nandihalli
I seem to miss the c++ stl library where it would be trivial to do this! Sunil. On Thu, Sep 1, 2011 at 3:43 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Everybody, I would like to create a sorted-data-structure which would enable me to efficiently 1. insert new elements

Re: how to create a ordered data structure which would efficiently return the element before and after it

2011-09-01 Thread Sunil S Nandihalli
I really feel sorted-set should have something to achieve what I want .. but don't seem to find it.. On Thu, Sep 1, 2011 at 3:53 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: I seem to miss the c++ stl library where it would be trivial to do this! Sunil. On Thu, Sep 1, 2011

Re: how to create a ordered data structure which would efficiently return the element before and after it

2011-09-01 Thread Sunil S Nandihalli
Thanks Dave, That did it. I did not know there was rsubseq .. :) Thanks Sunil. On Thu, Sep 1, 2011 at 4:04 PM, David Powell djpow...@djpowell.net wrote: On Thu, Sep 1, 2011 at 11:13 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Everybody, I would like to create a sorted

heaps in clojure

2011-09-13 Thread Sunil S Nandihalli
Hi Everybody, I have a very large, but with finite size, collection. I would like to get like first 10 elements in the sorted list . I would use a heap if I were in c++ .. is there a inbuilt implementation of this in clojure? .. Is there some other way to achieve this? some sort of lazy sort

what does cake bin do?

2011-09-14 Thread Sunil S Nandihalli
Hi Everybody, I have tried to use the AOT compilation via cake bin . I have seen that the AOTed executable takes about 14 to 15 seconds while when run at the repl it takes about 10 to 11 seconds. While I can attribute part of the extra time to the JVM start-up time and loading clojure .. I can't

Re: heaps in clojure

2011-09-14 Thread Sunil S Nandihalli
: On Tue, Sep 13, 2011 at 7:44 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Everybody, I have a very large, but with finite size, collection. I would like to get like first 10 elements in the sorted list . I would use a heap if I were in c++ .. is there a inbuilt

Re: heaps in clojure

2011-09-15 Thread Sunil S Nandihalli
-Jason On Sep 13, 4:44 am, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Everybody, I have a very large, but with finite size, collection. I would like to get like first 10 elements in the sorted list . I would use a heap if I were in c++ .. is there a inbuilt implementation

using finger trees in two dimensions

2011-09-15 Thread Sunil S Nandihalli
Hi everybody, Thanks to Chouser's finger tree data structure, it makes it very simple to keep some elements in a tree/sequence and efficiently maintain values by some associative operation on all the elements of the collection .. I guess chouser himself has given series of talks on that. However,

how do I use data.priority-map

2011-09-28 Thread Sunil S Nandihalli
Hello everybody, can somebody help me figure out what I should add to my project.clj to use https://github.com/clojure/data.priority-map I am using clojure 1.3. Thanks, Sunil. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: how do I use data.priority-map

2011-09-28 Thread Sunil S Nandihalli
after I posted the question .. I found this discussionhttp://groups.google.com/group/clojure-dev/browse_thread/thread/de04e7d6c1a8cfa4?pli=1 . So, I guess it is not ready for prime-time yet .. (may be I am wrong) Thanks, Sunil. On Thu, Sep 29, 2011 at 3:34 AM, Sunil S Nandihalli sunil.nandiha

Re: how do I use data.priority-map

2011-09-29 Thread Sunil S Nandihalli
this dependency: [org.clojure/data.priority-map 0.0.1-SNAPSHOT] That should get you going. Sean On Wed, Sep 28, 2011 at 3:21 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: after I posted the question .. I found this discussion . So, I guess it is not ready for prime-time yet

Re: how do I use data.priority-map

2011-09-29 Thread Sunil S Nandihalli
, 2011 at 3:21 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: after I posted the question .. I found this discussion . So, I guess it is not ready for prime-time yet .. (may be I am wrong) -- You received this message because you are subscribed to the Google Groups Clojure group

clojure.core.logic.core/match usage

2011-10-03 Thread Sunil S Nandihalli
Hello everybody, I was playing with core.match library and I notice the following behavior let [x {:a 1 :b 2 :c 10 :d 30}] (match [x] [({:a _ :b _ :c _ :d _} :only [:a :b :c :d])] :a-1 [({:a _ :b 2} :only [:a :b])] :a0 [{:a 1 :c _}] :a1

Re: clojure.core.logic.core/match usage

2011-10-03 Thread Sunil S Nandihalli
please excuse the mistake in the namespace in the subject line... it should have been clojure.core.match.core/match On Mon, Oct 3, 2011 at 3:57 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I was playing with core.match library and I notice the following behavior

Re: clojure.core.logic.core/match usage

2011-10-03 Thread Sunil S Nandihalli
If I remove the line [{:a 1 :c _}] :a1 it returns :a-1 .. So, I guess it means that the behavior is undefined if there are multiple matches. Sunil. On Mon, Oct 3, 2011 at 3:57 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I was playing with core.match library

Re: clojure.core.logic.core/match usage

2011-10-04 Thread Sunil S Nandihalli
Thanks David, for the wonderful core.logic and core.match library. Sunil. On Mon, Oct 3, 2011 at 5:39 PM, David Nolen dnolen.li...@gmail.com wrote: It's a bug, thanks for the report, http://dev.clojure.org/jira/browse/MATCH-23 David On Mon, Oct 3, 2011 at 6:27 AM, Sunil S Nandihalli

Re: clojure.core.logic.core/match usage

2011-10-07 Thread Sunil S Nandihalli
Thanks David for fixing this so fast. It works very nicely... Sorry I couldn't reply sooner. Sunil. On Thu, Oct 6, 2011 at 8:15 AM, David Nolen dnolen.li...@gmail.com wrote: This should be fixed, I released 0.2.0-alpha4. Feedback appreciated. David. On Mon, Oct 3, 2011 at 6:27 AM, Sunil S

Re: clojure.core.logic.core/match usage

2011-10-07 Thread Sunil S Nandihalli
there was another edge case that I missed around :only which I've since fixed in master. Once I resolve MATCH-26 I'll cut another alpha release. David On Fri, Oct 7, 2011 at 11:55 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Thanks David for fixing this so fast. It works very

Re: error on compile

2011-10-07 Thread Sunil S Nandihalli
Without actually seeing the code, only guess I can make is that you are probably using vars with underscores in them. While I do not know for sure that it is not allowed, I do know that they are typically avoided. Usually, I think, something like read-json-from gets internaly converted to

core.logic

2011-10-08 Thread Sunil S Nandihalli
Hi everybody, I was just trying to implement a simple length of a list in core.logic (basically solving the 99-problems-in-prolog). I am not able to find a way to increment values.. Can somebody help me with this... I would like some thing like the following to work.. (defnu lengtho [l n] ([[]

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
Please replace rst with ?rst .. Sunil. On Sat, Oct 8, 2011 at 1:20 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi everybody, I was just trying to implement a simple length of a list in core.logic (basically solving the 99-problems-in-prolog). I am not able to find a way

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
) (succ n1 n) Obviously the above code is not right or efficient and is very limited in range. I am sure there should be a better solution.. Thanks, Sunil. On Sat, Oct 8, 2011 at 1:20 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi everybody, I was just trying

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
. Untested: (defnu lengtho [l n] ([[] 0]) ([[_ . rst] _] (fresh [n1] (lengtho rst n1) (project [n n1] (== n (+ n1 1) Thanks, Ambrose On Sat, Oct 8, 2011 at 3:50 PM, Sunil S Nandihalli sunil.nandiha

Re: core.logic

2011-10-08 Thread Sunil S Nandihalli
, 2011 at 3:50 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi everybody, I was just trying to implement a simple length of a list in core.logic (basically solving the 99-problems-in-prolog). I am not able to find a way to increment values.. Can somebody help me with this... I

Re: clojure starter package for aichallenge ?

2011-10-23 Thread Sunil S Nandihalli
Hi Chris, Thanks for your startup-package. Can you please tell me if there is a test_bot.sh for clojure. Can share if you already have one? Thanks, Sunil. On Sat, Oct 22, 2011 at 12:16 PM, Chris Granger ibdk...@gmail.com wrote: Hm? My starter package is there:

Re: clojure starter package for aichallenge ?

2011-10-23 Thread Sunil S Nandihalli
Hi Chris, I am sorry, I think I needed to be a little more specific. I get a bad submission key found error when I submit.. Sunil. On Sun, Oct 23, 2011 at 9:16 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Chris, Thanks for your startup-package. Can you please tell me

Re: clojure starter package for aichallenge ?

2011-10-24 Thread Sunil S Nandihalli
Hi Ulises, I get a bad submission key found error when I submit the zip file that contains ants.clj MyBot.clj Am I doing something wrong? I did run the test_bot.sh with MyBot.clj .. It seems to work fine. Thanks, Sunil. On Tue, Oct 25, 2011 at 3:52 AM, Ulises ulises.cerv...@gmail.com wrote:

Re: clojure starter package for aichallenge ?

2011-10-24 Thread Sunil S Nandihalli
I failed to mention that both the files are in a directory named mybot On Tue, Oct 25, 2011 at 10:58 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Ulises, I get a bad submission key found error when I submit the zip file that contains ants.clj MyBot.clj Am I doing

Re: Creating map from string

2010-12-03 Thread Sunil S Nandihalli
Here is what I came up with ... (let [d (split (slurp data) #,)] (- d (apply hash-map) (clojure.walk/keywordize-keys) (clojure.contrib.generic.functor/fmap read-string))) Sunil. On Fri, Dec 3, 2010 at 7:52 PM, Anclj anb...@gmail.com wrote: Hi, I have a

Re: more idiomatic clojure

2010-12-03 Thread Sunil S Nandihalli
)) On Dec 3, 3:42 am, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I would like to know as to how I would write the following code in a more idiomatic way. (let [mp (atom {}) d [#{#{1 2} #{3 4}} ;node1 #{#{5 6} #{7 8

outlining for clojure files in emacs+slime?

2010-12-03 Thread Sunil S Nandihalli
Hello everybody, I would like to know if any of you are using any outlining mode in emacs+slime.. if so how? Thanks, Sunil. -- 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

Re: Easy Way To Download Clojure Libraries From Git

2010-12-03 Thread Sunil S Nandihalli
Hi Asim, just do lein new and add [clojureql 1.0.0-beta2-SNAPSHOT] to your dependencies in project.clj and run lein deps it will automatically download all the necessary dependencies. If you directly want to do it from github .. I don't know how to do that. Sunil. On Sat, Dec 4, 2010 at 6:23

what does the value part of env map automatically passed to all macros contain?

2010-12-03 Thread Sunil S Nandihalli
Hello everybody, I really like the env. It has saved a lot of tedious work a couple of times .. but I have only found use for the keys of the map that gets passed like in the following example. (defmacro display-local-bindings [] `(do ~@(map (fn [x#] (list 'println [`'~x# x#])) (keys env

Re: when to use io! macro?

2010-12-03 Thread Sunil S Nandihalli
It gives a convenience macro which checks if there is a transaction running when the following code block is called. The idea is that since the code in a transaction could be called a multiple times, you should not do things like sending things on to the network or writing to a file during a

Re: when to use io! macro?

2010-12-03 Thread Sunil S Nandihalli
What I said is purely from reading the documentation .. I have never ever used it. Take it with a pinch of salt! On Sat, Dec 4, 2010 at 8:40 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: It gives a convenience macro which checks if there is a transaction running when the following

Re: what does the value part of env map automatically passed to all macros contain?

2010-12-03 Thread Sunil S Nandihalli
Thanks Alex. I asked because I thought it might be part of stable API. Thanks for your tip on slime (I do use slime) also. I will wait for it to become part of stable api. Sunil. On Sat, Dec 4, 2010 at 9:29 AM, Alex Osborne a...@meshy.org wrote: Sunil S Nandihalli sunil.nandiha...@gmail.com

Re: what does the value part of env map automatically passed to all macros contain?

2010-12-03 Thread Sunil S Nandihalli
I feel they could add a flag to indicate if it was obtained via gensym or not.. I would have liked to have it in the past. It can help in writing debug macros .. may be give better debug messages etc. Sunil On Sat, Dec 4, 2010 at 9:29 AM, Alex Osborne a...@meshy.org wrote: Sunil S Nandihalli

clojure.contrib.seq vs. clojure.contrib.seq-utils

2010-12-04 Thread Sunil S Nandihalli
Hello everybody, Both of clojure.contrib.seq and clojure.contrib.seq-utils seem to give the same functionality.. any idea as to which one we r supposed to be using.. Sunil. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: parameters destructuring sets?

2010-12-05 Thread Sunil S Nandihalli
+1 to what Ken said Sunil On Mon, Dec 6, 2010 at 4:04 AM, Ken Wesson kwess...@gmail.com wrote: On Sun, Dec 5, 2010 at 4:14 PM, jweiss jeffrey.m.we...@gmail.com wrote: That's totally different than nth for a set being undefined. It's undefined on purpose. Now, if you are using a

Re: help with macro writing style

2010-12-05 Thread Sunil S Nandihalli
Really sorry about pasting the code in the email. It seems to have added 2-3 extra new-lines after every line .. :( .. but the same code is present in the github-gist. Sunil. On Mon, Dec 6, 2010 at 10:57 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, The following

Re: mapmap?

2010-12-06 Thread Sunil S Nandihalli
Hi Alex, (clojure.contrib.generic.functor/fmap inc {:a 1 :b 2}) = {:a 2 :b 3} The above is probably what you want. HTH Sunil. On Tue, Dec 7, 2010 at 9:26 AM, Alex Baranosky alexander.barano...@gmail.com wrote: Oops. I meant: (mapmap inc {:a 1 :b 2}) = { :a 2 :b 3) Sorry about that.

Re: easiest way to make a map out of a list?

2010-12-06 Thread Sunil S Nandihalli
On Tue, Dec 7, 2010 at 10:31 AM, Alex Baranosky alexander.barano...@gmail.com wrote: Way I have (apply hash-map [:a 1:b 2]) and I want to convert it to {:a 1 :b 2} What's the idiomatic way to do this in Clojure? Thanks for the help, Alex -- You received this message because

every? and some .. shoule take a predicate and multiple collections like map does..

2010-12-08 Thread Sunil S Nandihalli
Hello everybody, I think every? and some should take multiple collections like map .. I know it is trivial to implement that ..but it would be nice to have it as part of the default behaviour of every? , some , not-any? and not-every? should take more than one collection as the default

Re: a macro to debug the let form

2010-12-09 Thread Sunil S Nandihalli
#]) On Nov 28, 12:32 am, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Robert, What I had posted before was half-baked buggy code .. the following gist has a few more helper debug macroshttps://gist.github.com/718725 https://gist.github.com/718725This code was written when I

Meta information of form

2010-12-09 Thread Sunil S Nandihalli
Hello everybody, I would like to know what meta info does form that get passed to your macro.. actually contain? I am able to only get the line number.. Is there a way to get the file name aswell? Thanks, Sunil. -- You received this message because you are subscribed to the Google Groups

Re: Meta information of form

2010-12-09 Thread Sunil S Nandihalli
hmm.. so how do we get the file name inside our macro?? Sunil. On Thu, Dec 9, 2010 at 2:57 PM, Ken Wesson kwess...@gmail.com wrote: On Thu, Dec 9, 2010 at 4:20 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I would like to know what meta info does form that get

Re: Meta information of form

2010-12-09 Thread Sunil S Nandihalli
Thanks Alex. That helps. Sunil. On Thu, Dec 9, 2010 at 4:28 PM, Alex Osborne a...@meshy.org wrote: Sunil S Nandihalli sunil.nandiha...@gmail.com writes: I would like to know what meta info does form that get passed to your macro.. actually contain? I am able to only get the line number

complex number library

2010-12-13 Thread Sunil S Nandihalli
Hello everybody, I found two libraries for complex numbers...One in apache.common.math and the other in clojure-contrib but which clearly states that it is quiet incomplete ... can anybody make a suggestion for a good alternative.. Thanks, Sunil. -- You received this message because you are

Re: complex number library

2010-12-13 Thread Sunil S Nandihalli
I really miss having complex numbers as native types... :( On Tue, Dec 14, 2010 at 3:11 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I found two libraries for complex numbers...One in apache.common.math and the other in clojure-contrib but which clearly states

Re: complex number library

2010-12-13 Thread Sunil S Nandihalli
Nandihalli sunil.nandiha...@gmail.com wrote: I really miss having complex numbers as native types... :( On Tue, Dec 14, 2010 at 3:11 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I found two libraries for complex numbers...One in apache.common.math and the other

Re: complex number library

2010-12-13 Thread Sunil S Nandihalli
Thanks David .. but is there a protocol that contains +,*,/,- operations? If there is one I can simply add those operations... Sunil. On Tue, Dec 14, 2010 at 7:07 AM, David Nolen dnolen.li...@gmail.com wrote: On Mon, Dec 13, 2010 at 8:13 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote

aliasing symbols from clojure core

2010-12-13 Thread Sunil S Nandihalli
Hello everybody, I am defining a protocol which defines the functions +,-,*,/ .. so I am excluding those symbols when I do :refer-clojure but I would like to give an alias to say something like c+ c- c* and c/ how can I do this? Thanks, Sunil -- You received this message because you are

Re: aliasing symbols from clojure core

2010-12-13 Thread Sunil S Nandihalli
at 10:20 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I am defining a protocol which defines the functions +,-,*,/ .. so I am excluding those symbols when I do :refer-clojure but I would like to give an alias to say something like c+ c- c* and c/ how can I do

Re: complex number library

2010-12-13 Thread Sunil S Nandihalli
wish you luck in your complex number implementation! I've done my own using clojure.contrib.generic and can post if it anyone's interested. thanks, --Robert McIntyre On Mon, Dec 13, 2010 at 9:55 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Thanks David .. but is there a protocol

Re: complex number library

2010-12-15 Thread Sunil S Nandihalli
double-dispatch in clojure .. thats neat... Thanks Stuart. Sunil. On Wed, Dec 15, 2010 at 12:17 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Dec 14, 2:31 am, Konrad Hinsen konrad.hin...@fastmail.net wrote: That's actually what clojure.contrib.complex-numbers already uses! And

unsplicing quote without the other macro-specific name resolution etc.

2010-12-15 Thread Sunil S Nandihalli
Hello everybody, I would like to write regular code something like [1 2 ~@(map some-fn some-coll) 4 5] is this possible? I don't mind not using the literal vector notation.. it could even be (some-macro-or-fn 1 2 3 ~@(map some-fn some-coll) 4 5) is this possible .. ? i don't want ' `

Re: unsplicing quote without the other macro-specific name resolution etc.

2010-12-15 Thread Sunil S Nandihalli
thanks Ken, your second vecify was exactly what I was looking for! .. I feel it would be good candidate for the core. Sunil. On Thu, Dec 16, 2010 at 12:19 PM, Ken Wesson kwess...@gmail.com wrote: On Thu, Dec 16, 2010 at 1:33 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello

Re: complex number library

2010-12-16 Thread Sunil S Nandihalli
my bad .. thats what I meant..:) On Thu, Dec 16, 2010 at 2:10 PM, Laurent PETIT laurent.pe...@gmail.comwrote: 2010/12/16 Sunil S Nandihalli sunil.nandiha...@gmail.com double-dispatch in clojure .. thats neat... Thanks Stuart. Really, that's double-dispatch with protocols, 'cause double

currying in clojure for fixed number of arg functions

2010-12-17 Thread Sunil S Nandihalli
Hello everybody, I remember that the key reasoning for not supporting currying in clojure was to be able to have variable number of arg functions.. So, I just thought a bit and realized that it should be possible to do that for fixed arity functions .. and then wrote the following macro to define

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Sunil S Nandihalli
Sunil S Nandihalli sunil.nandiha...@gmail.com writes: Hello everybody, I remember that the key reasoning for not supporting currying in clojure was to be able to have variable number of arg functions.. So, I just thought a bit and realized that it should be possible to do that for fixed

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Sunil S Nandihalli
On Sat, Dec 18, 2010 at 7:21 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Eric, I do know about partial. But what I am saying is that the extra function, partial, is not necessary if the function was created with def-curry-fn... The function automatically returns

Re: currying in clojure for fixed number of arg functions

2010-12-18 Thread Sunil S Nandihalli
the other airties. Do people think it would be a good patch for core? Please tell me what you think of my code :) All criticisms are welcome; I too am still learning. Sincerely, --Robert McIntyre On Fri, Dec 17, 2010 at 9:00 PM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote

defmethod/defmulti should dispatch on the new arguments when we call the recur..?

2010-12-18 Thread Sunil S Nandihalli
Hello everybody, It would be nice if calling recur inside a defmethod redispatched on the new arguments.. I have shown a simple use-case in the following gist. https://gist.github.com/747171 It might be naive .. but I feel IMHO that this should be the default behaviour and not have any

Re: defmethod/defmulti should dispatch on the new arguments when we call the recur..?

2010-12-19 Thread Sunil S Nandihalli
thanks Meikel for your clarification.. I used to think loop recur almost removed the need for TCO .. but here is a case where true TCO could be really helpfull.. Sunil. On Sun, Dec 19, 2010 at 1:33 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 19.12.2010 um 08:30 schrieb Sunil S

Re: Native Clojure

2010-12-20 Thread Sunil S Nandihalli
Hi Konrad, Have you tried giws (spelt opposite of swig) .. it automatically generates all the necessary jni stuff necessary for any java-class .. It takes an xml file as input and generates any necessary jni-wrappers .. It can only acess the class member-functions not member-values. I have

parallel colt vs. colt

2010-12-20 Thread Sunil S Nandihalli
Hello everybody, I was under the impression that parallel colt is a parallelized subset of colt libraries. but it seems like colt has less functionality than parallel colt libraries.. Am I missing something? Sunil. -- You received this message because you are subscribed to the Google Groups

Re: Clojure, Parallel programming and Leslie Lamport

2010-12-22 Thread Sunil S Nandihalli
Hello Tim and Konrad, I am interested in distributed parallel computing too ... I have prior experience coding with MPI and c .. but that besides the point .. while I was looking at options with clojure .. I recently came across swarmiji. https://github.com/amitrathore/swarmiji I don't know much

Re: dispatching on a resulting range

2010-12-22 Thread Sunil S Nandihalli
the caveat is that the order in which you specify the methods would matter .. since that is the order in which it is going to check for the appropriate method to call.. Just like condp again. On Thu, Dec 23, 2010 at 10:04 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Alex, I

Re: dispatching on a resulting range

2010-12-22 Thread Sunil S Nandihalli
yea Ken I agree with you.. but it was just an exercise .. you could definitely add a priority option to every method.. Thanks for your comments.. besides the code was tested.. Sunil. On Thu, Dec 23, 2010 at 11:45 AM, Ken Wesson kwess...@gmail.com wrote: On Thu, Dec 23, 2010 at 1:09 AM, Ken

Re: pods?

2010-12-24 Thread Sunil S Nandihalli
thanks Meikel. So really nice things are in the pipeline for clojure .. :) On Fri, Dec 24, 2010 at 2:50 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 24.12.2010 um 09:56 schrieb Meikel Brandmeyer: Am 24.12.2010 um 09:44 schrieb Sunil S Nandihalli: what are PODS? And as a side

complex number performance enhancement...

2010-12-26 Thread Sunil S Nandihalli
Hello everybody, I have a numerically intensive code. after getting it to work I started profiling the code .. and zeroed down that my complex number operations are the most called functions and probably among the slowest due to my naive implementation. The code I am using is in the following

Re: complex number performance enhancement...

2010-12-26 Thread Sunil S Nandihalli
still trying to understand the code and figure it out.. But I just thought I On Mon, Dec 27, 2010 at 6:03 AM, Alex Osborne a...@meshy.org wrote: Sunil S Nandihalli sunil.nandiha...@gmail.com writes: http://paste.lisp.org/display/93387 It uses protocols and deftype I noticed

  1   2   3   4   >