Re: [ANN] Discontinuing 4clojure.com

2021-07-05 Thread Gary Verhaegen
Thanks a lot for keeping it running for so long! 4clojure was really instrumental in my Clojure journey. On Sun, 4 Jul 2021 at 22:26, Alan Malloy wrote: > TL;DR: Turning off 4clojure.com by the end of July 2021 > > Hello, 4clojure problem solvers. You've probably noticed SSL errors on > 4clojure

Re: How to get a value of a var in Java

2021-06-18 Thread Gary Verhaegen
The official Clojure API for Java is defined here and only supports importing Clojure vars under the IFn interface. In other words, you can only import Clojure functions, not Clojure values, through that API. What you are try

Re: How to Programmatically Create Unqualified Keywords?

2018-03-22 Thread Gary Verhaegen
I think there's some confusion here between the keyword and its textual representation. The root issue is that the keyword function is, in a way, too lenient in its error checking: it will allow you to create keywords that are not valid according to the language definition. The Clojure reader i

Re: If Clojure is to blame for the majority of the startup time, why doesn't ClojureScript proportionally slow down the JavaScript startup time also?

2018-01-24 Thread Gary Verhaegen
I've read a mot of discussions around that but have never myself looked into the details, so the following may be completely wrong. My understanding is slightly different: the JVM does not actually load a class before it is first accessed by running code. What takes a long time for the JVM and

Re: Officially support Vert.x

2018-01-10 Thread Gary Verhaegen
It’s not clear what the "do" is supposed to mean in those defns (unless there’s some deep dark magic going on, they are currently not doing anything and you can just remove them), and you very likely want "let" instead of "def" for the local variables. def in Clojure does not follow lexical sco

Re: Lazy sequences (once again?)

2018-01-08 Thread Gary Verhaegen
It really boils down to understanding garbage collection: memory that cannot be reached anymore is freed. In the first code sample, when running (last r), the compiler has detected that r is never used afterwards, so it clears the local variable. This means that while last is walking through the

Re: [ANN] Git Deps for Clojure!

2018-01-08 Thread Gary Verhaegen
Have you considered adding an equivalent to lein’s pedantic option, i.e. an option that would die on ambiguous versions rather than make a choice, thereby forcing users to make that choice explicit as a top-level entry? (Or through exclusions etc.) As an aside, is it even possible on the JVM to

Re: Clojure spec generate and instrument in cascade

2018-01-07 Thread Gary Verhaegen
A Google search for "clojure spec generate" turned up this for me on the first page of results: https://github.com/stathissideris/spec-provider It may or may not fit your use-case, but scanning through the README it seems at least related to what you're looking for. On 7 January 2018 at 18:25, Az

Re: core.async consumer + producer working by chunk?

2018-01-05 Thread Gary Verhaegen
On 5 January 2018 at 19:44, Rob Nikander wrote: > Hi, > > I’m wondering if there is a core.async design idiom for this situation... > > - A buffered channel > - One producer feeding it > - A bunch of consumers pulling from it. > - Producer should wake up and fill the channel only when it’s empty.

Re: Advice on Shell Scripting with new "clojure" binary

2018-01-05 Thread Gary Verhaegen
On 4 January 2018 at 23:26, Delon Newman wrote: > Also, any additional advice with respect to using Clojure for shell > scripting would be appreciated. Unless you have a specific reason to prefer the JVM to Node as a platform for your script, I'd encourage you to take a look at Planck and Lumo fo

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Gary Verhaegen
ue of mine; you can find his papers by googling "amine ghrab graph olap". On 4 January 2018 at 18:19, Ben Kovitz wrote: > On Thursday, January 4, 2018 at 4:01:41 AM UTC-5, Gary Verhaegen wrote: > >> Have you considered encoding your port graph into a normal graph? > >

Re: [ANN] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-04 Thread Gary Verhaegen
To (possibly) clarify, I think what Tim meant was more along the lines of "have your code depend on the java.nio package, which means it will die at compile time on Java 1.6 and lower with a ClassNotFountException, and therefore say in the README that this requires Java 1.7+". On 4 January 2018 at

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Gary Verhaegen
If you’re shopping around for ideas as to how to define data manipulation API, it may be worth taking some time looking at Specter too. Have you considered encoding your port graph into a normal graph? That would require you to define a mapping, but would then allow you to fairly easily reuse t

Re: Call custom Clojure function with dependencies from Java

2017-12-30 Thread Gary Verhaegen
On 29 December 2017 at 18:19, Pablo J. Villacorta wrote: > Thanks! You are right, I have tried another minimal statement and does not > throw any exception... looks like the statement on that repo is not correct > either (I don't know what's wrong with it), but don't know how to output > proper e

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-30 Thread Gary Verhaegen
What version of clojure.tools.logging are you using? > On 30 Dec 2017, at 02:05, Luc wrote: > > I went through the compiler code, it has to do with a bad local binding > expression. > > It crashes in the same way in the REPL with this minimal defrecord: > > (defrecord NoopJob [name job-contro

Re: Officially support Vert.x

2017-12-29 Thread Gary Verhaegen
Is vert.x an absolute (external) requirement, or is that a tool you want to use to achieve some goal? If the latter, maybe there are other tools in the Clojure ecosystem that you could use instead? On 29 December 2017 at 13:49, Toby Crawley wrote: > The short answer is no, there is no Clojure su

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-29 Thread Gary Verhaegen
Can you try deleting code until the error disappears, and try to get to a minimal reproducing case that way? Does it still happen if the protocol and record are in the same ns? Does it still happen if you remove the reset! and >!! forms? Is that whole code within a custom macro? The name e# for th

Re: spec key aliasing or different specs for same keyword

2017-12-29 Thread Gary Verhaegen
You could always extract specific keys from the payload and validate that, something like: (GET "/..." req (let [b (:body req) data {:my/result (:resultCount b) :my/other-key (get-in b [:some :path])}] (my-business-logic data))) i.e. spec what your code (my-business-lo

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-26 Thread Gary Verhaegen
The spec is correct; your code is wrong and I don't know how you got your expansion there. $ lein try org.clojure/clojure 1.9.0 nREPL server started on port 55018 on host 127.0.0.1 - nrepl:// 127.0.0.1:55018 REPL-y 0.3.7, nREPL 0.2.12 Clojure 1.8.0 Java HotSpot(TM) 64-Bit Server VM 1.8.0_144-b01

Re: Call custom Clojure function with dependencies from Java

2017-12-26 Thread Gary Verhaegen
On 26 December 2017 at 14:54, Pablo J. Villacorta wrote: > Thank you so much guys. > > Yes, it is an error launched by the library, but with a statement that > should be valid since I copied it from the github page of the project. It > seems that the "@cec1ce2" means something but I don't know...

Re: Call custom Clojure function with dependencies from Java

2017-12-24 Thread Gary Verhaegen
schema.utils.NamedError does not look like a loading error; is there any chance that could be an error thrown by the library? Are you positive "some string" is a valid argument to validate-statement-data? A cursory look at the README of xapi-schema seems to indicate that function will throw an

Re: Unexpected performace of transducers

2017-12-18 Thread Gary Verhaegen
Yes. > On 17 Dec 2017, at 15:56, Matan Safriel wrote: > > Thanks Gary, Alex, Didier, I learned a lot from your replies. > As per iota, I assume we're talking about this library of course. > > > On Sun, Dec 17, 2017 at 2:40 PM, Gary Verhaegen > wrote: &g

Re: Unexpected performace of transducers

2017-12-17 Thread Gary Verhaegen
The iota library implements a reducible object on top of files. It may be worth trying out for your use-case. > On 17 Dec 2017, at 00:32, Alex Miller wrote: > > > >> On Saturday, December 16, 2017 at 2:39:14 PM UTC-6, Matan wrote: >> Hi, >> >> As this thread seems to have been going down th

Re: Map Keywords are functions, why not vector elements?

2017-11-14 Thread Gary Verhaegen
If you're going to call that for multiple elements of the same vector, it's worth thinking about doing some work upfront so that each look-up is faster: (defn indices [vect] (->> vect (map-indexed vector) (reduce (fn [acc [idx el]] (update acc el (fnil conj []) idx

Re: hashmap keys

2017-11-12 Thread Gary Verhaegen
Retrieving a value from a hashmap goes through the following steps: 1) Compute the hashcode of the supplied key. 2) Navigate through the map's internal tree structure to the bucket that should contain this hashcode (the complexity of this step depends on the number of different hashcodes stored in

Re: difference between first & peek; rest & pop

2017-11-10 Thread Gary Verhaegen
Using a dynamic language doesn't mean you should not think in terms of (abstract) types; it only means that you're note relying on the compiler to check types for you. If anything, that should encourage you to be more disciplined in your thought processes (as you don't have anything else to rely on

Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-13 Thread Gary Verhaegen
>From the description of your problem, it's not really clear to me why you insist on using strings. Why not use the functions directly? Functions can serve as keys in maps. Granted, it's a bit ugly to print. You could also build a map of string to function yourself. Not sure what the performance of

Re: Is there a better way to get to `Classname[].class` ?

2017-10-10 Thread Gary Verhaegen
> > > (defn array-class-for [class-name] > > (class (make-array class-name 1))) > > > >> On Monday, October 9, 20

Re: Help with strange test output when deftest used inside a macro

2017-10-10 Thread Gary Verhaegen
is is looking for specific patterns and, if it can't find a known one, defaults to assuming its argument is a random predicate and prints that. So what's happening here is the syntax quote expands (resolves) = to clojure.core/= and thus it doesn't match the pattern for = anymore. So you'd need

Re: Is there a better way to get to `Classname[].class` ?

2017-10-09 Thread Gary Verhaegen
You can generally use ^"[fully.qualified.ClassName" as the type hint, if that's what you're trying to do. I'm not quite sure of the benefits of typing an array when it's not a primitive one, though. What are you trying to accomplish, if we zoom back a little bit? Maybe there's a better way to d

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Gary Verhaegen
Not easy to be positive without more information about your code base, but the only times I had symptoms that resemble what you describe, the problem was that the JVM died before printing. That is, you have multiple threads, and printing is asynchronous at many levels (even the terminal itself buff

Re: How to try/catch Let bindings?

2017-10-08 Thread Gary Verhaegen
As others have noted, this is pretty much what monads are made for. I've found Brian Marick's "Functional Programming for the Object-Oriented Programmer"'s chapter on monads really good at teaching how to recognize situations where monads would be a good fit. For this specific use-case, you can pr

Re: ref strange behavior

2017-08-28 Thread Gary Verhaegen
I wasn't satisfied with the various answers to both this thread and the StackOverflow question, so I spent a bit more time digging; it turns out this was a bug in the range implementation that was fixed in 1.9.0-alpha11. I've added a bit more details on StackOverflow [1]; the full story is on the t

Re: Joy of Clojure : Backward running lisp ??

2016-06-23 Thread Gary Verhaegen
In functional programming, you work with functions. Functions have a well-defined list of inputs and a single output. So you can say of the function cons, for example, that it takes as input a value and a list, and yields as output a new list with the value prepended to the given list; for example

Re: Access user created Java package from Clojure

2016-06-01 Thread Gary Verhaegen
As long as you're working purely in Clojure, Leiningen mostly protects you from having to know about the JVM and its infamous classpath. But when you're trying to interoperate with Java code, you need to know a few things. So, here's the very minimum I think you need to know to understand what is

Re: Puzzle solving in Clojure

2016-04-12 Thread Gary Verhaegen
On 12 April 2016 at 14:58, Cornelius Goh wrote: > True. Clojure doesn't provide tail call optimization. According to Daniel > Higginbotham book "Clojure for the Brave and True" (Page 102) he suggests > using "recur" for performance reasons. > > That is, in Olivier's original code, (sorry, withou

Re: Attempt At Futures

2016-04-09 Thread Gary Verhaegen
You could: * Create all futures *without* deref'ing them, so they all start in parallel; * Loop through the futures, asking them if they have finished, and print those that have (and remove them from the list) But if you want to get each result as it comes back, it's probably a better fit for cor

Re: Advice getting started with concurrency and parallelism in Clojure

2016-04-07 Thread Gary Verhaegen
The two resources that helped me most with concurrency and parallelism are "Java Concurrency in Practice" and "ZeroMQ — The Guide". Introductory Go books are also enlightening. Once you have a clear understanding of the underlying concepts in general, understanding how they are accessible in Cloju

Re: I am wondering if there is a better way to validate and read-in clojure data?

2016-03-13 Thread Gary Verhaegen
First off, unless you have a very good reason not to, you know the differences, and you know what you are doing, always use the "read" functions from clojure.edn rather than from clojure.core. When you say "bad data", is it malformed (as in not valid EDN) or is it not conforming to the expected sc

Re: is there an implementation of GraphQL in Clojure?

2016-03-10 Thread Gary Verhaegen
There is a Java solution in that list at: https://github.com/andimarek/graphql-java You could use that directly through interop. If you're feeling generous, you could even build a Clojure wrapper around it and release that as open-source. On Thursday, 10 March 2016, wrote: > > I am looking her

Re: Feedback on idiomatic API design

2016-03-10 Thread Gary Verhaegen
I would suggest a slightly different approach. First, define a record for your fake server, which implements Closeable; put your current "shutdown" code in the close method. This will allow you to use the existing with-open macro, instead of having to redefine your own, while leaving the option of

Re: [ANN] CIDER 0.11 Released!

2016-03-03 Thread Gary Verhaegen
Thanks Bozhidar! On Thursday, 3 March 2016, Leon Grapenthin wrote: > Congratulations. Cider is really awesome! > > On Thursday, March 3, 2016 at 6:42:48 AM UTC+1, Bozhidar Batsov wrote: >> >> Hey everyone, >> >> CIDER 0.11 (a.k.a. Bulgaria) is finally out! >> >> Today Bulgarians (like me) celebr

Re: Clojure as first language

2016-02-26 Thread Gary Verhaegen
On Friday, 26 February 2016, Terje Dahl wrote: > Lee. > > About the confusion with parens - do you mean that an output-ed list/seq > looks exactly like a callable s-expression? > Please elaborate. > > Terje > Yes. If you print the list (1 2 3) it prints as a callable form, and then you have to g

Re: ExceptionInInitialization error

2016-02-25 Thread Gary Verhaegen
The lein deps :tree message (on stderr, which may be why it was not included in your mail?) said: Possibly confusing dependencies found: [cheshire "5.3.1"] overrides [riemann "0.2.10"] -> [clj-http "1.1.2" :exclusions [org.clojure/tools.reader]] -> [chesh ire "5.4.0" :exclusions [org.clojure/clo

Re: ExceptionInInitialization error

2016-02-24 Thread Gary Verhaegen
;] > [cheshire "5.3.1"]] > :java-source-paths ["src/java"] > :resource-paths ["resources" "conf"] > :jvm-opts ["-XX:+UseConcMarkSweepGC"] > :profiles {:ship {:aot :all > :omit-source true} &

Re: Add support for seq on Java streams?

2016-02-24 Thread Gary Verhaegen
In the mean time, you can probably get pretty far with the java.util.stream.BaseStream#iterator method and the clojure.core/iterator-seq function. On Tuesday, 23 February 2016, Alex Miller wrote: > It may, however keep in mind that Clojure supports Java 1.6+ and Stream > was added in 1.8. That's

Re: Compojure does not augment response map

2016-02-24 Thread Gary Verhaegen
My understanding is that compojure concerns itself mostly with routing and does not try (anymore?) to handle response maps. Concerning ring.util.response, I think these functions are meant to be threaded: (-> (not-found "oh noes") (content-type "text")) On Wednesday, 24 February 2016, Torste

Re: ExceptionInInitialization error

2016-02-24 Thread Gary Verhaegen
No sign of conflict there - that's a bit surprising. Can you post your project.clj? Do you have any explicit exclusions? What did you change last before it broke? Is it possible that you somehow corrupted your Maven repository and are missing the mentioned class? Maybe it's not a dependency issue

Re: Compojure does not augment response map

2016-02-24 Thread Gary Verhaegen
IIRC this has always been the behaviour of compojure: if you return a string it wraps it into a minimalist, valid Ring map, but if you return a map it assumes it is a Ring map and leaves it alone. There is a content-type ring middleware somewhere on the web, though in general I don't think the con

Re: ExceptionInInitialization error

2016-02-24 Thread Gary Verhaegen
Caused by:java.lang.ClassNotFoundException:com.fasterxml.jackson.dataformat. cbor.CBORFactory Looks like a dependency problem. If you can't share the whole code, can you please post the result of lein deps :tree On Wednesday, 24 February 2016, Punit Naik wrote: > I was compiling my project and

Re: Question about Clojure function naming

2016-02-19 Thread Gary Verhaegen
I'd say only Rich Hickey can really answer these questions, but here is one possible explanation. These functions are not equivalent. Just like 'send' on an agent has fundamental differences with 'swap!', 'alter' has fundamental differences with both. There is also some similarity, of course: in a

Re: Clojure.async channels

2016-02-18 Thread Gary Verhaegen
There may be a mismatch between the way you approach the problem and the way the library is intended to be used. core.async channels do not "do" anything, they are really just conveying belts, or tubes. You put something on one end and someone else takes it up from the other end. If you want a con

Re: macro to unwrap a list

2016-02-15 Thread Gary Verhaegen
On Monday, 15 February 2016, Sonny To wrote: > I am trying to write a macro to unwrap a list: > > here's my naive attempt > > (defmacro unwrap [s] > (-> s pr-str (clojure.string/replace #"[\(\)]" "") read-string)) > > (unwrap (1 2 3) ) should give 1 2 3 > > any ideas how this can be done? > >

Re: clojure future method

2016-02-15 Thread Gary Verhaegen
`future` starts a function in a separate thread, which comes out of a thread pool. It may not be that easy to check if a future has run at all if you don't hold onto the future object and wait for it. How did you check if they run? It's possible, for example, that they are sending their print's to

conditional logic implemented as pattern-matching and restructuring in the signature of the function

2016-02-10 Thread Gary Verhaegen
It's not pattern matching, but would replacing the apply with a reduce achieve the same result? I'm not in a position to test this right now, but I believe (reduce f init ()) returns init without invoking f, and (conj x a b c) is equivalent to (reduce conj x [a b c]), so replacing apply with reduc

Re: Can the data in a vector have data inside it that points to the same vector? vector1=[a b c d] a=[1 2 f s vector1]

2016-02-10 Thread Gary Verhaegen
Basically, since vectors are immutable, you cannot easily construct that kind of recursive structure. Any means of breaking immutability would allow it, though (atoms, promises, undocumented mutable apis, mutable objects inside the vector, etc.). To clarify: the vector itself does not explicitly p

Re: Scripting with Clojure / "slow" boot time

2016-02-10 Thread Gary Verhaegen
Please excuse the very naive question, but if the main problem seems to be compilation of loaded namespaces, what about aot? Does it help at all? If not, why? As far as I know, the JVM already does lazy loading with Java classes essentially in the way that Mike described. On Wednesday, 10 February

Re: Java API type hint question

2016-02-04 Thread Gary Verhaegen
The part within brackets does not exist outside the Java compiler, i.e. at the bytecode level, it is really just a Collection, not a Collection. If you're interested, you can google "java type erasure" to learn more about this. On Wednesday, 27 January 2016, Ritchie Cai wrote: > Ahh, thanks. I

Re: Attempting to call unbound fn

2016-02-02 Thread Gary Verhaegen
My first step would be to run lein deps :tree On the project where the error appears, and look for unexpected versions of dependencies. On Monday, 1 February 2016, Pedro Santos wrote: > Hello, > > I'm referencing a fn on another lib/namespace. Is this one: > > https://github.com/clanhr/clanhr-

Re: Scala for-comprehension to Clojure

2015-11-26 Thread Gary Verhaegen
It's a bit hard (at least for me) to see what you're actually trying to do here that would precent a direct translation of your snippet to Clojure's for. Could you perhaps post a complete, self-contained code example in Scala? On Thursday, 26 November 2015, Torsten Uhlmann wrote: > Hi Rastko, >

[ANN] Okku 0.1.5 - Akka from Clojure

2015-11-19 Thread Gary Verhaegen
Okku, the Clojure (thin) wrapper for Akka. Github: https://github.com/gaverhae/okku Leiningen: [org.clojure.gaverhae/okku "0.1.5"] New in this release: * Updated Akka dependency to 2.3.14 * Updated Clojure dependency to 1.7.0 * Support for Akka's ask pattern Thanks go to David Orme for this rel

Re: ClassNotFoundException: clojure.lang.AFunction on OS X

2015-11-16 Thread Gary Verhaegen
I have no idea what this could be. Is there any chance you could build up a minimal-ish project that reproduces this ? I have been using Clojure on a Mac for years without any problem. Also, at much less effort on your part, could you post the Leiningen and JVM versions ? lein version should print

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

2015-10-03 Thread Gary Verhaegen
erse > /path/top/dir2 since it is a symbolic link. > > Is there anyway to tweak file-seq ?? > > THanks > HP > > On Saturday, October 3, 2015 at 11:59:40 AM UTC-4, Gary Verhaegen wrote: >> >> I'm on Windows at the moment, so I can't test, but I think

Re: macroexpand and syntax-quote

2015-10-03 Thread Gary Verhaegen
This is very much by design. Clojure is somewhere between Common Lisp and Scheme in terms of macro hygiene. Being compatible with Common Lisp is explicitly not a goal for Clojure. Watch out for similarly named functions with different behavior too. On Saturday, 3 October 2015, bentav wrote: > C

Re: newbie question: how to selectively iterate through a tree of directories ?

2015-10-03 Thread Gary Verhaegen
I'm on Windows at the moment, so I can't test, but I think you can filter on isFile: (for [file (file-seq dir) :where (.isFile file)] (.getName file)) should work, I think. On 3 October 2015 at 07:36, wrote: > Under linux, I have a tree of directories like this: > > /path/top > > /path

Re: Origin for Clojure using the term 'vector' instead of 'array'?

2015-10-03 Thread Gary Verhaegen
For people with a C/Java-style background, array typically designates a contiguous piece of memory that has been allocated at once, is thus fixed-size, and can be accessed randomly (i.e. by index). Vectors are typically structures or objects at a higher level, that still present a random-access col

Re: "Clojure Javadoc API Documentation" needs to be rebuilt.

2015-09-29 Thread Gary Verhaegen
This is the whole official API, as defined since Clojure 1.6 (prior to that, there was no official Java API). All other Java classes in the clojure codebase are considered internal implementation. Here is the relevant part of the 1.6 release notes: https://github.com/clojure/clojure/blob/master/ch

Re: No recent activity for core.async?

2015-09-26 Thread Gary Verhaegen
That question has been asked recently and the official answer was that a new release is coming "soon". There was no promise that the next release would get the project out of alpha, though. On Saturday, 26 September 2015, Rafik NACCACHE wrote: > core.async didn't move since more than a year. > >

Re: Lazy Sequence Results in Stack Overflow

2015-09-26 Thread Gary Verhaegen
Primes are hard, because you essentially need to track all previous primes. Here's one way to think about what you're doing here. First, you create a lazy sequence of infinite numbers from 3 and up. This is done by building a cons cell with 3 as the head and (iterate inc 4) as the tail. Then you

Re: Immediate streaming of shell cmd stdout to a browser

2015-09-24 Thread Gary Verhaegen
Are you sure that the script itself is streaming its results? Shells sometimes batch things when they detect they are not connected to a tty. On 24 September 2015 at 16:45, Karel Miarka wrote: > Hi, > > I want to run a long running bash script from a webapp and see it's > continuous results on th

Re: To supply callback function from clojure to java method expecting a lambda with interop

2015-09-21 Thread Gary Verhaegen
Note that you have to implement the one method of the functional interface. It may not always be called "run", as Java 8 places no restriction on the method name. On Sunday, 20 September 2015, Nagarajan wrote: > Thank you everyone for clearing this up. Since my case is for a specific > java libr

Re: To supply callback function from clojure to java method expecting a lambda with interop

2015-09-20 Thread Gary Verhaegen
The magical macro is reify. Ironically, you'll need to know the type of the lambda to use it from Clojure. On Sunday, 20 September 2015, Nagarajan N wrote: > I started using clojure since last year. I like the language. It even made > me more familiar with java. Before I detested java. Am modera

Re: Why (memoize (fn [_#] (gensym "node")) in rhizome?

2015-09-13 Thread Gary Verhaegen
Because the form appears in a syntax-quote, the # is required to,ask syntax-quote to create an identifier rather than resolve it to the current namespace. On Sunday, 13 September 2015, Akhil Wali wrote: > What does _# mean opposed to simply _? With respect to memoization of > genus it's the same

Re: why there is java.lang.NoClassDefFoundError: clojure_mail/message$loading__4958__auto__, error

2015-09-12 Thread Gary Verhaegen
For that kind of question, you really need to post your code along with the error. A project on github, perhaps? >From just the error message, it looks like you're trying to use a namespaced symbol "clojure-mail/message", and that symbol is not defined. I would gues either a typo in your own code,

Re: Just found out about Elixirs function argument pattern matching...

2015-09-05 Thread Gary Verhaegen
It won't really help for the library/ecosystem problem, but for your own code I'd recommend watching Jeanine Atkinson's Conj talk from last year: http://m.youtube.com/watch?v=ZQkIWWTygio On Saturday, 5 September 2015, Amith George wrote: > Nice. Hadn't heard of it before. It looks interesting.

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

2015-08-19 Thread Gary Verhaegen
If you want more specific answers, you'll need to describe the structure of your tree. In particular, what is the relationship between your conceptual nodes and your data structures (vectors and maps)? On 19 August 2015 at 17:26, Andy- wrote: > I have yet to evaluate it myself but this might do h

Re: How to transform this structure idiomaticlly in Clojure?

2015-08-18 Thread Gary Verhaegen
I'd do something like (untested): (defn transform [node] (->Node (first node) (map transform (second node On 18 August 2015 at 17:32, Hussein B. wrote: > Hi, > > I have the following structure. Node has a string properly and a vector > nodes and of course, each node has a string a prop

Re: Clojure Truck Factor

2015-08-17 Thread Gary Verhaegen
On 17 August 2015 at 07:25, Jorge Branco wrote: >> If a file has not been touched in two years, does it really >> matter who wrote it? > > I think that depending on the project and the kind of file, it does make a > difference. One of the primary problems our team faced when working on a > large b

Re: Clojure Truck Factor

2015-08-14 Thread Gary Verhaegen
Hi Guilherme, I am not a Clojure developer (I only use it), so maybe I'm speaking out of line. I would first like to thank you for the initiative; as an industry, I believe we direly need more quantitative, scientific studies of our practices, so I'm really happy to see this. There is of course a

Re: Is this resource only loaded once?

2015-08-14 Thread Gary Verhaegen
Once you've AOT compiled that (which is necessary for the class to be actually generated), slurp won't be called again. Beware, however, that `def` (and hence `slurp`) will be executed by the compiler, at compile time, in the context (classpath, cwd, etc.) of the compiler, which may not be what you

Re: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-07 Thread Gary Verhaegen
Sorry for steering the discussion away from tooling, but have tou looked at Racket and the research in teaching programming that's been going on around it for the past ~20 years? One of their findings was that beginning with functional programming (1 semester FP followed by 1 semester OOP) yielded

Re: Size of Java serialized Clojure data structures

2015-08-07 Thread Gary Verhaegen
You should probably look at Clojure-specific solutions, starting with EDN (i.e. essentially pr-str), fressian, transit or nippy. Clojure data structures have a lot of properties that can be exploited (we only care about the abstract type and the actual data), so a serializer can make a lot of assu

Re: Clojure, WEB and Enterprise development

2015-08-06 Thread Gary Verhaegen
I'm not sure I understand the problems here, but if you really want to wrap a Java library that generates a "web layer", I'd suggest looking at Vaadin rather than GWT. Though as others have said I do not clearly see what kind of problems you have with the current solutions (immutant, om, etc.). O

Re: What "Counted" interface is for?

2015-08-04 Thread Gary Verhaegen
I don't know of it is correct, but I also remember reading that Counted was a "marker interface", i.e. it does not actually add any method but it implies that the count operation will be "fast". On Tuesday, 4 August 2015, Laurent PETIT wrote: > If I'm remember correctly, the Counted interface mu

Re: [ANN] Release 0.32.0 of Counterclockwise

2015-07-30 Thread Gary Verhaegen
I'm all for increasing the visibility of women in technology and for trying to avoid simplistic assimilations like "programmer = male", but in this case I think it's more like a simplistic "ends in a = female" on your part, and I'm afraid Laurent did not make a grammatical mistake: https://github.

Re: [ANN] Pink 0.2.0, Score 0.3.0

2015-07-29 Thread Gary Verhaegen
There's http://m.youtube.com/watch?v=wDcN7yoZ6tQ, though I guess it does not cover the latest features in this release. On Wednesday, 29 July 2015, zcaudate wrote: > This is so cool =) > > Can you put up a video? > > -- > You received this message because you are subscribed to the Google > Group

Re: WebService request are not getting served properly

2015-07-27 Thread Gary Verhaegen
On Monday, 27 July 2015, hemant gautam wrote: > On running the below mentioned code on browser I am getting "Page not > found" for each type of request. > Can anybody suggest me where I am doing a mistake. > > (ns currentday.core > (:require [compojure.core :refer :all] > [compojure.rou

Re: What is the best way to pass log configs everywhere without a global var?

2015-07-27 Thread Gary Verhaegen
Have you guys looked at dire? https://github.com/MichaelDrogalis/dire/blob/master/README.md it could be used to take decomplection one step further, by not defining monitoring things inline at all. A library author could define additional logging namespace(s) with fns that load different levels o

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Gary Verhaegen
a bit (or hope someone else can answer more definitely). On Monday, 27 July 2015, Gary Verhaegen wrote: > the error message also sugget that your process may not have started > quickly enough. How do you deploy on heroku? Do you have a Procfile? What > does it say? Do you prepackage on

Re: Twitter bot crashing on Heroku

2015-07-27 Thread Gary Verhaegen
the error message also sugget that your process may not have started quickly enough. How do you deploy on heroku? Do you have a Procfile? What does it say? Do you prepackage on push, or recompile everything on startup? On Monday, 27 July 2015, Divyansh Prakash wrote: > Hi! > > I had written a po

Re: Java 8 Lambda Interop

2015-07-27 Thread Gary Verhaegen
On Sunday, 26 July 2015, Andrew Oberstar wrote: > Hi, > > I'm wondering if anyone has a good approach for making calls from Clojure > to Java APIs (e.g. Stream API) that expect a @FunctionalInterface type. > > Ideally, IFn would transparently work, but I'm guessing that requires some > compiler c

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Gary Verhaegen
and know that it might be a good fit ? > > Thanks, > > Jules > > On Monday, 13 July 2015 10:37:55 UTC+1, Gary Verhaegen wrote: >> >> Have you already looked at core.logic? >> >> On Monday, 13 July 2015, craig worrall wrote: >> >&g

Re: 2 way transform in single definition ? unification ?

2015-07-13 Thread Gary Verhaegen
Have you already looked at core.logic? On Monday, 13 July 2015, craig worrall wrote: > You may have already discounted Java versions, but just in case ... > http://www.javacodegeeks.com/2013/10/java-object-to-object-mapper.html > > Craig > > On Monday, July 13, 2015 at 3:53:19 AM UTC+10, Jules

Re: Creating jar specific defaults

2015-07-03 Thread Gary Verhaegen
You're probably using clojure.java.io/file (looks for files on the filesytem) instead of clojure.java.io/resource (looks for files in the classpath). On 20 June 2015 at 16:41, Timur wrote: > Hi everyone, > > I want to specify some defaults for a library that I pack as a jar, for > instance standa

Re: Joda Time version conflict? "Initializing JollyDayHoliday for SUTime"

2015-06-29 Thread Gary Verhaegen
ry we could embed inside of the Clojure app, but now it looks like we > need to reverse that decision. > > For me, it's been a good reminder that "easy Java interop" is true up to a > point, but then very not true for certain kinds of ambitions. > > > > On Monday, J

Re: Joda Time version conflict? "Initializing JollyDayHoliday for SUTime"

2015-06-29 Thread Gary Verhaegen
Assuming there is a version that works for both dependencies, you can manually fix it in your own project.clj. Your own direct dependencies will override transitive ones. Otherwise, as far as I can tell, you're stuck. Maybe you can try using an older clj-time? On 29 June 2015 at 21:00, wrote: >

Re: How to share the large files that can not fit in Github?

2015-06-23 Thread Gary Verhaegen
There is also a git annex command. I have not use it personally, but my understanding is that it is essentially keeping a hash of the file (and perhaps a url to download it?) in source control in git, without adding the file itself. That way git can tell when the file has changed, without pollutin

Re: Basic question: what's the difference between "require as" and "use as"?

2015-06-23 Thread Gary Verhaegen
Unless you have a very compelling reason, just don't use use. It's mostly a historical accident that's kept there for backwards compatibility. And try to avoid :refer :all if possible. There are legitimate use-cases for it, but outside the REPL they are pretty rare. On Tuesday, 23 June 2015, Ritc

Re: stuartsierra/component is oop, can clojure namespace self init to solve the dependencies?

2015-06-18 Thread Gary Verhaegen
OOP does not mean mutab... erh... anything, really, but there is an argument to be made for calling an immutable blob that carries data and the operations to act on it an "immutable object". If every "mutative" operation returns a modified copy of the object, you can have immutable OOP. On Thursda

Re: Making Java serializables transparently printable and readable

2015-06-17 Thread Gary Verhaegen
>From glancing at the source, I think you should be able to do what you want with clojure.core/*data-readers* and/or clojure.core/*default-data-readers-fn*. http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/*data-readers* It is not clearly documented that the edn reader checks t

  1   2   3   >