Re: [ANN] Clojure 1.8.0-RC3

2015-12-07 Thread Andy Fingerhut
I have done my usual 'mvn clean test' on multiple OS/JDK combos not tested on build.clojure.org, and found nothing amiss with 1.8.0-RC3. Is http://dev.clojure.org/jira/browse/CLJ-1863 considered problematic enough to fix before 1.8.0 goes out? Andy On Mon, Dec 7, 2015 at 1:36 PM, A

Re: stack overflow

2015-12-13 Thread Andy Fingerhut
functions that are naturally written recursively. Increasing the maximum stack size would be a lot quicker. Andy On Sat, Dec 12, 2015 at 9:38 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hi Everybody, > I wrote the simple function for computing the number of > bin

[ANN] Eastwood, the Clojure lint tool, version 0.2.3 released

2015-12-15 Thread Andy Fingerhut
Eastwood, the Clojure lint tool, version 0.2.3 has been released. See install instructions and complete documentation at [1]. Below are some of the changes since version 0.2.2. A complete list is at [2]. Go squash some bugs! Jonas Enlund, Nicola Mometto, and Andy Fingerhut [1] https

Re: [ANN] Clojure 1.8.0-RC5

2016-01-13 Thread Andy Fingerhut
Results of some testing done on 1.8.0-RC5: Ran 'mvn clean test' on a few OS/JDK combos that are not tested as often. Reason: there have been (or still are) build or test failures with some of them. All JDKs listed below were 64-bit. Windows 7 Enterprise SP1 + Oracle JDK 1.7.0_80: ok 3/3 trials U

[ANN] Updated Clojure cheatsheet, including new vars in Clojure 1.8.0

2016-01-19 Thread Andy Fingerhut
anges made available here: https://github.com/jafingerhut/clojure-cheatsheets/blob/master/src/clj-jvm/CHANGELOG.txt 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

Re: Heard about clojure today. is it one of the big tecnologies for the future? or is it becoming deprecated?

2016-01-20 Thread Andy Fingerhut
was designed for straightforward use of Java libraries, too. Alex Miller co-organizes 3 Clojure conferences per year. Alex, perhaps there is some rough attendance data at those you would be willing to share? Andy On Wed, Jan 20, 2016 at 8:04 AM, Miguel Domingos < miguel.gomes.domin...@gmail.

Re: Clojure beyond Java 6 ?

2016-01-22 Thread Andy Fingerhut
e have been any discussions of whether any features new in JVM 8 would enable enhancements in Clojure. Andy [1] https://groups.google.com/forum/#!searchin/clojure-dev/invokedynamic On Fri, Jan 22, 2016 at 12:51 PM, Didier wrote: > > I’ve defended Clojure’s continued support for Java 6 on

Anyone use Eastwood lint tool on a Clojure project managed by boot?

2016-01-25 Thread Andy Fingerhut
to use Eastwood on such a project, I'd love to include them in the Eastwood docs. Thanks, Andy [1] https://github.com/jonase/eastwood -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: Common runtime errors in clojure

2016-02-06 Thread Andy Fingerhut
n try them out and see. Andy On Sat, Feb 6, 2016 at 2:26 PM, kovas boguta wrote: > Compiling a list of these common errors is a great idea (particularly if > then turned into some kind of How-To guide for interpreting errors) > > I think anyone who learns Clojure learns to subconsci

Re: Undocumented reader macros?

2016-02-10 Thread Andy Fingerhut
It may be as finished as it will ever be. Andy On Wed, Feb 10, 2016 at 8:35 AM, James Elliott wrote: > Ah, I see that part of the reason it’s not yet documented is that it’s not > really finished; you can’t, for example, use a keyword as a function with > it. Trying to use #=(:

Re: Welcome the new maintainer of Loom: Paul Snyder

2016-02-14 Thread Andy Fingerhut
I had never seen JUNG before. I've not looked at its implementation at all, but the demos are pretty impressive. As you say, graphviz is nice for what it does, but I did not realize there was an open source 'graphical graph manipulator' like this. Andy On Sun, Feb 14, 2016 at 1

Re: Implementing Clojure

2016-02-27 Thread Andy Fingerhut
there are probably best answered by the implementation itself. Andy On Sat, Feb 27, 2016 at 5:38 PM, evins.mi...@gmail.com < evins.mi...@gmail.com> wrote: > > > On Saturday, February 27, 2016 at 7:09:39 PM UTC-6, Alan Moore wrote: >> >> It kind of depends on the backend you

Re: find shorter clojure code automatically

2016-03-03 Thread Andy Fingerhut
kibit Andy On Thu, Mar 3, 2016 at 1:28 PM, Max Countryman wrote: > Hi Jeremy, > > My understanding is Eastwood might be a tool which can find some specific > kinds of syntax sugar in automated way. Check it out: > > https://github.com/jonase/eastwood/blob/master/README.md >

changes in logging in 1.8?

2016-03-10 Thread Andy L
executed during uberjar generation (provided my assumption is valid)? 2) what changed in 1.8 to cause that? Thanks in advance, Andy = sources $ cat project.clj src/core.clj (defproject tmp "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.8.0"] [stylef

Re: Possible to override assoc-in or update-in?

2016-04-20 Thread Andy Fingerhut
also implements all of the methods that regular Clojure maps do, so all normal map operations work on priority-maps, too. Its implementation may give you some ideas for one way to do what you are hoping for. Andy [1] https://github.com/clojure/data.priority-map On Wed, Apr 20, 2016 at 10:18 AM

Re: Memory Locality - Maps vs. Vectors vs. Transient Maps & Vectors

2016-04-20 Thread Andy Fingerhut
-transient data structure. Andy On Wed, Apr 20, 2016 at 11:03 AM, JvJ wrote: > I'm writing some code that I would like to perform as quickly as > possible. Currently, I am iterating over large hash maps and performing > assocs and dissocs. > > I don't know much about

Re: Are strings vectors? Should 'get' docstring be changed?

2016-04-21 Thread Andy Fingerhut
cs.org and conj.io take user submissions for additional documentation, with quite low friction. Andy [1] https://www.youtube.com/watch?v=FihU5JxmnBg On Thu, Apr 21, 2016 at 8:48 AM, Mars0i wrote: > The docstring for 'get' says nothing explicit about vectors ("Returns the > va

Re: Tiny fix for LispReader

2016-04-26 Thread Andy Fingerhut
Frank: I am pretty sure that the intent is that strings like 077 are read as octal, and in Clojure 1.8.0 this is what happens, e.g. (read-string "077") evaluates to the integer 63 (decimal), not 77. Thus it is intentional that (read-string "08") and (read-string "09"

Re: CCW stopped working. How do I fix it?

2016-05-04 Thread Andy Fingerhut
id, in some way the application doesn't handle. 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 yo

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

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"

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

2014-02-06 Thread Andy Fingerhut
ng 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 lookin

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 wrote: > > On Feb 5, 2014, at 11:42 PM, Michał Marczyk wrote: > > &g

map semantics

2014-02-07 Thread Andy C
q user=> (type (map #(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 Goog

Re: map semantics

2014-02-07 Thread Andy C
On Fri, Feb 7, 2014 at 7:53 PM, Atamert Ölçgen wrote: > Why should it build a concrete result? > I realize the benefits of using LazySeq and do not have a strong opinion besides things gotta be consistent. Putting practical advantages and having a good default behaviour aside, I was wondering i

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 pat

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 a

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-07 Thread Andy C
> Following your intuition, what would you expect from the following? > > (map + [1 3 5] '(2 4 6)) > # => ? > It only gets worse, as the result of below should be undefined (using classic set definition): user=> (map + #{0 1} #{0 1}) (0 2) user=> (map + #{1 0} #{1 0}) (0 2) -- You received this

Re: map semantics

2014-02-08 Thread Andy C
On Sat, Feb 8, 2014 at 12:06 AM, Sean Corfield 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 that I "am misun

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
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 wrote: > Every persistent collect

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 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 sense) but producing

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 pos

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 wrote: > > user> (= s1 s2

Re: map semantics

2014-02-08 Thread Andy C
ks again 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 yo

Re: map semantics

2014-02-09 Thread Andy C
e-offs" :-). 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

Re: [ANN] Clojure 1.6.0-beta1

2014-02-15 Thread Andy Fingerhut
ure/clojure/commit/17b18350bdd28154241bc7ae80f423a5976c6de2>on 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

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 G

why Clojure/Lisp is so fast

2014-02-18 Thread Andy C
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&q

Re: hooks on "namespace required/loaded"

2014-02-18 Thread Andy Fingerhut
x27;t 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 wrote: > With apologies for spamming: > > Solutions that involve

Re: why Clojure/Lisp is so fast

2014-02-18 Thread Andy C
27;no.disassemble) # no.disassemble=> (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.(ClassFileReader.java:76) Andy -- You received this

Re: why Clojure/Lisp is so fast

2014-02-19 Thread Andy C
posed to "above" (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,

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. -- Y

Re: fast parallel reduction into hash-set/map

2014-02-20 Thread Andy Fingerhut
achieve? Andy On Thu, Feb 20, 2014 at 2:59 PM, Jules 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 of situation. &

Re: object identity

2014-02-26 Thread Andy Fingerhut
no longer returning identical objects. Andy On Wed, Feb 26, 2014 at 11:11 AM, Brian Craft 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 b

Re: object identity

2014-02-27 Thread Andy Fingerhut
that the entire 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 Fing

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 yo

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 m

Re: case statement and java constants

2014-02-28 Thread Andy Fingerhut
that its doc strings and source code are for Clojure 1.3, but the examples are free form and can say whatever you want, and there is very useful info in those examples that applies to Clojure 1.4, 1.5.1, and the forthcoming 1.6 just as well. Andy On Fri, Feb 28, 2014 at 9:36 AM, Herwig

LazySeq.seq()

2014-02-28 Thread Andy Smith
Hi, Looking at the codefor LazySeq.seq() I was wondering why a 'while' loop is used rather than an 'if' and a recursive call to ls.seq(), which would be cleaner code I guess? Am I right to suspect this simply an

clojure lazy-seq caching?

2014-03-02 Thread Andy Smith
Hi, I understand that lazy-seq caches the computed result as each element is read. However, how can is this made to be thread-safe? Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: use/require/import and quoted form

2014-03-02 Thread Andy Smith
Oh I see, so we are using exactly the right datatype for the purpose... thanks :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 moderated - please b

Re: clojure lazy-seq caching?

2014-03-04 Thread Andy Smith
Does this mean that in a single threaded application lazy sequences suffer the overhead of locks? I thought one of the features of clojure is that it tries to avoid locks as much as possible. Andy -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: transient map bug?

2014-03-06 Thread Andy Fingerhut
What your code is doing is sometimes called "bashing transients in place". See some discussion here: http://clojuredocs.org/clojure_core/clojure.core/assoc! As explained there, you should always use the return value of assoc!, just as you would always use the return value of assoc. And

Re: declare and def

2014-03-13 Thread Andy Fingerhut
explicit signal to the human reader that you do not intend to give this var a value now, but you plan to later, either because of mutual recursion in definitions, or for a preferred order of definitions in the file that you believe is clearer. Andy On Thu, Mar 13, 2014 at 7:14 AM, Gal Dolber wrote

STM and persistent data structures performance on mutli-core archs

2014-03-13 Thread Andy C
feel puzzled. He seems to have a point but really does not back it with any details. There is also a claim that STM does not cooperate well with GC. Is it true? Thanks, Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: STM and persistent data structures performance on mutli-core archs

2014-03-13 Thread Andy C
. I think that it will be very cool. 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 that posts from new members are moderated - please be patient with your first

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Andy C
Maybe one day this idea http://en.wikipedia.org/wiki/Lisp_machine will come back, I mean in a new form .. In any case, I think that it would be great to see some performance benchmarks for STM A. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
s no need for explicit synchronization in most of cases. BTW, I absolutely love the "async" name itself chosen by Clojure authors as opposed to "reactive" as in http://www.reactivemanifesto.org. Reactive comes with bad connotations and really does not reflect the intentions well.

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
> Today, data is scattered > everywhere in a huge memory, > its location changes frequently, > code can be dynamically compiled, > get loaded by small chunks, > It describes my case actually - I am loading about 2-8GB of "stuff" in the memory and to tons of mapping, grouping by and filtering

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
itself (I mean are code alternations are easy straightforward or you have to write it from scratch)? I do not mean to troll, just sincere curiosity ... Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

is it good?

2014-03-17 Thread Andy C
=> (defn mimasuco ([x] [x x x 1]) ([x & y] (reduce combine (mimasuco x) y))) #'user/mimasuco user=> (mimasuco 1 2 3 4) [1 4 10 4] user=> (mimasuco 100) [100 100 100 1] I try to stick to classic scheme like coding but wonder if there is more Clojure idiomatic way of doing this. A

Re: is it good?

2014-03-18 Thread Andy C
Thx for hints. > As for the main function, my tendency would be to avoid taking cases on > the number of args > Is that due to performance implications, I mean that it takes longer to check cases every time? Or just a style. BTW, I followed https://github.com/clojure/clojure/blob/master/src/clj/

Re: STM and persistent data structures performance on mutli-core archs

2014-03-18 Thread Andy C
t;limits itself to responding to events which implies a control by some sort of FSM. Perhaps concurrency could be modeled using FSMs, but I do not believe it is always a simple transition. Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: STM and persistent data structures performance on mutli-core archs

2014-03-18 Thread Andy C
from multiple threads" and get it handled by "the mutator thread". But at the same time I hate to have my imagination be "limited" by the hardware designs. That really hurts :-). Best regards, Andy -- You received this message because you are subscribed to the Google Gro

Re: Finding maximum weighted graph matchings

2014-03-18 Thread Andy Fingerhut
That is true for maximum matching (weighted or not) in bipartite graphs. Max (weighted) flow methods do not work for matchings in general graphs. Andy On Tue, Mar 18, 2014 at 9:31 AM, Jason Felice wrote: > I thought matching was a dual of max flow, so weighted matching was a dual >

Re: STM and persistent data structures performance on mutli-core archs

2014-03-18 Thread Andy C
On Tue, Mar 18, 2014 at 11:06 AM, Raoul Duke wrote: > > some sort of FSM. Perhaps concurrency could be modeled using FSMs, but I > do > > not believe it is always a simple transition. > > http://www.cis.upenn.edu/~stevez/papers/LZ06b.pdf > I like FSMs, but they do not compose well. A. -- You

reduced

2014-03-19 Thread Andy Smith
le to resolve symbol: reduced in this context, compiling:(NO_SOURCE_PATH:0) Any ideas? Thanks 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 member

Re: reduced

2014-03-19 Thread Andy Smith
ah ok... i worked around this using a restriction on the input collection, but i think it is less concise : (fn [x b] (if (zero? x) [0] (reduce #(let [r (quot x %2) d (mod r b)] (conj %1 d)) '() (take-while #(<= % x) (iterate (partial * b) 1) -- You received this message because you are s

Re: STM and persistent data structures performance on mutli-core archs

2014-03-19 Thread Andy C
So, the following test puzzles me. Not because it takes virtually the same time (I know that Fork/Join is not cheap and memory is probably the biggest bottleneck here). But because I do not get why map (as opposed to r/ma) uses all 8 cores on my MacBookPro. All of them seem to be running according

Re: STM and persistent data structures performance on mutli-core archs

2014-03-19 Thread Andy C
On Wed, Mar 19, 2014 at 11:14 AM, Raoul Duke wrote: > > I like FSMs, but they do not compose well. > > some have argued for generative grammars that generate the fsm, > because it is generally easier to compose grammars, and then generate > the final fsm. iiuc. > I thought about it too but compo

[ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Andy Fingerhut
ready been discovered, and their causes documented, while testing Eastwood on most of the Clojure contrib libraries, Clojure itself, and over 35 other open source libraries. Go squash some bugs! Andy Fingerhut -- You received this message because you are subscribed to the Google Groups "Clo

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Andy Fingerhut
practical way to try to include "everything" in a more general compare function so that everything hashable (i.e. every Java object) is also comparable. Would it be easier to create a 'universal compare' function for all Clojure values, assuming they only contained Clojure value

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Andy Fingerhut
In case it isn't clear, I don't think such drastic changes could ever hope to be done in a reasonable time frame for Clojure 1.6.0. Probably better to have a different thread for this if there is interest in discussing it. Andy On Thu, Mar 20, 2014 at 10:03 AM, Andy Finge

local mutable state

2014-03-20 Thread Andy Smith
it ought to be thread-safe right? Thanks 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 f

Re: local mutable state

2014-03-20 Thread Andy Smith
Also from the proteus link, i read 'these variables cannot escape the local scope; if passed into a function or closed over', which is a problem with code such as in my example I suppose. I wasnt trying to avoid the functional approach but just being devils advocate. Thanks for your comments.

Re: [ANN] Eastwood 0.1.1 Clojure lint tool

2014-03-20 Thread Andy Fingerhut
version no longer does, and Eastwood 0.1.1 does depend on the latest release 0.1.0-beta8 of that lib. Eastwood 0.1.0 uses an older one that I think would show the warnings you see. Andy On Thu, Mar 20, 2014 at 1:37 PM, Sean Corfield wrote: > Thanx for Eastwood - it's a great tool! &

Re: Perfect Functional Shuffle in Clojure

2014-03-20 Thread Andy Fingerhut
il or false will be treated as true). I prefer to write two-branch cond statements using if rather than cond. Andy On Thu, Mar 20, 2014 at 1:59 PM, Peter Brachwitz wrote: > I tried to implement perfect functional shuffle in Clojure as outlined in > http://okmij.org/ftp/Haskell/perfect-

threading operators

2014-03-21 Thread Andy Smith
I should write a macro to swap the second and last items of a form? 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 b

Re: local mutable state

2014-03-21 Thread Andy Smith
Im also interested as to why the mutable state approach would be less performant? In the single thread case the locks would be optimized out right? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: local mutable state

2014-03-21 Thread Andy Smith
Excellent point... thanks for the insight On Thursday, 20 March 2014 20:34:47 UTC, tbc++ wrote: > > Not to mention that this isn't local mutation. You are handing the atom to > a closure that then gets wrapped by lazy-seq and returned. So the atom may > actually sit around for some time. > --

Re: threading operators

2014-03-21 Thread Andy Smith
yes I saw that, but it only works from thread-first to thread-last? i.e. this works (-> x (->> f g h)) but I think the following would fail : (->> x (-> f g h)) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: threading operators

2014-03-21 Thread Andy Smith
Im wondering if it is worthwhile to create a macro to thread together arbitrary forms (x, f, g, h) injecting the result into different positions into the list as required? (thread-together (-> x f ->> g -> h)) -- You received this message because you are subscribed to the Google Groups "Clo

Re: How did you learn Clojure?

2014-03-21 Thread Andy Smith
Im in the process of learning, and I found that the clojuretv talks and presentations on youtube were useful. Also the video and sample code for Rich Hickey's Ants demo is an excellent intro to how concurrency works in clojure : https://www.youtube.com/watch?v=dGVqrGmwOAw https://gist.github.co

Re: threading operators

2014-03-21 Thread Andy Smith
gt; out of date makes this sort of thing harder to find): > > (as-> "/tmp" x > (foo x) > (bar 1 2 x) > (baz x 3 4) > (quux 5 x 6)) > > > > On Fri, Mar 21, 2014 at 7:08 AM, Paul L. Snyder > > > wrote: > >> >>

apply to quoted form

2014-03-21 Thread Andy Smith
I came across the following issue when doing problem user=> (let [f '(+ 1 1)] (apply (first f) (rest f))) 1 I could use eval but eval is bad (apparently)... Investigating this further I can see that : user=> (let [f '(+ 1 1)] (type (first f))) clojure.lang.Symbol wheras : user=> (type +) clo

Re: apply to quoted form

2014-03-21 Thread Andy Smith
that is 'problem 121 from 4clojure' http://www.4clojure.com/problem/121 -- 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

Re: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-21 Thread Andy Fingerhut
change? It isn't a big change in the code, so it would have to have been close to the threshold if this is true. Andy On Fri, Mar 21, 2014 at 3:51 PM, Stefan Kamphausen wrote: > Hi, > > > after two days of git bisecting and running my tests over and over again, > I give up. Wh

Re: apply to quoted form

2014-03-22 Thread Andy Smith
=> (type (var x)) clojure.lang.Var user=> (var x) #'user/x user=> (type 'x) clojure.lang.Symbol user=> (var 'x) CompilerException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(/tmp/form-init8428687381658026649.clj:1:1) Andy

Re: apply to quoted form

2014-03-22 Thread Andy Smith
Secondly, 4clojure tells me use of resolve is bad as well : i.e. the following is my latest code (fn evaluate [c m] (let [ [f & as] (map #(if (sequential? %) (evaluate % m) (let [x (m %)] (if x x %))) c)] (apply (resolve f) as))) -- You receive

Re: apply to quoted form

2014-03-22 Thread Andy Smith
my bad, the above example is wrong it is meant to return a function of the environment mappings : (fn !! [c] (fn [m] (let [ [f & as] (map #(if (sequential? %) ((!! %) m) (let [x (m %)] (if x x %))) c)] (apply ({'/ / '+ + '- - '* *} f) as --

Re: apply to quoted form

2014-03-22 Thread Andy Smith
After the above discussion, I suspect that the point of this 4clojure question is that using eval or resolve opens up the possibility for a user of the function to inject arbitrary code into the 'Universal Computation Engine', whereas using a map necessarily restricts the operations to the 'all

creating a map

2014-03-26 Thread Andy Smith
Hi all, I was wondering why this doesn't create a map 1 -> 2 : (into {} (partition 2 2 "12")) Must be yet another misunderstanding of mine. Thanks Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

updating the last member

2014-03-27 Thread Andy Smith
%)) 5)) So, what am I doing wrong? P.S. I know I could reverse the order of the data in the lists (i.e. probably changing to lists rather than vectors for conj-ing purposes), but im interested in vectors specifically. Thanks Andy -- You received this message because you are subscribed t

Re: updating the last member

2014-03-27 Thread Andy Smith
P.S. in the above, I am assuming that the length of the leaf vector [1 2 3] is not known : i.e. I cant call (assoc-in [1 [1 2 [1 2 3]]] [1 2 2] 5) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: updating the last member

2014-03-27 Thread Andy Smith
P.P.S My assumption that I could use lists fails because lists arent associative so the following doesnt work either : (let [xs '(1 2 3)] (assoc xs 0 2)) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: updating the last member

2014-03-27 Thread Andy Smith
I was hoping there would be something like the :last keyword out of the box? -- 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 patie

[ANN] Clojure cheat sheet (v13)

2014-03-27 Thread Andy Fingerhut
stions from those who are familiar with them, I will probably just toss them all together in one new category for reducers and stick them somewhere. Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

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