Re: How to send GET http request with range header, using clj-http or http-kit?

2013-08-24 Thread Sean Corfield
Can't you just do (get "..." {:headers {..}}) and pass the range header that way? On Sat, Aug 24, 2013 at 8:12 PM, Seven Hong wrote: > Hi all: > > I am trying to grab down a segment of a file on a http server, so > technically I should send a GET message with a range header specifying the > range

Re: clojure.java.jdbc: suggestion to name mapping

2013-08-26 Thread Sean Corfield
The db-spec is not used by the DSL. Name mapping is a function of the DSL, in general. This request has come up in the past and it just isn't practical since the db-spec is completely independent of the DSL. On Mon, Aug 26, 2013 at 6:06 AM, Alice wrote: > It would be convenient if I can specify t

Re: too circular?

2013-08-26 Thread Sean Corfield
If you want the sequence itself, so you can take various prefixes of it: (def fib (cons 1 (cons 1 (map + fib (rest fib) (take 5 fib) (take 10 fib) Has the advantage of not recalculating any part of it - and the disadvantage of holding onto the head - so it depends what you want to do with it

Re: clojure.java.jdbc: suggestion to name mapping

2013-08-26 Thread Sean Corfield
hey can be altered? > I know global parameters are ugly, but having to specify them every time is > really a pain. > > > On Tuesday, August 27, 2013 2:32:20 AM UTC+9, Sean Corfield wrote: >> >> The db-spec is not used by the DSL. Name mapping is a function of the >> D

Re: core.async and referential transparency

2013-09-03 Thread Sean Corfield
Just an aside, Nils, have you take a look at Elm? It's a Haskell-like language, designed for FRP, compiles to JS, and deliberately avoids monads and arrows (at least in terminology) by having Signal and Automaton abstractions... http://elm-lang.org On Tue, Sep 3, 2013 at 9:12 AM, bertschi wrote:

Re: Handling name collisions with clojure.core

2013-09-04 Thread Sean Corfield
You only get the warning if you 'use' the namespace or 'refer all' tho', correct? And we've recently seen a lot of discussion that basically says "don't do that" so it seems that either users of core.matric are going to have two "approved" choices: * require core.matrix with an alias, or choose to

Re: Handling name collisions with clojure.core

2013-09-05 Thread Sean Corfield
On Wed, Sep 4, 2013 at 11:25 PM, Mikera wrote: > I remember the debates :-) and I don't think there was anything like a > consensus that "don't do that" is the right answer. I didn't say there was consensus or that it was right :) > I'm not against giving the user control. I just think the defau

Re: "Clojure in the Large" style JDBC library

2013-09-07 Thread Sean Corfield
If you have any feedback on the new API in the 0.3.0-alpha4 release, let me know. The whole point of the API rewrite in 0.3.0 was to move away from the *db* global dynamic variable, and deprecate all the old stuff. Getting a final release of 0.3.0 is taking longer than I had hoped - apologies - bu

Re: Putting in alts! - haven't seen it used

2013-09-08 Thread Sean Corfield
We're using alts! to take a value or timeout, as part of machinery to detect whether a popup opens or is blocked. On Sun, Sep 8, 2013 at 7:21 PM, Alan Shaw wrote: > I'm accustomed to using alts! to allow taking from a collection of > core.async ports, but haven't come up with a use case for a put

Re: Putting in alts! - haven't seen it used

2013-09-08 Thread Sean Corfield
't seen them > used either, I'm sure there's a use case, I haven't found it yet though. > > Timothy > > > On Sun, Sep 8, 2013 at 9:35 PM, Sean Corfield > wrote: >> >> We're using alts! to take a value or timeout, as part of machinery to >&

Re: how to use clojure.java.jdbc.sql

2013-09-08 Thread Sean Corfield
The basic DSL cannot do 'like' so you probably want to look at HoneySQL which is the recommended way to extend clojure.java.jdbc. On Sun, Sep 8, 2013 at 11:07 PM, Abraham wrote: > > I want to generate sql string using clojure.java.jdbc.sql for eg. > > "SELECT B.ID , B.TITLE ,B.AUTHOR , C.CA

Re: finding retained head

2013-09-10 Thread Sean Corfield
FWIW, Brian and I were looking at this off-list and we changed (dorun (map identity matrix)) to (doseq [x matrix] (identity x)) and that seemed to work just fine - even in Brian's more complicated case. Given that dorun specifically says it doesn't hold on to the head, I would have expected the two

Re: The Eclipse Public License is not a good license

2013-09-11 Thread Sean Corfield
Perhaps a more productive way to approach this issue would have been to ask if the group could point you to a discussion of why Clojure is under the EPL instead of starting from a point of criticism, and challenging the care with which the license was selected? Searching the archives would have tu

Re: finding retained head

2013-09-11 Thread Sean Corfield
Just to confirm, (t2 0 (range 100)) -- using doseq instead of dorun -- does NOT run out of memory, correct? On Wed, Sep 11, 2013 at 8:59 AM, Brian Craft wrote: > This appears to have no effect on the problem. I tested with > jdbc/transaction, and with Sean's simple example: > > user=> (defn f

Re: finding retained head

2013-09-12 Thread Sean Corfield
;>> (find-doc "part-of-name-here") >>>> Source: (source function-name-here) >>>> Javadoc: (javadoc java-object-or-class-here) >>>> Exit: Control+D or (exit) or (quit) >>>> >>>> user=> (defn f [g] (g)) >

Re: clojure.java.jdbc connection pool example

2013-09-13 Thread Sean Corfield
There are examples in the documentations for both c3p0 and BoneCP: http://clojure-doc.org/articles/ecosystem/java_jdbc/connection_pooling.html Note: this is the home for the "official" java.jdbc documentation so that it can be augmented by the community, rather than locked in the java.jdbc repo w

Re: The Eclipse Public License is not a good license

2013-09-14 Thread Sean Corfield
On Sat, Sep 14, 2013 at 5:31 PM, Musical Notation wrote: >> Each Contributor must identify itself as the originator of its Contribution, >> if any, in a manner that reasonably allows subsequent Recipients to identify >> the originator of the Contribution. > That's my problem. People are, of cours

Re: AOT Compilation Error on Clojure 1.7.0-alpha5

2015-01-14 Thread Sean Corfield
Do you perhaps have both AOT and JIT versions of that namespace loaded? See the thread that this post is part of: https://groups.google.com/d/msg/clojure/jj87-4yVlWI/UpsYOPZ3FicJ Following Nicola’s suggestion, I built a version

Re: Dynamically creating defrecord

2015-01-17 Thread Sean Corfield
erflow.com/questions/4288360/clojures-macro-define-a-binding-whose-name-is-composed-from-an-argument/4288738#4288738 Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1

Re: [ANN] Clojure 1.7.0-alpha5 now available

2015-01-20 Thread Sean Corfield
Just FYI, we took 1.7.0-alpha5 into production today. We’ll let you know if we run into any issues. Other than tripping over the AOT/JIT thing with core.typed, it’s been smooth sailing on dev/QA… …and we actually have a transducer in production now! Sean On Jan 10, 2015, at 7:36 AM, Alex Mille

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-29 Thread Sean Corfield
Which version of Clojure are you using? Does clojure-hadoop or Schema include AOT-compiled versions of other libraries and/or core namespaces? If the answers are 1.7.0 Alpha 5 and "yes" then you've run into the same problem I and a few others did: the previously undefined behavior of loading b

Re: lein discovery issues

2015-01-30 Thread Sean Corfield
ou should probably avoid it. Do you have a specific example that seems like it should be better documented? Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880)

Re: maven error : "Could not find metadata XXX/maven-metadata.xml in local"

2015-02-04 Thread Sean Corfield
4 15:52 lein-template-0.5.4.pom.sha1 Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ dev.Objective() - Developing Apps, Developing Skills, Developing Community -- May 12-15, 2015 - Bloomington, MN - http://devobjective.com -- You received this message becaus

[ANN] Frege compiler plugin for Leiningen (Clojure's build tool)

2015-02-08 Thread Sean Corfield
ng as you have Leiningen installed: https://github.com/seancorfield/lein-fregec/tree/master/example Leiningen is available from http://leiningen.org Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaube

Re: OO Programmer trying to move to Clojure: Namespace Organization

2015-02-08 Thread Sean Corfield
payment.braintree, worldsingles.payment.sbw, worldsingles.transparensee - search engine, worldsingles.data - our general persistence layer). Our average namespace is about 200 lines long (we have just over 100 namespaces in our main app - they range from 16 lines to 1,266). Sean Corfield -- (904) 302-SEAN An Architect

Re: No such var during runtime

2015-02-20 Thread Sean Corfield
Could it perhaps be this bug at work? http://dev.clojure.org/jira/browse/CLJ-1604 Sean On Feb 20, 2015, at 1:31 PM, Sven Richter wrote: > A user reported an error for closp which I cannot make sense of: > java.lang.RuntimeException: No such var: t

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Sean Corfield
eys) that encapsulates the identifier/entity mappings and the DB connections we use, but we’re slowly moving away from that toward raw clojure.java.jdbc and leveraging the :row-fn and :result-set-fn keys more. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfect

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Sean Corfield
I understand it. We're either building SQL from a map of key/value pairs or from composable pieces using HoneySQL (for our complex reports that are all driven by data as well). Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of

Re: Border cases for doseq

2015-02-25 Thread Sean Corfield
Cecil, Have you looked at the community documentation for java.jdbc? It has some examples of DDL and metadata: http://clojure-doc.org/articles/ecosystem/java_jdbc/using_ddl.html Sean On Feb 25, 2015, at 10:35 AM, Cecil Weste

Re: How do I depend on clojure 1.7.0-master-SNAPSHOT?

2015-02-26 Thread Sean Corfield
hots";]] The only difference between my project.clj (which works) and yours is the trailing / on the repository address: :dependencies [[org.clojure/clojure "1.7.0-master-SNAPSHOT"]] :repositories [["snapshots" "https://oss.sonatype.org/content/repositori

Re: Is it possible to determine that I did a 'lein repl'

2015-02-27 Thread Sean Corfield
file.repl=true"] might be sufficient for you. Then in our code we test: (System/getProperty "lein.profile.repl") This will be true if you’re in a REPL and nil otherwise. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the

Re: Is it possible to determine that I did a 'lein repl'

2015-02-27 Thread Sean Corfield
default JVM options — we do different things on different platforms — it returns a vector of JVM options. So :jvm-opts ["-Dlein.profile.repl=true"] might be sufficient for you." Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the ene

Re: How do I depend on clojure 1.7.0-master-SNAPSHOT?

2015-02-27 Thread Sean Corfield
ype [exec] Retrieving org/clojure/clojure/1.7.0-master-SNAPSHOT/clojure-1.7.0-master-20150220.180325-29.jar from sonatype Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist no

Re: Breaking out of a sequence

2015-03-02 Thread Sean Corfield
Another option to consider: Treat the problem as a `reduce` on the sequence of adjustments where the processing of each adjustment depends on the user input and "cancel" makes the processing return (reduced nil) to halt the reduction. That will stop automatically when the sequence of adjustment

Re: Deterministic macro expansion for Clojure?

2015-03-23 Thread Sean Corfield
system itself, not your own code. Surely in a unit test you’d want to test the _behavior_ of the code instead? Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Sean Corfield
Looks like a great set of updates! Unfortunately, as several of us found out today, the change to the StringReader invoke() signature breaks Instaparse so I’m blocked from testing the World Singles code base with alpha6 (or master) at the moment. Is that just a hazard of relying on the internal

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Sean Corfield
Java code that implements Clojure and it struck me as odd that these pieces were clearly designed to be called from Clojure yet otherwise seemed to be "internal" so I'd definitely be curious as to the thinking there. Sean Corfield -- (904) 302-SEAN An Architect's View -- http

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Sean Corfield
On Mar 31, 2015, at 4:00 PM, Mark Engelberg wrote: > I can push a new version of instaparse incorporating Michael Blume's pull > request by the end of the day. That would be great, Mark! Thank you! Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ &q

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Sean Corfield
later today or tomorrow in preparation for our next production build (we’re running alpha5 in production right now). Sean On Mar 31, 2015, at 3:21 PM, Sean Corfield wrote: > Looks like a great set of updates! > > Unfortunately, as several of us found out today, the change to the >

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Sean Corfield
On Apr 1, 2015, at 10:09 AM, Alex Miller wrote: > There is no way to "turn on" read conditionals by default at the REPL - it is > only on by default when loading a .cljc file. This sounds like a useful feature to add to the REPL tho’ so that you can copy’n’paste code as-is and have it behave "a

Re: sp mm training in hyderabada

2015-04-13 Thread Sean Corfield
On Mon, Apr 13, 2015 at 9:32 AM, Fluid Dynamics wrote: > On Monday, April 13, 2015 at 9:27:33 AM UTC-4, sunitha seo wrote: >> >> Sap Bw Bi Bo Training Centre in Hyderabad | Vijayawada |Guntur | Vizag, >> Online Sap Bw Bi Bo Training In USA, sp mm training in hyderabada >>

Re: [ANN] Clojure 1.7.0-beta1 released

2015-04-16 Thread Sean Corfield
We deployed beta1 to production this morning. I’ll report back if we encounter any problems (generally we’ve found Clojure pre-release builds to be very stable). We were previously running alpha5 in production. Sean On Apr 10, 2015, at 12:25 PM, Alex Miller wrote: > Clojure 1.7.0-beta1 is now

Re: flip in clojure

2015-04-30 Thread Sean Corfield
I wonder how many code bases out there have their own variant of `flip`? Here’s ours: (defn flip "Like partial except you supply everything but the first argument." ([f b] (fn [a] (f a b))) ([f b c] (fn [a] (f a b c))) ([f b c d & more] (fn [a] (apply f a b c d more Sean On Apr

Re: Clojure needs a web framework with more momentum

2015-05-02 Thread Sean Corfield
On Sat, May 2, 2015 at 1:43 PM, gvim wrote: > One could conclude from this that the Clojure community isn't that > interested in web development but the last Clojure survey suggests > otherwise. Yes, lots of web apps get built with Clojure. > Furthermore, I have a hunch that Clojure's poor ad

Re: Clojure needs a web framework with more momentum

2015-05-02 Thread Sean Corfield
On Sat, May 2, 2015 at 8:18 PM, Mark Engelberg wrote: > Clojure is great for creating new, disruptive web models, but what's the > easiest path to creating something that can be done trivially with, say, > Drupal or Django? > The question tho' is why you'd want to use Clojure for something that

Re: Clojure needs a web framework with more momentum

2015-05-02 Thread Sean Corfield
On Sat, May 2, 2015 at 10:20 PM, Mark Engelberg wrote: > Because many problems start out as things that can be solved with standard > solutions and then evolve into something more elaborate. Best to start > with something that can both do the easy things, and handle the more > complex stuff as w

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Sean Corfield
Not sure what you mean by "one flash value" — I’d expect you to have a map of "flash" scope data and that’s the way my FW/1 behaves: you assoc values into the "flash scope" and they’re restored on the next request. On May 4, 2015, at 8:39 AM, Josh Kamau wrote: > I am currently trying to "redir

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Sean Corfield
the session ID would be a cookie). Only if your session-store is cookie will everything be stored as a cookie. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Sean Corfield
On May 4, 2015, at 11:08 AM, Josh Kamau wrote: > @Sean, i wanted totally stateless backend. Without a database? :) Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist n

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Sean Corfield
n Lift, not because it is necessarily better, but because TypeSafe are pouring marketing dollars into it, as part of their drive to encourage Enterprise uptake of Scala. They have a vested interest in Play being very successful as it will drive more business for them. Sean Corfield -- (904) 302-

Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-05 Thread Sean Corfield
. You can generally provide overrides for some explicit routes as well if you want them handled differently. Are there any such libraries for Clojure? Are they well-maintained? Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy o

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-05 Thread Sean Corfield
Perhaps I should rephrase that as a request for simple, convention-based routing that works with Ring directly? :) I’m sure Pedestal’s great, but just looking at the repo and documentation doesn’t exactly scream "simple"… I just don’t want to have to read that much documentation to get a simple

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-05 Thread Sean Corfield
ntions). There’s a Leiningen template: lein new fw1 tryme cd tryme PORT=8321 lein run go to http://localhost:8321/ Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, F

Re: Clojure needs a web framework with more momentum

2015-05-06 Thread Sean Corfield
ed web frameworks: the sense that smart people don’t need them and beginners will either figure it out or they won’t — that and the fact that the majority of us in the Clojure community seem to suck at documentation (with a few shining exceptions!). Sean Corfield -- (904) 302-SEAN An A

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-06 Thread Sean Corfield
Thanks Avi! I’ll bookmark that and see whether I can either borrow from it or contribute to it in the context of FW/1 :) Sean > On May 6, 2015, at 3:46 AM, Avi Avicenna wrote: > > There is one, > > Wakeful (https://github.com/ninjudd/wakeful) routing library fits your > criteria. > > Here

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-06 Thread Sean Corfield
ffer from this. java.jdbc suffers from this and it’s really easy to use too — I just haven’t figured out how to explain it properly :( Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-06 Thread Sean Corfield
On May 6, 2015, at 9:42 AM, Sean Corfield wrote: > And that’s why I thought that Pedestal looked very complex and hard to use. > Even the Hello World example is couched in terms that make it look overly > complex. I Googled to see if there was a better page explaining Pedestal and di

Re: Clojure needs a web framework with more momentum

2015-05-06 Thread Sean Corfield
o clojure-doc.org <http://clojure-doc.org/> to make that the central, appealing, beginner-friendly site for all things Clojure. > Sean Corfield wrote: > The "rough edges" show up on a lot of things in the Clojure ecosystem. I know > I suck at documentation which is why I m

Re: JDK8

2015-05-07 Thread Sean Corfield
uild will take us to Clojure 1.7.0 Beta 2 (unless a new version appears in the next day or two). We need to schedule an upgrade to 1.8.0_45 for the JDK I guess. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." --

Re: clojure.java.jdbc bug?

2015-05-07 Thread Sean Corfield
Different database drivers handle different data types in different ways. You’ve extended the protocol to convert Clojure’s BigInt to a string which may work for you, but won’t necessarily work for everyone. That’s why the protocols are provided. See the documentation about them, here: http://c

Re: clojure.java.jdbc bug?

2015-05-07 Thread Sean Corfield
roups.google.com/forum/#!forum/clojure-java-jdbc> (which I just realized isn’t linked from either the community docs or from Github… I’ll get that fixed this weekend!) Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good.&q

Re: clojure.java.jdbc bug?

2015-05-08 Thread Sean Corfield
BTW, your tone comes across as rather snarky which isn’t going to make people want to assist you. If you have concrete, constructive suggestions to make, and you care enough to create a JIRA account and create a ticket for broader discussion, you’re likely to find your comments taken more serio

Re: ANN: ClojureScript 0.0-3255 - pretty printer & latest Closure Compiler / Library

2015-05-09 Thread Sean Corfield
Sounds like you need to a lein clean? That's normally the error you see if you have old versions of compiled files laying around... On Sat, May 9, 2015 at 9:22 PM, Rangel Spasov wrote: > Hey guys, > > 0.0-3264 fails for me with: > > clojure.lang.ExceptionInfo: failed compiling > file:resources/p

Re: load a namespace at repl?

2015-05-12 Thread Sean Corfield
On Tue, May 12, 2015 at 7:55 PM, wrote: > If I: > > git clone https://github.com/overtone/overtone.git > > cd overtone > > lein repl > > and then at the REPL, I try to load Overtone: > ... > user=> (resolve 'overtone.studio.inst) > You want require, not resolve, in order to load the namespace.

Re: separation of concerns w/o encapsulation

2015-05-14 Thread Sean Corfield
es if necessary to clearly delineate APIs vs implementations. A def of immutable data tends to be public too. It’s rare that I feel the need to make things private since immutability means no one can "abuse" my data or my functions. Sean Corfield -- (904) 302-SEAN An Architect's View -

Re: separation of concerns w/o encapsulation

2015-05-14 Thread Sean Corfield
layers in your hierarchy — and leave them all public. That creates a much more reusable, extensible code base. IMO (now — I didn’t think that way five years ago). Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good."

Re: separation of concerns w/o encapsulation

2015-05-14 Thread Sean Corfield
c" to use and building software for internal use by your own team or other peer teams in your division. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) --

Re: Relational mapping - turning an sql query result into array of hashes (with joins)

2015-05-25 Thread Sean Corfield
I just don’t consider it a problem. A query returns a flat result set — a sequence of hash-maps. That’s it. That’s what SQL returns (essentially a table) and it’s a perfectly reasonable data structure for Clojure to work with. The JOINs in SQL just say how to link tables together to produce that

Re: Relational mapping - turning an sql query result into array of hashes (with joins)

2015-05-25 Thread Sean Corfield
t; Yup, and that’s exactly what I meant by: "Any structural grouping semantics you want to apply are up to your application" In order to correctly "unjoin" your result set for your application, you need to apply structural grouping based on knowledge of the applicatio

Re: Clojure.data.xml fails when element size reached 33 symbols.

2015-06-01 Thread Sean Corfield
chunk is typically 32 elements. You tend to get "stream closed" or "connection closed" errors if you let a lazy sequence escape the open/close logic in your code, since it gets closed after just the first chunk. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://

Re: (slurp nil)

2015-06-02 Thread Sean Corfield
on it, many of which fail when given nil. I would expect passing nil to slurp to be an exceptional situation that you’d either want to explicitly check for beyond hand or handle via try/catch after the fact. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ &qu

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-06-04 Thread Sean Corfield
We took RC1 to production yesterday afternoon (after being on beta1 since mid-April). So far so good. I think the only 1.7 new feature we’re using so far is transducers (we wrote a transducer that takes a result set of user-to-user messages and returns a paginated, nested result set organized b

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-06-04 Thread Sean Corfield
On Jun 4, 2015, at 2:51 PM, Luc Prefontaine wrote: > Still 3 months away from production beta. I get twitchy if we go more than two weeks between production builds — but then it’s the web :) Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection

Re: Help with data structure transformation

2015-06-05 Thread Sean Corfield
It’s because if you treat a hash map as a sequence — as `for` does — you get a sequence of pairs (key/value — map entries): (seq {:a 1 :b 2}) ;;=> ([:a 1] [:b 2]) Does that help? Sean > On Jun 5, 2015, at 7:41 PM, gvim wrote: > > I must re-read "Clojure Programming" (O'Reilly

Re: Help with data structure transformation

2015-06-05 Thread Sean Corfield
across it in > the textbooks but maybe I wasn't paying attention :) > > gvim > > > > On 06/06/2015 04:08, Sean Corfield wrote: > >> It’s because if you treat a hash map as a sequence — as `for` does — you >> get a sequence of pairs (key/value — map entries): &g

Re: namespace :as vs :require

2015-06-05 Thread Sean Corfield
I think you mean :as vs :refer? The consensus is that using :as makes it easier to see where each symbol comes from when you're reading the code -- and avoids name conflicts between functions in different namespaces. If you use :refer, you lose that visibility. However, there are some symbols whe

Re: Where should 'if-let-all' macro go?

2015-06-09 Thread Sean Corfield
ess to the (truthy) values of `a`? There are arguments in favor of (and against) each position and thus no clear consensus on what to choose. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, Fr

Re: breaking homoiconicity?

2015-06-19 Thread Sean Corfield
.lang.String; — unhelpful but this is the name of the class, as above. and you can see what it really is like this: (.getTypeName (Class/forName "[Ljava.lang.String;")) ;;=> "java.lang.String[]" — that is more readable! Sean Corfield -- (904) 302

Re: breaking homoiconicity?

2015-06-20 Thread Sean Corfield
On Jun 20, 2015, at 3:58 AM, Joe Corneli wrote: > On Saturday, June 20, 2015 at 4:15:30 AM UTC+1, Sean Corfield wrote: > (.getTypeName (Class/forName "[Ljava.lang.String;")) > ;;=> "java.lang.String[]" — that is more readable! > > Thanks

Re: Using core.match in tests?

2015-06-21 Thread Sean Corfield
How about this: (defmacro matches [value pattern] `(is (match ~value ~pattern true :else false) (str "(match " ~value " " '~pattern ")"))) (let [a {:x 2}] (matches a {:y _})) ; => FAIL ; => (match {:x 2} {:y _}) ; => expected: (clojure.core.match/match

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

2015-06-22 Thread Sean Corfield
va.io :as io]) is equivalent to (:require [clojure.java.io :as io :refer :all]) so it refers in all of the symbols from that namespace directly into your namespace (i.e., they can be referenced even without the io/ prefix). Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.o

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

2015-06-22 Thread Sean Corfield
On Jun 22, 2015, at 2:22 PM, Ritchie Cai wrote: > You mean (:use [clojure.java.io]) is equivalent to (:require [clojure.java.io > :as io :refer :all])? Not quite, (:use [clojure.java.io]) is equivalent to (:require [clojure.java.io :refer :all]) Sean Corfield -- (904) 302-SEAN An Archi

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

2015-06-22 Thread Sean Corfield
equired namespace. There’s not much point in specifying an alias (with :as) for :use or :require :refer :all since those bring in every symbol directly anyway. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gusta

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

2015-06-29 Thread Sean Corfield
Have you actually tried any of the exclusions that Leiningen suggests? For example: [clj-time "0.6.0"] overrides [ring "1.4.0-RC1"] -> [ring/ring-jetty-adapter "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"] and [ring "1.4.0-RC1"] -> [ring/ring-devel "1.4.0-RC1"] -> [ring/ri

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

2015-07-06 Thread Sean Corfield
ght be able to > confirm that Joda is, in fact, the problem? That’s what lein deps :tree is for — to tell you about conflicts and how to eliminate them. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flauber

Re: Advice on introducing a Java dev to Clojure

2015-07-09 Thread Sean Corfield
gt; provide an on-ramp. https://pragprog.com/book/mbfpp/functional-programming-patterns-in-scala-and-clojure — Highly recommended! Sean Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, Fr

Re: Advice on introducing a Java dev to Clojure

2015-07-09 Thread Sean Corfield
ase the value. One caution I will provide here is that Clojure is a radically different way of programming / thinking for an "Enterprise Java" developer. I touch on that here: http://seancorfield.github.io/blog/2014/09/23/clojure-in-the-enterprise/ (referenced in the LispCast art

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-18 Thread Sean Corfield
Wow, that's a fast timeline. Thank you. We'll upgrade to Alpha 2 this week. We may go to production with it fairly quickly. Sean On Sat, Jul 18, 2015 at 6:11 AM, Alex Miller wrote: > Clojure 1.8.0-alpha1 and 1.8.0-alpha2 are now available. > > Try it via > - Download: > https://repo1.maven.org/

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-19 Thread Sean Corfield
On Jul 18, 2015, at 10:33 PM, Sean Corfield wrote: > Wow, that's a fast timeline. Thank you. We'll upgrade to Alpha 2 this week. > We may go to production with it fairly quickly. Switched out 1.7.0 for 1.8.0-alpha2 and got the exception below. Posting here in case anyone knows

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-19 Thread Sean Corfield
http://dev.clojure.org/jira/browse/CLJ-1208?focusedCommentId=39632&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-39632 > > <http://dev.clojure.org/jira/browse/CLJ-1208?focusedCommentId=39632&page=com.atlassian.jira.plugin.system.issuetabpanels:comm

Potemkin loading issue solved (was: Clojure 1.8.0-alpha2

2015-07-20 Thread Sean Corfield
lone Clojure projects!). That dated back to when we still had to add JARs to the lib folder due to the way our old Clojure loader used to work — now we load everything dynamically based on `lein classpath`. So, sorry for the noise :( Sean > On Sunday, July 19, 2015 at 5:02:13 PM UTC-7, Sean Corfi

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-20 Thread Sean Corfield
into production "soon". Sean > On Jul 19, 2015, at 4:47 PM, Sean Corfield wrote: > > On Jul 18, 2015, at 10:33 PM, Sean Corfield wrote: >> Wow, that's a fast timeline. Thank you. We'll upgrade to Alpha 2 this week. >> We may go to production with it fa

[ANN] clojure.java.jdbc 0.4.1

2015-07-27 Thread Sean Corfield
(if anyone wonders why 0.4.0 and 0.4.1 are the same release, it was finger trouble while trying to run the Maven Release Build on the Clojure build server… sorry!) Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good."

Re: Java 8 Lambda Interop

2015-07-27 Thread Sean Corfield
I think Mike was suggesting something like this: (-> (IntStream/range 0 100) (.filter ^Predicate odd?) (.limit 5) (.collect Collectors/toList)) and having the Clojure compiler figure out that you’re trying to cast an IFn to a functional interface and therefore "do the magic" for you. I don’t kn

[ANN] clojure.tools.cli 0.3.2 (was: Next release for clojure.tools.cli? Is it dead?

2015-07-28 Thread Sean Corfield
option; A warning is displayed when unknown options are encountered. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) > On Jul 23, 2015, at 9:

Re: [ANN] Clojure 1.8.0-alpha3

2015-07-29 Thread Sean Corfield
Somewhat related, I had this code which "worked" on Alpha 2: (defn ^java.nio.ByteBuffer to-byte-array [^com.eaio.uuid.UUID u] (let [lo (.getClockSeqAndNode u) hi (.getTime u)] (-> (java.nio.ByteBuffer/allocate 16) (.putLong hi) (.putLong lo) (.array (can anyone

Re: Clojure: Clojure.contrib.sql: How do I update ALL the rows of a database table?

2014-06-26 Thread Sean Corfield
Clojure Contrib libraries are all deprecated and very out of date. For clojure.contrib.sql, you'll want to use clojure.java.jdbc instead. Complete (community-maintained) documentation can be found here: http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html Reference documentation can be

Re: Clojure: Clojure.contrib.sql: How do I update ALL the rows of a database table?

2014-06-26 Thread Sean Corfield
://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go which, amongst other things, says: "clojure.contrib.sql • Migrated to clojure.java.jdbc" What wording would you suggest we add to either/both of these pages? Sean Corfield -- (904) 302-SEAN An Architect's Vie

Re: [Request for Feedback] Clojure Lab: IDE for Clojure in Clojure

2014-06-27 Thread Sean Corfield
Nice piece of work - especially for a school project at any level! Impressive! Sean On Jun 27, 2014, at 8:00 AM, juan.facorro wrote: > Hello Clojurians! > > I wanted to share with you a project called Clojure Lab, an IDE for Clojure > in Clojure. > > https://github.com/jfacorro/clojure-lab >

Re: [Request for Feedback] Clojure Lab: IDE for Clojure in Clojure

2014-06-27 Thread Sean Corfield
I've been on Java 8 on my development Mac for ages. The only thing holding us back from going to Java 8 in production is New Relic don't yet support it... We upgraded our entire stack to Java 7 back in October and I thought we were late since Java 6 had been EOL'd for so long :) Sean On Jun 27

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