Re: why my java code (call clojure from java ) run spend so much loooooog time .

2014-02-13 Thread Andy-
FYI: http://stackoverflow.com/questions/21759848/ On Thursday, February 13, 2014 11:02:07 AM UTC-5, Xiaojun Weng wrote: I am a new clojure player,but i have wrote java code by few years. when i use emacs run my clojure code (read a big file 50M ) , nrepl run over use 30 second. but i

Re: [ANN] Clojure 1.6.0-beta1

2014-02-15 Thread Andy-
inline On Saturday, February 15, 2014 12:41:52 AM UTC-5, Mars0i wrote: Could someone clarify for me why some? as a name for not nil makes sense at all in the first place? Not criticizing. I just don't understand what existence or there being some of something has to do with nil. Maybe

Re: Looking for advice to fine tune a simple function

2014-02-16 Thread Andy-
I'm also very new to clojure but this is how I'd do it: (def hr-zones { [0 100] :low [101 120] :fat-burn [121 140] :aerobic [141 160] :anaerobic [161 333] :max}) (defn hr-zone [hr] (some (fn [x] (and (= (first (key x)) hr (second (key x))) (val x))) hr-zones))

Re: Looking for advice to fine tune a simple function

2014-02-16 Thread Andy-
))) (partition 2 1 m)) Cheers On Sunday, February 16, 2014 6:47:51 PM UTC-5, Andy- wrote: I'm also very new to clojure but this is how I'd do it: (def hr-zones { [0 100] :low [101 120] :fat-burn [121 140] :aerobic [141 160] :anaerobic [161 333] :max}) (defn hr-zone [hr

Re: Latex style file for formatting/coloring clojure code?

2014-02-16 Thread Andy-
On Sunday, February 16, 2014 6:05:24 PM UTC-5, puzzler wrote: I am unable to find a style file that supports clojure code in LaTeX. Can anyone point me in the right direction? Pygments can output LaTeX. (There is also minted) HTH -- You received this message because you are subscribed to

Re: Looking for advice to fine tune a simple function

2014-02-17 Thread Andy-
On Sunday, February 16, 2014 11:19:58 PM UTC-5, Bruno Kim Medeiros Cesar wrote: (BTW, Andy, how do you format your code so prettily?) I usually just paste it into pygments.org and then paste it back into google groups (which accepts the generated HTML). Cheers -- You received this message

Re: Looking for advice to fine tune a simple function

2014-02-17 Thread Andy-
On Monday, February 17, 2014 6:43:18 PM UTC-5, Laurent Droin wrote: (def inf Long/MAX_VALUE) (defn quantize [x markers values] (let [f (partial (fn([%1 %2 %3] (cond (= %1 %2) %3))) x)] (first (filter #(not (nil? %))(map f (conj markers inf) values) The reason I didn't go

Re: Help with Liberator POST route

2015-02-18 Thread Andy-
Without having tested it: I think you're curl -d format is wrong. It's not semicolon separated: http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request HTH On Wednesday, February 18, 2015 at 7:09:19 AM UTC-5, g vim wrote: I have a Liberator app which

Re: how do you re-load a clojure library?

2015-03-29 Thread Andy-
Off topic for this list but I'm sure helpful to some: On Windows: You can see open file handles with MS's Process Explorer. On Linux: There is `lsof`, or if you like interactive: The popular `htop` utility allows you to press `l` to see all open ports, files and cwd of a process. This quickly

Re: partition-when

2015-03-05 Thread Andy-
Tried myself and my first transducer for fun: (defn partition-when [f] (fn [rf] (let [a (java.util.ArrayList.) fval (volatile! false)] (fn ([] (rf)) ([result] (let [result (if (.isEmpty a) result

Re: Performance of defmulti in both ClojureScript and Clojure

2015-04-27 Thread Andy-
to some public location, this is a great place to get involved contributing to ClojureScript without needing to dig into the compiler. My earlier points about the general performance expectations of multimethods in ClojureScript still stands :) David On Mon, Apr 27, 2015 at 9:44 AM, Andy

Re: Performance of defmulti in both ClojureScript and Clojure

2015-04-27 Thread Andy-
Looks like they're pretty slow compared to a simple case: http://jsperf.com/cljs-multimethods https://github.com/rauhs/cljs-perf On Saturday, April 25, 2015 at 10:33:18 AM UTC-4, Timur wrote: Hi everyone, There are situations where I want to dispatch functions using based on their

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
In addition to James comment: IMO clojure.org/metadata should be clearer about this. It's mentioned more clearly on the reader page: http://clojure.org/reader#The%20Reader--Macro%20characters The metadata reader macro first reads the metadata and attaches it to the next form read (see with-meta

Opinion on take-while for stateful transducers

2015-05-09 Thread Andy-
%) Is this a good idea and rock solid implementation? I'm a little worried this breaks down for corner cases (and this would be no fun to debug). Or am abusing transducers here? What would be a good way to implement this? Possibly even further up the chain? Thanks for reading, Andy -- You received

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
confusing. The metadata documentation says clearly that are equivalent, but are not equivalent. Thank you very much again. Regards. Andrey 2015-05-05 21:49 GMT+02:00 Andy- andre...@gmail.com javascript:: In addition to James comment: IMO clojure.org/metadata should be clearer about this. It's

Re: Opinion on take-while for stateful transducers

2015-05-12 Thread Andy-
: On May 9, 2015, at 6:28 PM, Andy- andre...@gmail.com javascript: wrote: (defn take-while-xf Takes a transducer and returns a transducer that will immediately finish (ie call (reduced)) when the transducer did not call the reducing function and just returned the result. Only

Re: Is this expected behavior with meta data?

2015-06-25 Thread Andy-
There was just this question the other day: http://stackoverflow.com/questions/30922413/why-does-metadata-symbol-not-work There is also a few threads a few weeks ago here on google groups about it: https://groups.google.com/d/msg/clojure/_e7vBom2acw/0AAKTiGuzv4J HTH On Thursday, June 25,

Re: materials

2015-06-25 Thread Andy-
The sidebar on reddit is actually pretty decent: http://www.reddit.com/r/clojure My #1 resource for looking up docs is nowadays clojuredocs.org since it gives examples/comments for most of the functions. HTH On Thursday, June 25, 2015 at 4:59:12 AM UTC-4, Baskar Kalyanasamy wrote: hi

Re: Question regarding java array

2015-06-11 Thread Andy-
On Thursday, June 11, 2015 at 5:32:02 AM UTC-4, Ritchie Cai wrote: Just wondering though, is there a faster way to load an array than this way? https://github.com/malloc82/imaging/blob/45475b99f564b1ac77e668e04b91cb9c01a096d7/src/imaging/dicom.clj#L138 the data file I'm trying to read from

Re: How can find something inside heavily nested data structure ?

2015-08-19 Thread Andy-
I have yet to evaluate it myself but this might do help you: https://github.com/nathanmarz/specter On Wednesday, August 19, 2015 at 10:18:06 AM UTC-4, Hussein B. wrote: Hi, I have transformed JSON response into the equivalent data structure using Cheshire library. The result is a huge

Re: Durable atom

2015-08-16 Thread Andy-
You might like some of immutant's stuff: http://immutant.org/documentation/2.0.2/apidoc/guide-transactions.html Even though it's called caching, it can be used as a kv-store. They do offer persistence and transaction. HTH On Sunday, August 16, 2015 at 10:59:09 AM UTC-4, Jeremy Vuillermet

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-03 Thread Andy-
Only to answer the "retry on error" part of you question: You might like hara/event: http://docs.caudate.me/hara/hara-event.html HTH On Wednesday, September 2, 2015 at 8:44:07 PM UTC-4, jo...@signafire.com wrote: > > TLDR: how do you use Component when the application logic involves >

Re: newbie Q: how to tweak file-seq (original: how to selectively iterate through a tree of directories) ?

2015-10-05 Thread Andy-
Try to adapt my code: https://gist.github.com/rauhs/63054a06631c0be598d3 where you change your accept function to incorporate: http://stackoverflow.com/questions/813710/java-1-6-determine-symbolic-links HTH On Saturday, October 3, 2015 at 5:14:51 PM UTC-4, hpw...@gmail.com wrote: > > The

Re: Avoiding repetition while still using 'recur'

2016-06-26 Thread Andy-
To add a little variant of James Reeve's code: You can avoid the loop/recur by using reduce: (defn valid-parens? [s] (let [opening-brackets {\( \), \[ \], \{ \}} closing-brackets (clojure.set/map-invert opening-brackets)] (empty? (reduce (fn [stack c] (if

Re: Pattern matching on lists

2016-04-08 Thread Andy-
That's described here: https://github.com/clojure/core.match/wiki/Basic-usage#sequential-types Use: [([1] :seq)] On Friday, April 8, 2016 at 2:37:37 PM UTC+2, Russell Wallace wrote: > > How do you do pattern matching on lists in Clojure? I've tried using > core.match but the examples all deal

Re: Removing duplicates from a series

2016-05-17 Thread Andy-
Hi, dedupe is almost what you need, but you can just copy the source and modify it slightly: (defn dedupe-by "Similar to dedupe but allows applying a function to the element by which to dedupe." ([f] (fn [rf] (let [pv (volatile! ::none)] (fn ([] (rf))

Re: Index of an element in a vector of vectors

2016-12-07 Thread Andy-
One option is to use keep-indexed: (first (keep-indexed (fn [i xs] (first (keep-indexed (fn [j x] (when (= x "5") [i j])) xs))) players)) On Wednesday, December 7, 2016 at 5:32:10 PM UTC+1, Rickesh Bedia wrote: > > If I have

Re: Index of an element in a vector of vectors

2016-12-08 Thread Andy-
way. On Thursday, December 8, 2016 at 11:13:42 AM UTC+1, Rickesh Bedia wrote: > > Is there a way to generalise? > > I.e a function that allows you to swap any of the 1-9? > > On Wednesday, 7 December 2016 18:06:19 UTC, Andy- wrote: >> >> One option is to use keep-indexed

beginning to learn Clojure after imperative programming my whole life

2017-08-09 Thread Andy
for resources/ particular tips/any advice for improving Clojure skills. Does anybody have any websites used for solving Clojure problems? other than the most popular ones. Wishing you the best of luck in life and coding. best wishes fellow Clojurians, Andy -- You received this message because you

Re: Anyone mourns the loss of: tryclj.com ?

2017-12-16 Thread Andy-
You can also get a REPL with https://coderpad.io/ . It even runs Clojure 1.9 and the editor has great VIM bindings. If it asks you to register you can just start a new session in an incognito window. HTH On Saturday, December 16, 2017 at 4:29:23 AM UTC+1, Didier wrote: > > Just realized that:

Re: The Application Context Pattern

2009-02-27 Thread Andy Chambers
2009/2/27 Marko Kocić marko.ko...@gmail.com: Interesting approach, nice explained. Does anyone have similar example using one of the cells implementations? What would be pros/cons between this and cells approach? The cells implementations I've seen posted to this list (in fact pretty much

ANN: thalia version 0.1.0 -- more detailed doc strings for (a small fraction of) Clojure

2013-11-18 Thread Andy Fingerhut
this: (require 'thalia.doc) (thalia.doc/add-extra-docs!) See the project page for a sample of the more detailed doc string you will get if you do (doc ==): https://github.com/jafingerhut/thalia If you want to help write documentation like this, let me know. Andy -- -- You received

configure leiningen to use library when repl starts

2013-11-19 Thread Andy Smith
when I start the repl : (defproject test 1.0.0-SNAPSHOT :description FIXME: write description :dependencies [[org.clojure/clojure 1.3.0] [org.clojure/math.numeric-tower 0.0.2]]) :repl-options { :init (clojure.core/use 'clojure.math.numeric-tower)} andy

running command when lein repl starts

2013-11-19 Thread Andy Smith
1.3.0] [org.clojure/math.numeric-tower 0.0.2]]) :repl-options { :dependencies [ [org.clojure/math.numeric-tower 0.0.2]] :init (clojure.core/use 'clojure.math.numeric-tower)} and the error I get is as follows : andy@Aspire-V3

Re: running command when lein repl starts

2013-11-19 Thread Andy Smith
Ok valid point, but I still get the same kind of errors? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

Re: running command when lein repl starts

2013-11-19 Thread Andy Smith
yes, Ive seen that but it doesnt seem to help me greatly. Just out of curiosity how do you generally setup your repl so it already includes these kind of common libraries? I dont really want to be typing lots of 'use' commands into the repl every time i start it. Is using leiningen the wrong

Re: running command when lein repl starts

2013-11-19 Thread Andy Smith
oops, you are right but if I paste into my project.clj I get a different error when I run lein repl andy@Aspire-V3-571:~/projects/clojure/test$ lein repl Exception in thread main java.lang.IllegalArgumentException: No value supplied for key: [:init (use (quote clojure.math.numeric-tower

Re: [ANN]: clj.jdbc 0.1-beta1 - Alternative implementation of jdbc wrapper for clojure.

2013-11-20 Thread Andy Fingerhut
as I can tell): http://www.eclipse.org/legal/eplfaq.php#USEINANOTHER Andy On Tue, Nov 19, 2013 at 11:16 PM, Andrey Antukh andrei.anto...@gmail.comwrote: Hi agai Soan. Repeating now: as I said previously, copyright notice of taken code should to be present. And is my mistake from

expand a form

2013-11-25 Thread Andy Smith
Hi, I am new to clojure and I was wondering if there is a macro I can use to fully expand all symbols and macros in a form, without performing the final evaluation of the built in functions? Thanks Andy -- -- You received this message because you are subscribed to the Google Groups Clojure

Re: expand a form

2013-11-25 Thread Andy Smith
It doesnt seem to expand function calls though right? On Monday, 25 November 2013 12:55:27 UTC, Andy Smith wrote: Hi, I am new to clojure and I was wondering if there is a macro I can use to fully expand all symbols and macros in a form, without performing the final evaluation

Re: expand a form

2013-11-25 Thread Andy Smith
In your example a full expansion might be : (. clojure.lang.Numbers (add 10 1)) On Monday, 25 November 2013 17:16:42 UTC, Guru Devanla wrote: Hi Andy, Not sure what you need in terms of function calls being expanded. Can you provide an example. Here is an silly example, even though

Re: expand a form

2013-11-28 Thread Andy Smith
thanks for your helpful suggestions. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

hash comparison

2013-11-28 Thread Andy Smith
structure. However, how does this actually work since a comparison of hashes doesn't guarantee that two objects are equal. How does clojure handle the case where two hashes are the same for two distinctly different values. Andy -- -- You received this message because you are subscribed

I need a vector not a list?

2013-11-30 Thread Andy Smith
have a version of map that returns a vector when given a vector? We can do this kind of thing in other languages with templates/generics why not clojure? There is obviously some basic principle/understanding that I am missing here. This kind of thing surely cant be very efficient, can it? Andy

Re: I need a vector not a list?

2013-12-01 Thread Andy Smith
]) Not this = (apply vector (map (partial * 2) [1 2 3])) 01.12.2013, 06:15, Andy Smith the4th...@googlemail.com javascript:: Hi, I am trying to understand the manipulation of vectors from an efficiency point of view. For example if I want to reverse a vector I can do the following (apply

Re: I need a vector not a list?

2013-12-01 Thread Andy Smith
of indirection to avoid the need to copy elements of the original collection? On Saturday, 30 November 2013 21:31:34 UTC, Jim foo.bar wrote: On Sat, 30 Nov 2013 13:15:33 -0800 (PST) Andy Smith the4th...@googlemail.com javascript: wrote: but my question is really about the more general case of any

Re: I need a vector not a list?

2013-12-02 Thread Andy Smith
Great point... -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group,

Re: NPE in print-stack-trace

2013-12-17 Thread Andy Fingerhut
You might be hitting a bug in Clojure 1.5.1 where it incorrectly attempts to access elements in an empty stack trace, which I have seen occur. This should be fixed in Clojure 1.6.0 alpha releases: http://dev.clojure.org/jira/browse/CLJ-1102 Andy On Tue, Dec 17, 2013 at 9:14 AM, Dmitry Groshev

Re: How do I fix *warn-on-reflextion* warnings in 3rd party libraries?

2013-12-22 Thread Andy Fingerhut
into their copy of the library. Andy On Sun, Dec 22, 2013 at 2:33 PM, larry google groups lawrencecloj...@gmail.com wrote: I know this has been discussed before but I could not find anything like a canonical answer via Google. I just set to :warn-on-reflection true in my project.clj

Re: Perl Regexp::Grammars in Clojure?

2014-01-06 Thread Andy Fingerhut
Mark Engelberg's Instaparse most likely does not have the same feature set as Regexp::Grammars (I haven't checked in enough detail to learn the differences), but they do likely have features in common: https://github.com/Engelberg/instaparse Andy On Mon, Jan 6, 2014 at 9:04 PM, gvim gvi

[ANN] Eastwood 0.1.0 Clojure lint tool

2014-01-10 Thread Andy Fingerhut
. Go squash some bugs! Andy Fingerhut -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post

Re: Eastwood lint tools - some Qs

2014-01-13 Thread Andy Fingerhut
specify these :eastwood-arglists. Thoughts? Andy On Mon, Jan 13, 2014 at 11:56 AM, Sean Corfield s...@corfield.org wrote: Thanx for the specific example! Yeah, I've used :arglists for examples in a couple of places instead of actual argument lists. I'll fix that in 0.3.3 and may do the same

Re: Eastwood lint tools - some Qs

2014-01-13 Thread Andy Fingerhut
to something other than what defn would make it. For macros, they are all expanded during Eastwood analysis, so any incorrect number of arguments should cause an exception to be thrown during analysis, much like it would if you attempted to compile such code. Andy On Mon, Jan 13, 2014 at 6:57 PM

Re: Eastwood lint tools - some Qs

2014-01-13 Thread Andy Fingerhut
defn is a macro, and thus macro-expanded during Eastwood analysis, I believe ignoring the :arglists. I think it is really only the :arglists of functions that matter for Eastwood :wrong-arity warnings Andy On Mon, Jan 13, 2014 at 10:22 PM, Colin Fleming colin.mailingl...@gmail.com wrote

Re: clojure meetups / Stanford

2014-01-19 Thread Andy Fingerhut
is a bit more interactive than a typical mailing list. Andy On Sun, Jan 19, 2014 at 11:46 PM, t x txrev...@gmail.com wrote: Hi, (apologies for spamming non-bay area people) Is there an official site listing Clojure study-groups / meetups? In particular, I'm looking for one close

let bindings

2014-01-20 Thread Andy Smith
in this was, why cant let be implemented as a macro rather than a special form? Where have I gone wrong in my understanding here? Andy -- -- 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

Re: let bindings

2014-01-20 Thread Andy Smith
typo : was=way -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group,

Re: let bindings

2014-01-21 Thread Andy Smith
Excellent post, thank you for that. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: leiningen and local maven repo

2014-01-23 Thread Andy Fingerhut
Why did you add that to your repositories? You can do 'lein install' to install a project into your local Maven repo, and by default Leiningen will check for local copies of JARs in your local Maven repo before going out to the Internet to look for them. Andy On Thu, Jan 23, 2014 at 9:35 AM

Re: Informatica Online Training By Experienced Trainers in Australia, USA, Canada

2014-01-23 Thread Andy Fingerhut
Banned from the Clojure group for reason of spamming. Andy On Thu, Jan 23, 2014 at 1:11 PM, Sean Corfield s...@corfield.org wrote: This company has been spamming various technical lists lately with this same generic promotion. Can a moderator please report them for spam and ban them

Re: Clojure development laptop battery usage

2014-01-25 Thread Andy C
On Wed, Jan 22, 2014 at 5:29 PM, John Chijioke johnben...@gmail.com wrote: Not true. More RAM, more power. Why? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from

Re: equality

2014-01-27 Thread Andy Fingerhut
best guess is that in order to have a hash function (in this case Clojure's hash, implemented as a Java method called hasheq()) that is consistent with Clojure =, it is difficult to make such a hash function correct and fast if there were not these 3 separate categories. Andy On Mon, Jan 27, 2014

Re: MODERATION? (was: Informatica Online Training By Highly Experienced Certified Trainers

2014-01-27 Thread Andy Fingerhut
on appropriate messages for the group. I have deleted some similar messages recently, but someone else must have approved this message, because I did not. Andy On Mon, Jan 27, 2014 at 12:01 PM, Sean Corfield s...@corfield.org wrote: SunitLabs has been spamming a lot of technical lists lately. Do we

Re: clojuredocs macro

2014-01-28 Thread Andy Fingerhut
/dakrone/clojuredocs-client Andy On Tue, Jan 28, 2014 at 7:04 AM, Dave Tenny dave.te...@gmail.com wrote: Does anybody happen to know where 'clojuredocs' is defined? I grepped the clojure and leiningen git trees but the word didn't show up. I noticed it mentioned in some leiningen tutorials

Re: clojuredocs macro

2014-01-28 Thread Andy Fingerhut
I'm not sure wether it is easy, but the 'reply' namespace was in one of the symbols in your original email, and Leiningen's project.clj file lists its dependencies, which include reply. Andy On Tue, Jan 28, 2014 at 7:41 AM, Dave Tenny dave.te...@gmail.com wrote: Thank you. Is there some

Re: Request for help optimising a Clojure program

2014-01-30 Thread Andy Fingerhut
://dev.clojure.org/display/design/Better+hashing Andy On Sat, Nov 2, 2013 at 9:44 AM, Andy Fingerhut andy.finger...@gmail.comwrote: A few minutes ago I finished copying, pasting, and doing a little reformatting on Mark Engelberg's document on the subject. http://dev.clojure.org/display/design

Re: Should predicates always have one argument?

2014-01-31 Thread Andy Fingerhut
multi-argument predicate functions. Andy On Fri, Jan 31, 2014 at 8:44 AM, Ryan arekand...@gmail.com wrote: Hello, I am wondering if all my predicates should be one argument functions because I run into a couple of cases where I needed more than one. For example, I have a function called

Why do I get stackoverflow error?

2014-02-03 Thread Andy Smith
(recur (dec n) (map (partial reduce +) (partition 2 1 (concat [0] row [0]))) 500) Andy -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated

Re: Why do I get stackoverflow error?

2014-02-03 Thread Andy Smith
Correction problem #97 I mean On Monday, 3 February 2014 21:19:36 UTC, Andy Smith wrote: Hi, I am working through the 4clojure questions, I have a few different solutions to problem 87 but all of them run out of stack space. I tried to convert to using recur but I still have the problem

Re: Why do I get stackoverflow error?

2014-02-04 Thread Andy Smith
Ok thanks, thats really helpful. The second link suggests using doall, which seems to do the trick : ((fn pascal ([n] (pascal n [1M])) ([n row] (if (= n 1) row (recur (dec n) (map (partial reduce +) (doall (partition 2 1 (concat [0] row [0] 500) However you do lose the laziness, but

Re: Why do I get stackoverflow error?

2014-02-04 Thread Andy Smith
Similarly this works for my non-recursive effort, which I think is more concise : (fn [n] (nth (iterate (fn [r] (map (partial reduce +) (doall (partition 2 1 (concat [0N] r [0]) [1]) (dec n))) -- You received this message because you are subscribed to the Google Groups Clojure group. To

diagram of clojure interfaces and objects

2014-02-05 Thread Andy Smith
object model on one sheet. I suppose I can derive this from the source if not of course... Andy -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated

use/require/import and quoted form

2014-02-06 Thread Andy Smith
Hi, I was wondering why use/require and import take quoted forms as their arguments, other alternatives could be strings or keywords, so what is special about the choice of quoted form here? Andy -- You received this message because you are subscribed to the Google Groups Clojure group

Re: NoClassDefFoundError after I import with use on the repl?

2014-02-06 Thread Andy Fingerhut
in my project.clj dependencies: [me.raynes/fs 1.4.3] Andy On Thu, Feb 6, 2014 at 9:11 PM, larry google groups lawrencecloj...@gmail.com wrote: I imagine this question has been asked a million times before, but I can not find the answer. I was looking at Raynes/fs library: https://github.com

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-07 Thread Andy Fingerhut
You may also use a let form wrapped around your entire defproject if you want to avoid the duplication of code present in your example. Andy On Fri, Feb 7, 2014 at 8:22 AM, Lee Spector lspec...@hampshire.edu wrote: On Feb 5, 2014, at 11:42 PM, Michał Marczyk wrote: This returns

map semantics

2014-02-07 Thread Andy C
#(mod (% 1) 3) {:a 3, :b 6})) clojure.lang.LazySeq One would expect to (map #(mod % 3) #{3 6}) evaluate into #{0}. Is it arbitrary decision or there is a theory behind it? Best, Andy -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: map semantics

2014-02-07 Thread Andy C
user= (map #(mod % 3) #{3 6}) (0 0) user= (set (map #(mod % 3) #{3 6})) #{0} -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

Re: map semantics

2014-02-07 Thread Andy C
I do perceive sets, lists, vector as atoms which are indivisible (well, this is not true but this is popular meaning) from semantics standpoint. Therefore map is just a function which processes them as whole, again from semantics point of view. Implementation and laziness should not matter really

Re: map semantics

2014-02-07 Thread Andy C
I actually like the laziness by default but as you suggest, wish there is a way to switch it on/off for blocks of the code (rather than compiler option). Scala guys did some research and in most practical cases Lists are very short hence they are not lazy and evaluated at once. Just an interesting

Re: map semantics

2014-02-08 Thread Andy C
On Sat, Feb 8, 2014 at 12:06 AM, Sean Corfield s...@corfield.org wrote: But you're misunderstanding what map does: it converts its collection arguments to _sequences_ and then it processes those sequences. Map doesn't operate on sets, or vectors, or maps, only on sequences. Your assertion

Re: map semantics

2014-02-08 Thread Andy C
Every persistent collection in Clojure supports conversion to the sequence of items. This is clearly documented in the official docs and there is no surprise here. Would you mind to point me to that piece where doc describes what order seq chooses when converting a set to it. (I honestly tried to

Re: map semantics

2014-02-08 Thread Andy Fingerhut
an equal result). I was curious whether anyone knows whether Haskell has hash-based data structures like this, and do they somehow guarantee referential transparency? Perhaps by requiring the items to be sortable? Andy On Sat, Feb 8, 2014 at 8:19 AM, Jozef Wagner jozef.wag...@gmail.com wrote: Every

Re: map semantics

2014-02-08 Thread Andy C
First, thanks everybody for explanations of design decision behind map and collections. I should in fact change subject to seq semantics ;-). For me the bottom line is that while I do not care about order so much I still can count on that seq function will produce consistent sequences. Or wait a

Re: map semantics

2014-02-08 Thread Andy C
On Sat, Feb 8, 2014 at 1:46 PM, Jozef Wagner jozef.wag...@gmail.com wrote: Two collections equivalent by their values may easily have a different order of their items. It all boils down this: is it possible to have two clojure.lang.PersistentHashSet with identical values (in mathematical

Re: map semantics

2014-02-08 Thread Andy C
user (= s1 s2) true user (= (seq s1) (seq s2)) false Thx. If a=b then f(a) must = f(b). Something is broken here. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from

Re: map semantics

2014-02-08 Thread Andy Fingerhut
It is working as designed. If you do not want this, consider using sorted sets / sorted maps, where (= s1 s2) implies (= (seq s1) (seq s2)). Or, perhaps another programming language would be more to your liking. Andy On Sat, Feb 8, 2014 at 4:10 PM, Andy C andy.coolw...@gmail.com wrote

Re: map semantics

2014-02-08 Thread Andy C
for all the replies, Best regards, Andy -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post

Re: map semantics

2014-02-09 Thread Andy C
:-). Deriving from Lisp wisdom and expanding those powerful concepts into a modern programming is priceless. It is all good now. Pozdr, Andy -- 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

Re: [ANN] Clojure 1.6.0-beta1

2014-02-15 Thread Andy Fingerhut
/17b18350bdd28154241bc7ae80f423a5976c6de2on Jan 30 2014 near the bottom of the table for some speed comparisons versus the first column labeled Using Clojure 1.6.0-alpha3 hash (same as Clojure 1.5.1). http://dev.clojure.org/display/design/Better+hashing Andy On Fri, Feb 14, 2014 at 11:00 PM, tcrayford tcrayf...@gmail.com

Re: use/require/import and quoted form

2014-02-16 Thread Andy Smith
(require 'clojure.string) Im just wondering why the language chose to use the quote form, rather than a string or a keyword e.g. (require clojure.string) (require :clojure.string) There obviously must be a good reason why. -- You received this message because you are subscribed to the

why Clojure/Lisp is so fast

2014-02-18 Thread Andy C
or the cost of calling virtual methods is negligible. I probably should check out generated JVM byte code to see the answer firsthand but still would appreciate a higher level answer. Thanks in advance, Andy -- You received this message because you are subscribed to the Google Groups Clojure group

Re: hooks on namespace required/loaded

2014-02-18 Thread Andy Fingerhut
recommend going crazy with it, but it should be able to do the job, at least after the alter-var-root takes effect. Out of curiosity, what kind of linting does your function do? Andy On Tue, Feb 18, 2014 at 8:41 PM, t x txrev...@gmail.com wrote: With apologies for spamming: Solutions

Re: why Clojure/Lisp is so fast

2014-02-18 Thread Andy C
= (println (disassemble (fn []))) java.lang.NullPointerException at org.eclipse.jdt.internal.core.util.ClassFileStruct.u4At(ClassFileStruct.java:61) at org.eclipse.jdt.internal.core.util.ClassFileReader.init(ClassFileReader.java:76) Andy -- You received this message because you

Re: why Clojure/Lisp is so fast

2014-02-19 Thread Andy C
(being not a native speaker does not help). I actually tried it as a plugin but something else came into play so it did not work :$ Best, Andy -- 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

Re: why Clojure/Lisp is so fast

2014-02-19 Thread Andy C
The OP almost certainly intended CLISP to mean Common Lisp. I recall it now - it was Allegro CL which somebody demoed to me almost ten years ago. I wish I started learning Lisp yet cannot believe that Clojure I am learning now (and Scala I am actively using) did not exist back then. -- You

Re: fast parallel reduction into hash-set/map

2014-02-20 Thread Andy Fingerhut
to achieve? Andy On Thu, Feb 20, 2014 at 2:59 PM, Jules jules.gosn...@gmail.com wrote: So, having broken the back of fast re-combination of hash sets and maps, I wanted to take a look at doing a similar sort of thing for vectors - another type of seq that I use very heavily in this sort

Re: object identity

2014-02-26 Thread Andy Fingerhut
identical objects. Andy On Wed, Feb 26, 2014 at 11:11 AM, Brian Craft craft.br...@gmail.com wrote: Ok, trying a different way of asking this: Is it common practice in clojure to write data transforms in a way that will return the same object when possible (when the transform would be a noop

Re: object identity

2014-02-27 Thread Andy Fingerhut
transformed data structure is identical to the original, but a large fraction of the sub-structures are, so if you do a diff like comparison of an older structure and a newer one, you will find many identical sub-structures. Andy On Wed, Feb 26, 2014 at 6:14 PM, Andy Fingerhut andy.finger

map and lazy sequence

2014-02-28 Thread Andy Smith
Hi, Can someone correct my misunderstanding here. I was lead to believe that map produced a lazy sequence, so why do I get three printed trace lines in the following code : user= (take 1 (map #(do (println (str trace: %)) %) [1 2 3])) (trace:1 trace:2 trace:3 1) Thanks for your help Andy

Re: map and lazy sequence

2014-02-28 Thread Andy Smith
doh!, thanks for the above. I actually did read this a few weeks ago but totally forgot about it. :o/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

  1   2   3   4   5   6   7   8   9   10   >