Re: Why is next.jdbc using my IP address?

2022-03-03 Thread Kevin Downey
That is a message from MySQL, not next.jdbc. MySQL allows you to grant permissions to a user base on the host they are connecting from so permission denied kinds of errors include the username and the host the users connection came from. On Thu, Mar 3, 2022, 11:18 Lawrence Krubner wrote: > I ju

Re: core.async/close! locks on chans with pending transforms

2017-07-03 Thread Kevin Downey
On 07/03/2017 03:12 PM, Vitalie Spinu wrote: On Monday, 3 July 2017 22:48:40 UTC+2, red...@gmail.com wrote: Discussion of locks aside, doing blocking operations like io or !! or basically anything that looks like it blocks and isn't >! or Is this the limitation in general or only whe

Re: core.async/close! locks on chans with pending transforms

2017-07-03 Thread Kevin Downey
On 07/03/2017 11:03 AM, Vitalie Spinu wrote: Hi, Async/close! causes deadlocks if its reducer is stalled (e.g. waits for an event from another chan). Consider: (let [d (chan) s (chan 1 (map (fn [v] (println "this:" v) (printl

Re: Leiningen, AOT compilation, and classloaders

2017-03-15 Thread Kevin Downey
On 03/07/2017 09:07 PM, 'Tianxiang Xiong' via Clojure wrote: > I recently ran into an issue with AOT compilation that I'd like to > understand better. A minimal working example (MWE) can be found here > . > > Basically, using `:aot :all` in `project

Re: Error in main using Stuart Sierra's Component when deploying to Heroku

2017-03-13 Thread Kevin Downey
On 03/13/2017 09:38 AM, 'Rickesh Bedia' via Clojure wrote: > I am trying to start my clojure application on my heroku dyno but I keep > getting and error in my stuartsierra.component/start. > > Below is my core file containing my main function. > > (defrecord Listener [listener] > component/Lif

Re: loop macro generates a wrapping let

2017-03-06 Thread Kevin Downey
On 03/06/2017 03:28 PM, juan.facorro wrote: > While I was debugging some code I found something related to the *loop > *macro that I found curious. I'm probably missing something but here it > goes. > > The expression generated by the *loop* macro includes a wrapping *let > *when there is any de-s

Re: is it a bug in clojure? unchecked-multiply

2017-03-03 Thread Kevin Downey
On 03/03/2017 12:14 AM, BongHyeon. Jo wrote: > (unchecked-multiply 1000 1000) The default type clojure uses for integers is the jvm's long (or the boxed variant Long) type. Longs are signed 64bit numbers. 100 is outside the range of longs. `(* 1000 1

Re: When did this start? java.lang.IllegalAccessError cond* does not exist nippy

2017-02-07 Thread Kevin Downey
definitely turn on https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L81 :pedantic? :abort and resolve the issues lein deps :tree shows you. given that you are aot compiling, but have implicit clean disabled, my guess is you compiled the project once using a version of some l

Re: Is there a standard name for this transducer? Or a more idiomatic way to do it?

2016-09-14 Thread Kevin Downey
looks like a variation of partition-by On 09/14/2016 07:16 PM, Marshall handheld Flax wrote: > This looks like a standard thing you might want to do with a transducer: > accept a stream of inputs and statefully group them into a stream of > varying-length vectors. A typical example might be to ac

Re: [ANN] Clojure 1.9.0-alpha11

2016-09-01 Thread Kevin Downey
instrument is going to have issues with any calling convention outisde of the normal deref var + invoking path. http://dev.clojure.org/jira/browse/CLJ-1941 is a similar case with some discussion in the comments. On 09/01/2016 11:33 AM, Ambrose Bonnaire-Sergeant wrote: > Hi, > > There seems to be

Re: Why is this not considered to be in a go block?

2016-08-25 Thread Kevin Downey
The analysis for the go macro to determine that the fn never escapes the go block is not something core.async does. Because of that functions are sort of a black box to the transforms the go macro does. http://dev.clojure.org/jira/browse/ASYNC-93 is a declined issue regarding this. http://dev.cloj

Re: clojure.spec & protocol fn

2016-06-05 Thread Kevin Downey
http://dev.clojure.org/jira/browse/CLJ-1941 has some discussion about places where instrumenting won't work. On 06/05/2016 09:57 AM, Claudius Nicolae wrote: > It seems that protocol fns don't participate in s/fdef specfications. It > would be nice they were. Sample: > > (ns sample > (:r

Re: atoms not working same in cljs as in clj?

2016-05-20 Thread Kevin Downey
This is a difference in the type function. The clojurescript type function ignores metadata. So the clojurescript type function is like the clojure class function, and clojurescript doesn't have a class function. On 05/20/2016 09:22 AM, hiskennyness wrote: > I see here > https://github.com/clojure

Re: :default catch blocks with core.async and clojurescript

2016-05-16 Thread Kevin Downey
On 05/15/2016 06:39 PM, Kevin Downey wrote: > On 05/14/2016 09:31 PM, cameron wrote: >> I'm having an issue where :default catch blocks are not working in >> clojurescript when in a go block. >> >> The following code prints "a str" as expected: &

Re: :default catch blocks with core.async and clojurescript

2016-05-15 Thread Kevin Downey
On 05/14/2016 09:31 PM, cameron wrote: > I'm having an issue where :default catch blocks are not working in > clojurescript when in a go block. > > The following code prints "a str" as expected: > > (prn (try >(throw "a str") >(catch :default e e ))) > > The same code in

Re: Strange exception: Cannot cast to compile stub??

2016-05-09 Thread Kevin Downey
There is a jira issue http://dev.clojure.org/jira/browse/CLJ-1226 and it looks like it is marked as fixed in 1.8 On 05/09/2016 01:10 AM, Kevin Downey wrote: > If I recall correctly, looking at the code at around line 483, I think I > have seen that error arise when using (set! (.fieldNam

Re: Strange exception: Cannot cast to compile stub??

2016-05-09 Thread Kevin Downey
If I recall correctly, looking at the code at around line 483, I think I have seen that error arise when using (set! (.fieldName this-reference) value) inside defrecord and deftype bodies. if you use (set! fieldName value) syntax you might be fine. On 05/08/2016 07:21 PM, JvJ wrote: > I'm implemen

Re: Possible bug with (keys some-container) in a try-catch?

2016-04-22 Thread Kevin Downey
keys is lazy, you see the exception at the repl because printing out the result forces the sequence, but if you don't do anything with the result then it isn't forced, so no errors. On 04/22/2016 01:28 PM, Steve Riley wrote: > I am trying to determine if a container, x, passed to a function, is a

Re: [core.logic] What's the difference between "q" and a fresh LVar? Or: "java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to java.lang.Number"

2016-04-09 Thread Kevin Downey
Check 'lein deps :tree' for conflicting core.logic versions, and delete the target directory to make sure you don't have old classfiles sitting around. On 04/09/2016 04:47 AM, Daniel Ziltener wrote: > Oops, yes, in my actual code it was both ":db/id", so that's not the > issue. It's really confusi

Re: Attempt At Futures

2016-04-08 Thread Kevin Downey
The thing to remember is map is lazy, so you are lazily (on demand) creating a bunch of futures. Then doseq walks through those futures, demanding one at a time. You deref the future immediately after doseq requested it from the lazy-seq and are blocking on its completion then doseq can move on to

Re: [core.logic] What's the difference between "q" and a fresh LVar? Or: "java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to java.lang.Number"

2016-04-08 Thread Kevin Downey
Hard to say, the class cast exception will have more information in it that could cast light on the issue. You also are using :id in one variation, and :db/id in the other. On 04/08/2016 05:46 PM, Daniel Ziltener wrote: > Hi clj, > > I'm trying to do some simple core.logic stuff. My input is a ve

Re: Webassembly as a Clojure target platform

2016-04-04 Thread Kevin Downey
I recommend reading up on WebAssembly, a good place to start might be https://github.com/WebAssembly/design/blob/master/FAQ.md#is-webassembly-only-for-cc-programmers/ In those three paragraphs, it is pretty clear that, at least as it stands now, wasm is much closer semantically to actual asm than

Re: Nesting semantics for the thread last operator

2016-03-19 Thread Kevin Downey
They are a logical consequence of the machine. ->> is a mechanical transformation taking a form (->> x (a ... w)) turning it into (a ... w x), and this same mechanical transformation is in place when nested. You example expands in steps like: (->> a b c (->> d e f)) (->> (b a) c (->> d e f)) (->>

Re: Strange problem with input stream starting clojure 1.7.0-alpha6

2016-03-07 Thread Kevin Downey
you can still structure you computation as a reduce, even if it is side effectful. (reduce (fn [sink record] (emit sink record) sink) sink source) There is also a function introduced in 1.7 called "run!" which is for processing a collection using reduce for side effects. On 03/07/2016 04:49 PM,

Re: Strange problem with input stream starting clojure 1.7.0-alpha6

2016-03-07 Thread Kevin Downey
Hard to say, I can't think of a change that would directly change how the shaed code would work. The "ArchiveReader" type hint on "warc-value" seems to be incorrect, because it is used as a seq by "doseq". Assuming this is the correct ArchiveReader (http://crawler.archive.org/apidocs/org/archive/i

Re: #'lamina.core. - No implementation of method: :enqueue for class: nil

2016-03-06 Thread Kevin Downey
On 03/05/2016 10:18 PM, Nasko wrote: > I am trying to implement a simple asynchronous chat service using Aleph > and Lamina. However, it looks like the enqueue function coming from > lamina cannot be implemented and causes an exception. This is what my > chat function looks like: > | > (defn chat [

Re: Implementing Clojure

2016-03-01 Thread Kevin Downey
On 02/28/2016 10:40 AM, evins.mi...@gmail.com wrote: > > > On Sunday, February 28, 2016 at 4:13:23 AM UTC-6, puzzler wrote: > > Yes, unfortunately, Clojure doesn't have an actual spec. The lack > of a spec probably helps keep the language more "agile", but I know > several people wh

Re: Compile time constants not generated with the appropriate type.

2016-02-24 Thread Kevin Downey
On 02/24/2016 02:53 AM, Michael du Breuil wrote: > The following (this is interop with libgdx if anyone is curious, > hud-corner-top-left is a delayed TextureRegion > > (.draw batch ^TextureRegion @hud-corner-top-left >(float -199) >(float -32)) > > Which yields the follow

Re: (type ...) vs (class ...)

2016-02-12 Thread Kevin Downey
On 02/12/2016 01:47 PM, Kevin Downey wrote: > On 02/12/2016 01:37 PM, Alan Thompson wrote: >> Hey - Just saw something on the clojure.core/type function: >> >> >> >> (defn type >> "Returns the :type metadata of x, or its Class if none" >&

Re: (type ...) vs (class ...)

2016-02-12 Thread Kevin Downey
On 02/12/2016 01:37 PM, Alan Thompson wrote: > Hey - Just saw something on the clojure.core/type function: > > > > (defn type > "Returns the :type metadata of x, or its Class if none" > {:added "1.0" > :static true} > [x] > (or (get (meta x) :type) (class x))) > >

Re: top-level lets or private globals

2015-08-26 Thread Kevin Downey
On 8/25/15 12:06 AM, Kurt Sys wrote: > I'm refering to a few posts in an old thread: > https://groups.google.com/d/msg/clojure/r_ym-h53f1E/RzUdb5oYeX4J > > What really puzzles me is that it doesn't seem to be generally > regarded as idiomatic Clojure style to just use top-level (let)s for

Re: Reflection warnings in async/go-loop

2015-07-23 Thread Kevin Downey
Regardless of the outcome of the type issue, this code is doing blocking io inside a go block, which should be avoided. Consider using `thread` and `loop`, which would also likely work around the type hinting issue because it would avoid the state machine transform. The code already using the block

Re: lazy list comprehension

2014-06-27 Thread Kevin Downey
On 6/27/14, 8:01 AM, Glen Rubin wrote: > I have a list that I want to combine in some way with an incremented list, > so I was trying to write a for expression like this: > > (for [i '(my-list-of-crap), j (iterate inc 0)] (str i j)) the equivalent of this code written using map and mapcat is (m

Re: test.check, quickcheck concurrency

2014-03-31 Thread Kevin Downey
On 3/28/14, 9:48 PM, Brian Craft wrote: > Re: John Hughes' talk at clojure/west, at the end he did a fairly > incredible demo of testing concurrency. It doesn't look like this was > implemented in test.check (or I'm not finding it). Are there any plans? > from my understanding his approach is u

Re: let bindings

2014-01-20 Thread Kevin Downey
On 1/20/14, 12:38 PM, Andy Smith wrote: > Hi, > > (let bindings form) is a special form. As I understand it, let can be > reformulated in terms of functions e.g. > > (let [x 2] (* x 20)) equivalent to ((fn [x] (* x 20)) 2) > (let [x 3 y (* x x)] (- y x)) equivalent to ((fn [x] ((fn [x y] (- y x

Re: odd failure on recursive use of protocol member

2013-12-10 Thread Kevin Downey
extend mutates some state (the protocol definition), so what is happen here is comp is returning a new function built from the value of the rest-serialize var (the protocol function before the extend changes it) and the value of the deref var. I have not verified this, but I suspect if you use (fn

Re: core.logic merge substitutions map?

2013-11-18 Thread Kevin Downey
https://github.com/sonian/Greenmail/blob/master/src/clj/greenmail/db.clj#L98-L126 has an example, using clojure.core.logic/all to make a goal which is a conjunction of the clojure.core.logic/== goals On 11/16/13, 5:04 PM, Mark wrote: > d'oh! Answering my own question: Just compose the unify func

Re: Surprising behaviour related to records, protocols and AOT

2013-10-28 Thread Kevin Downey
I don't know about the rest of this thread, but loom seems to suffer from what I've outlined in http://dev.clojure.org/jira/browse/CLJ-322?focusedCommentId=32246&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-32246 pulling in the interface that the protocol generates

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-05 Thread Kevin Downey
ears old and doesn't give too much detail. I do like that the author >>>does some benchmarking that could be adapted to the BeagleBone Black >>> though. >>>3. This >>> post<http://blog.gonzih.me/blog/2012/09/07/clojure-on-beaglebone-openjd

Re: ANN: clj-tuple, efficient small collections

2013-08-26 Thread Kevin Downey
tuple is doing under the hood with macros. > > On Aug 26, 2013, at 10:38 AM, Kevin Downey wrote: > >> A Tuple protocol that defines get0 get1 get3 etc for fast element access >> that doesn't tie you to using field names might be a good idea. >> >> On 8/25/13 9:3

Re: ANN: clj-tuple, efficient small collections

2013-08-26 Thread Kevin Downey
A Tuple protocol that defines get0 get1 get3 etc for fast element access that doesn't tie you to using field names might be a good idea. On 8/25/13 9:35 AM, Zach Tellman wrote: > I don't think so, even the existence of all the Tuple* types are an > implementation detail, and you'd need to hint it

Re: What are the phases of the Clojure compiler?

2013-08-06 Thread Kevin Downey
On 8/6/13 2:23 PM, gixxi wrote: > Hi there, > > I wanne dive a bit more deep into the clojure compiler and I wonder whether > it follows the std procedure for compiled languages > > Character Stream -> Scanner (lexical analysis) -> Token Stream > Token Stream -> Parser (syntax analysis) -> Parse

Re: Two Dimensional Associative Map

2013-08-05 Thread Kevin Downey
On 8/2/13 8:08 PM, JvJ wrote: > Actually, what I'm looking for is a way to use arbitrary types of keys > rather than integers. > > I have this so far: > > Table data structure. > For now, the table data structure is a map of maps. > > (defn row > "Get a row of the table. > If only

Re: Two Dimensional Associative Map

2013-08-02 Thread Kevin Downey
On 8/1/13 5:59 PM, JvJ wrote: > I'm looking for an associative data structure that can be accessed by both > rows and columns, and could potentially be sparse. > > Suppose the following table is called t: > > | | :A | :B | :C ||---+--+--+--|| 1 | | > | '[x

Re: Getting a living standalone jar with "lein uberjar" and a handful of resources

2013-07-31 Thread Kevin Downey
On 7/31/13 4:18 AM, Alex Fowler wrote: > I have an application which is built fine with uberjar with an exception of > two things which do not get incuded: > 1) Additonal jar files (about 150Mb) from various Java libraries that are > not present on Clojars and that I have no power of will or time

Re: Clojure 1.5.1 head holding

2013-07-01 Thread Kevin Downey
On 7/1/13 3:49 AM, Gerrard McNulty wrote: > Suppose I had code like: > > ((fn [rs] (take-last 3 rs)) (range 2000)) > > This seems to run fine with no head holding. But if I write something like: > > (defn- log [f] > (println "start") > (f) > (println "end")) > > ((fn [rs] (log #(take

Re: Clojure 1.6 API: clojure.lang.IFn and clojure.api.API

2013-06-24 Thread Kevin Downey
On 6/24/13 7:53 AM, Jörg Winter wrote: > Hi Stuart, > > ok, so my question is actually more about how to create some clojure Runtime, > filling it with additional namespaces, i.e. more than just clojure.core. > I just discovered the RT class which could be what I want ( though its not > official

Re: Making things go faster

2013-06-04 Thread Kevin Downey
midje makes each test a top level form, so test runs happen as a side effect of code loading, which means you cannot really run tests in a good way from the repl without doing some kind of ridiculous forced code reloading. I would definitely recommend staying far away from midje, if you want a tigh

Re: realizing a lazy line-seq inside with-open

2013-05-27 Thread Kevin Downey
doall doesn't recurse, so you are not realizing the lazy-seq, you want something like [msg (doall sig-strs)] if you are looking to play around with io stuff, I recommend looking in to using reducers for io, they allow you to sort of invert control, keeping the nice property of with-open always cle

Re: features expression

2013-03-07 Thread Kevin Downey
Class names are read in as symbols On Mar 7, 2013 7:10 AM, "Andy Fingerhut" wrote: > I may be wrong, but I think this, and anything else that tries to solve > this problem after read time, will fail for one of the primary uses of > feature macros: Java packages/namespaces that exist for Clojure/J

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
clojure uses a class called DynamicClassloader to load runtime generated classes, but it is a pretty strait forward extension of URLClassloader On Wed, Feb 27, 2013 at 11:27 AM, Ben Evans wrote: > On Wed, Feb 27, 2013 at 5:42 PM, Kevin Downey wrote: > > what version of clojure are you

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
what version of clojure are you using? I doubt line #100 of main is the correct line in server.clj, the content of the stacktrace looks more like https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/server.clj#L146, what version of nrepl? https://github.com/cloju

Re: Module For COM Objects

2013-02-21 Thread Kevin Downey
The are a few tools for doing interop with COM from the JVM. They all kind of suck. We use com4j at work with Clojure. Com4j generates JVM stubs for COM libraries. On Feb 21, 2013 3:53 PM, "octopusgrabbus" wrote: > Does Clojure have a module that allows initializing, passing data to, and > finali

Re: Associative extends Seqable?

2013-01-18 Thread Kevin Downey
use ILookup instead of Associative On Fri, Jan 18, 2013 at 11:00 AM, Ben Wolfson wrote: > I've got a bit of code implementing Associative, in order to provide a > fake map that responds to all calls to valAt with the same object, no > matter what the key is. > > Since it therefore "contains" ev

Re: First test with JavaFx and blocked yet :(

2012-12-01 Thread Kevin Downey
e java > command's option -cp to give the jfxrt.java's place. > Do I forget something? > > > Chris > > Le 1 déc. 2012 à 01:14, Kevin Downey a écrit : > > here is an example https://gist.github.com/4179694 > > > On Fri, Nov 30, 2012 at 4:13 PM, Kevin Dow

Re: First test with JavaFx and blocked yet :(

2012-11-30 Thread Kevin Downey
here is an example https://gist.github.com/4179694 On Fri, Nov 30, 2012 at 4:13 PM, Kevin Downey wrote: > javafx.application.Application/launch is looking at the class that the > method that calls it belongs to, in this case it belongs to the IFn class > generated for the -main functi

Re: First test with JavaFx and blocked yet :(

2012-11-30 Thread Kevin Downey
javafx.application.Application/launch is looking at the class that the method that calls it belongs to, in this case it belongs to the IFn class generated for the -main function, there is an arity for launch that takes the class you want to use instead of the weird detection thing On Fri, Nov

Re: Check that a protocol exists

2012-10-24 Thread Kevin Downey
you can check for the existence of the protocol's var just like you would for any var. not sure what B. Ghose is getting at, but I would recommend not checking for the existence of the interface. http://clojure.org/vars On Wed, Oct 24, 2012 at 12:23 PM, Baishampayan Ghose wrote: > What about the

Re: I can get this if() clause to ever be true

2012-10-19 Thread Kevin Downey
you have `username` a symbol as the key in your map, but you are looking for `:username` they keyword as a key On Fri, Oct 19, 2012 at 8:47 AM, larry google groups wrote: > > > Also: > > > >> I suggesting adding printlns or logging or a debugger and checking the >> value of this-users-params, it

Re: I can get this if() clause to ever be true

2012-10-19 Thread Kevin Downey
conj can surely produce maps, and does so happily in the following cases: (conj {} [:foo :bar]) (conj {} {:foo :bar}) I suggesting adding printlns or logging or a debugger and checking the value of this-users-params, it is almost certainly not what you expect it to be. as a side note creating a

Re: AOT-compilation, record types and DynamicClassLoader

2012-10-16 Thread Kevin Downey
have you cleaned out the classes/ directory recently? AOT'ing, deftypes/defrecords, and lein when combined can exhibit issues with stale generate classes for deftypes/defrecords. I would also try adding (:gen-class) to your ns form. AOT compilation is effectively a nop for the namespace without it,

Re: trampoline not compatible with reducers?

2012-10-16 Thread Kevin Downey
/12 19:15, Kevin Downey wrote: >> >> you are declaring the functions return doubles, but in fact returning >> functions or doubles > > yes you're right (my bad) but the same thing happens without the > type-hinting - albeit in a different place a

Re: trampoline not compatible with reducers?

2012-10-16 Thread Kevin Downey
you are declaring the functions return doubles, but in fact returning functions or doubles On Tue, Oct 16, 2012 at 11:06 AM, Jim - FooBar(); wrote: > Hi everyone, > > I'm pretty sure i'm using trampoline the right way but still I get this > exception: > > ClassCastException Clondie24.lib.search$s

Re: Cljs-repl server as ring middleware?

2012-10-08 Thread Kevin Downey
I'd checkout nrepl and nrepl middlewares, which can be exposed over http (via ring middleware) or other transports. https://github.com/hiredman/drawbridge-cljs is an nrepl http client for clojurescript https://github.com/hiredman/nrepl-cljs-middleware is an example of a nrepl middleware, which ex

Re: how to securely store parameters in config files

2012-09-28 Thread Kevin Downey
if you use a password to encrypt your config, you will need config2 for the password, and of course you do not want people to have access to config2, so you should encrypt that, and put the password in config3, and ... I recommend using lein test selectors to split out tests that hit external serv

Re: Reducers reduce my performance

2012-09-14 Thread Kevin Downey
On Fri, Sep 14, 2012 at 4:22 AM, Tassilo Horn wrote: > Hi all, > > I have some code which uses a lot of map/mapcat/filter stuff and is > totally eager (result is always an ordered set). That looked to me like > a good candidate for reducers. > > Basically, my code enables me to write something li

Re: Is anyone relying on the js* special form?

2012-09-12 Thread Kevin Downey
I've used it to make ClojureScript functions in to javascript object constructors (defn Foo [] (js* "/*") (js* "*/")) results in the generated return being commented out, so (Foo.) works I use this in a macro for creating new types that are based on existing Google Closure types On Wed, Sep 12

Re: redefining multimethods at the repl

2012-09-05 Thread Kevin Downey
if I recall, the current defonce like behavior of multimethods was a response to the situation where if you have your multimethods split across multiple files reloading the file with the defmulti in it would re-def the multimethod with the new dispatch, but it would not have any of the methods load

Re: Isolated Clojure Environments

2012-08-30 Thread Kevin Downey
https://github.com/hiredman/polycosm On Aug 30, 2012 6:38 PM, "Dave Ray" wrote: > Hi, > > I'm looking for the best way to execute some Clojure code in a more or > less completely isolated environment. That is, say we load one piece > of code: > > A: > --- > (ns my-ns) > > (def foo [] (println "hi

Re: auxiliary methods like :before and :after for multimethods?

2012-07-26 Thread Kevin Downey
https://github.com/technomancy/robert-hooke/ On Thu, Jul 26, 2012 at 2:15 PM, George Oliver wrote: > hi, I'm wondering if anyone has extended multimethods with auxiliary methods > like CL-style :before and :after, and if not what a suitable substitute > might be. > > > thanks, George > > -- > You

Re: cljs is not defined

2012-07-26 Thread Kevin Downey
On Wed, Jul 25, 2012 at 6:48 PM, trashhalo wrote: > If I compile... >> >> (def x 5) > > ... with advanced optimization it comes out as >> >> cljs.a.x = 5; means something like "make x, in the namespace cljs.a equal to 5" so you are missing an (ns cljs.a) somewhere > Which throws 'cljs is not de

Re: atom and lock

2012-07-17 Thread Kevin Downey
On Tue, Jul 17, 2012 at 4:58 PM, Warren Lynn wrote: > > > On Tuesday, July 17, 2012 7:50:10 PM UTC-4, red...@gmail.com wrote: >> >> if you do it as a lock, then readers must block writers (think it >> through). Clojure's reference types + immutable datastructures and the >> views on perception tha

Re: atom and lock

2012-07-17 Thread Kevin Downey
if you do it as a lock, then readers must block writers (think it through). Clojure's reference types + immutable datastructures and the views on perception that underlay them are strongly opposed to readers interfering with writers. http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey

Re: Concatenating InputStreams (was: Re: Parsing SGML)

2012-07-13 Thread Kevin Downey
dr", but I have noted your response and will in the future let you prattle on endless reinventing functionality that already exists. On Fri, Jul 13, 2012 at 12:42 PM, Meikel Brandmeyer wrote: > tl;dr > > Am 13.07.2012 um 18:35 schrieb Kevin Downey: > >> http://docs.or

Re: Concatenating InputStreams (was: Re: Parsing SGML)

2012-07-13 Thread Kevin Downey
http://docs.oracle.com/javase/1.5.0/docs/api/java/io/SequenceInputStream.html On Fri, Jul 13, 2012 at 7:29 AM, Meikel Brandmeyer (kotarak) wrote: > Hi again, > > talking about thread safety. > > Am Freitag, 13. Juli 2012 16:13:54 UTC+2 schrieb Meikel Brandmeyer > (kotarak): >> >> (close >>

Re: [ANN] clojure.java.jdbc 0.2.3 available on Maven Central

2012-06-27 Thread Kevin Downey
that is very interesting, I've played around with generating sql from datalog queries, but stopped when I ran up against generating queries for recursive datalog rules because I wasn't aware of WITH RECURSIVE On Tue, Jun 26, 2012 at 6:29 PM, Chas Emerick wrote: > Random thought: recursive queries

Re: [ANN] clojure.java.jdbc 0.2.3 available on Maven Central

2012-06-21 Thread Kevin Downey
On Thu, Jun 21, 2012 at 9:33 AM, Sean Corfield wrote: > On Thu, Jun 21, 2012 at 12:33 AM, Vinzent wrote: >> Actually, jsql looks very much like clojureql\korma. > > jsql has completely different goals to ClojureQL/Korma and is mostly a > convenience for generating the sort of SQL that the update!

Re: clojure.inspector.inspect-table gives up when first element is nil...

2012-06-18 Thread Kevin Downey
if you are printing tables using Clojure, you should checkout doric: http://github.com/joegallo/doric On Mon, Jun 18, 2012 at 11:22 AM, Jim - FooBar(); wrote: > the very first let binding in clojure.inspector/old-table-model should be: > > row1 (some #(when-not (nil? %) %) data) > > instead of >

Re: [ANN] Clojure JSR 223 Implementation

2012-05-23 Thread Kevin Downey
you might want to use something like https://github.com/flatland/classlojure or https://github.com/hiredman/polycosm to provide an isolated clojure runtime per instance of ClojureScriptEngine. single segment namespaces are bad because the generate classes end up in the default package. checking j

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
26 PM, Kevin Downey wrote: > On Sun, May 20, 2012 at 2:23 PM, Warren Lynn wrote: >> Well, I don't want to be a beginner for too long, :-) > > then "As a Clojure programmer you should only need them rarely." > >> On May 20, 5:19 pm, Kevin Downey wrote: >

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
On Sun, May 20, 2012 at 2:23 PM, Warren Lynn wrote: > Well, I don't want to be a beginner for too long, :-) then "As a Clojure programmer you should only need them rarely." > On May 20, 5:19 pm, Kevin Downey wrote: >> On Sun, May 20, 2012 at 2:13 PM, Warren Lynn w

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
On Sun, May 20, 2012 at 2:16 PM, nicolas.o...@gmail.com wrote: > I had wished such a feature all week. > You don't need it often, but when you need it, it is really annoying > to circumvent. > traits would really be useful. If you find yourself wanting traits you are using defrecord, deftype, and

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
t > direction, but still I think there might be things we can improve on. defrecord, deftype, and defprotocol provide extensible low level abstractions like the kind Clojure is built on. As a Clojure programmer you should only need them rarely. As a beginner you should never use them. > On

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
ypes like Employee and Person instead of just using maps is a kind of rigidity > On May 20, 4:55 pm, Kevin Downey wrote: >> On Sun, May 20, 2012 at 1:50 PM, Warren Lynn wrote: >> > Thanks. That will work. But I wish things can get more concise and >> > elegant. &g

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
On Sun, May 20, 2012 at 1:50 PM, Warren Lynn wrote: > Thanks. That will work. But I wish things can get more concise and > elegant. > > I like the Python idea of "make simple things easier and difficult > things possible". So I think the limited "inheritance" I mentioned can > make a large portion

Re: defrecord with "inheritance"

2012-05-20 Thread Kevin Downey
On Sun, May 20, 2012 at 10:22 AM, Warren Lynn wrote: > So from what I read  the philosophy of Clojure discourages inheritance > on concrete data types. However, maybe I am too entrenched in my OO > thinking, how do I define a new record type that includes all the data > members of another record t

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 12:51 PM, Timothy Baldridge wrote: >>  I can certainly imagine cases where the analyzer might want >> reflection on types etc of the given platform, but I think that is >> really an optimization, trading off compile/analyzer time reflection >> for runtime reflection. That p

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 11:25 AM, Timothy Baldridge wrote: >> Logically the interface between the analyzer and the emitter is data >> (maps, etc) which can be serialized as json or some platform specific >> representation. Then all you need to do is write an emitter on your >> platform of choice t

Re: Bootstrapping Clojure-in-Clojure

2012-05-15 Thread Kevin Downey
On Tue, May 15, 2012 at 8:05 AM, Timothy Baldridge wrote: > There seems to be a few steps involved in this from, what I'm seeing. > > From what I'm seeing of the source, there's two files I'll be dealing with > > closure.clj -- defines functions for looking up info about libraries, > functions, et

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Kevin Downey
http://www.lambdassociates.org/blog/klambda.htm suggests a possible bootstrapping mechanism, some kind of reduced set of clojure functionality "ur-clojure" that is designed to be easy to write and interpreter for, and a compiler backend that generates ur-clojure, after compiling the compiler+platfo

Re: Support for complex numbers added

2012-03-27 Thread Kevin Downey
On Mar 27, 2012 6:26 PM, "Andrea Chiavazza" wrote: > > Hello everyone > > I had a go at adding support for complex numbers, it's at: > https://github.com/andrea-chiavazza/clojure/tree/complex > > Some repl usage examples: > > user=> (/ (complex 73 13) (complex 15 25)) > # > > user=> (/ (complex 73

Re: Compilable clojure program, but unreadable?

2012-03-11 Thread Kevin Downey
On Mar 11, 2012 4:10 PM, "Stuart Sierra" wrote: > > The syntax ::s/kwd is incorrect syntax: it should be either ::kwd (which will resolve in the current namespace) or :s/kwd (only one colon). > > -S ::s/kwd is valid, it will cause the namespace of the resulting keyword to be resolved via the name

Re: PersistentHashMap vs PersistentArrayMap in Postal Question

2012-03-04 Thread Kevin Downey
Your example is calling read-string so the resulting map has symbols instead of strings On Mar 4, 2012 7:23 AM, "Brad Lucas" wrote: > I'm using Postal (https://github.com/drewr/postal) and found something > I don't know how to fix. > > I have my application working fine if I have a var with my sm

Re: Hierarchical logs

2012-02-15 Thread Kevin Downey
https://gist.github.com/1314616 is a small example of a custom dispatch, doesn't do custom indenting though On Tue, Feb 14, 2012 at 6:33 PM, jweiss wrote: > It occurred to me that ultimately what I want is just a pretty-printed > output that I can put on a webpage and apply syntaxhighlighter to.

Re: Why don't these two functions produce equivalent results?

2012-01-27 Thread Kevin Downey
Please don't use transients unless you read and understand the documentation. On Jan 27, 2012 12:41 PM, "Bill Robertson" wrote: > I don't understand why the two functions below (recurs and transi) do > not produce the same result. To the best of my understanding doseq > will consume an entire seq

Re: Conflicting transactions

2012-01-24 Thread Kevin Downey
On Tue, Jan 24, 2012 at 8:49 AM, Ersin Er wrote: > Hi, > > What does "conflicting transactions" actually mean in terms of Clojure STM? > Are they write-write transactions on a data structure or are they more > granularly considered conflicting for example if they are manipulating the > same elemen

Re: Bug in 1.3 with sets as functions?

2012-01-21 Thread Kevin Downey
Sets when used as functions are not predicates the do not return true or false based on membership. They return the looked up value, in this case false. You can say "well I passed in the value, why would I want it back" but sets don't need to return an identical object, just an equal object (could

Re: How would I learn more about Clojure's class loading system?

2012-01-05 Thread Kevin Downey
There are a number of different possibilities. Without anything more specific the only realistic answer is "read the source of all the libraries you are using, and of clojure, and of lein and look for tricks with classloaders" Clojure does some classloader fiddling, but so do most jvm build tools

Re: How would I learn more about Clojure's class loading system?

2012-01-05 Thread Kevin Downey
On Thu, Jan 5, 2012 at 12:21 PM, Daniel Bell wrote: > So school has started, and I'm laden with syllabi, either in print or > online.  I'm a stats student, so all my professors use LaTex > for...well, everything.  So I have all these .pdf files. > > I had the idea of parsing them and extracting th

Re: Potential bug w/ inlined functions

2012-01-02 Thread Kevin Downey
On Jan 2, 2012 11:43 AM, "Sam Ritchie" wrote: > > You're right, it's macro more than inlining. Tag metadata doesn't throw an error, but it doesn't fix the reflection warning either (assuming I'm doing it correctly): > > (defmacro barr= [^{:tag bytes} x ^{:tag bytes} y] > `(java.util.Arrays/equal

  1   2   3   4   >