Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Thank you very much to all! Now I completely understand the metadata behavior with the reader. I'll try to adopt eastwood, thanks for the suggestion. Is clearly that the documentation confuses a little bit. Cheers! Andrey 2015-05-05 23:25 GMT+02:00 James Reeves : > The documentation is rather

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

2015-05-05 Thread Mischov
Routes-as-data routing libraries, such Bidi or (I know... complicated...) Pedestal, should be able to (fairly) easily create abstractions that permit convention-based routing. It's not exactly what you're talking about, but I made a little toy example of how you could mimic Rails resource routi

Re: Streaming a big file

2015-05-05 Thread Alan Busby
I wrote a library ( https://github.com/thebusby/iota ) to handle a very similar issue, which I hope would be of some help to you here. On Wed, May 6, 2015 at 12:18 PM, Sam Raker wrote: > I've got two really big CSV files that I need to compare. Stay tuned for > the semi-inevitable "how do I opti

Re: Streaming a big file

2015-05-05 Thread Fluid Dynamics
On Tuesday, May 5, 2015 at 11:18:56 PM UTC-4, Sam Raker wrote: > > I've got two really big CSV files that I need to compare. Stay tuned for > the semi-inevitable "how do I optimize over this M x N space?" question, > but for now I'm still trying to get the data into a reasonable format--I'm > pl

Streaming a big file

2015-05-05 Thread Sam Raker
I've got two really big CSV files that I need to compare. Stay tuned for the semi-inevitable "how do I optimize over this M x N space?" question, but for now I'm still trying to get the data into a reasonable format--I'm planning on converting each line into a map, with keys coming from either

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

2015-05-05 Thread Sean Corfield
On May 5, 2015, at 6:30 PM, Herwig Hochleitner wrote: > Cool Idea! Convention based routing is a great way to get started quickly and > I think that it actually might make a lot of people, asking for clojure > frameworks, happy. > I'm not aware of any clojure lib that does that, but I'd like to

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
In reference to [1]: I do feel like the metadata loss on many macros is undesirable though and I wish it were addressed. It certainly feels "unhygienic", just in a new sense of the term. [1] https://github.com/jonase/eastwood#unused-meta-on-macro -- You received this message because you are

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
+1 to Eastwood. It is great. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from t

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

2015-05-05 Thread Herwig Hochleitner
Cool Idea! Convention based routing is a great way to get started quickly and I think that it actually might make a lot of people, asking for clojure frameworks, happy. I'm not aware of any clojure lib that does that, but I'd like to speculate a bit on what it might mean: As it happens, when I hea

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy Fingerhut
The Eastwood [1] Clojure lint tool has a few warnings in it that warn about unused metadata in your code. The :unused-meta-on-macro warns about metadata on macro invocations, which is usually ignored by Clojure [2]. The :wrong-tag warns about unused type tag metadata on Vars, and non-fully-qualif

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Mike Rodriguez
What you wanted here was (meta '^:abc some-symbol) It's a little weird but the reader attaches the metadata to the symbol. Then the quote just evaluates directly to the same symbol, so the metadata is preserved. I agree that metadata can be confusing though. Especially around where AND HOW

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-05 Thread richard . moehn
Am Mittwoch, 6. Mai 2015 07:17:54 UTC+9 schrieb kovasb: > > I'm mostly interested in something like > http://docs.racket-lang.org/scribble/ > Thanks for the idea! There is http://clojure-scribble.publicfields.net/, which you might know already. Maybe something like that could also be integra

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread 'wparke...@yahoo.com' via Clojure
>From your comments, I suspect this may be a source of confusion as well: When you have something like (defn ^{:doc "Increments"} a-fn [x] (+ x 1)) the metadata is attached to the symbol at read time. However, during the compilation process, the metadata on the symbol is transferred to the Var

Re: Adding components to a stuartsierra/component system at runtime

2015-05-05 Thread Chap Lovejoy
Stuart, Leon, Thank you for the follow ups. I ended up doing as Leon described and creating several subsystems for each remote connection and injecting the required dependencies from the top-level system. I have a component that manages creating the subsystems and dealing with stopping them wit

Re: Adding components to a stuartsierra/component system at runtime

2015-05-05 Thread Leon Grapenthin
You can work with two systems. The first system connects to the database. Once you have started it, you can use it to create the second system. Then you start the second system. The code for this can be wrapped in a single component. On Sunday, May 3, 2015 at 12:02:00 AM UTC+2, Chap Lovejoy wr

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 Paul deGrandis
Hi Sean, Pedestal's router is just an interceptor in the chain. You could easily write an interceptor that looks at the request and sees if it can resolve a var by that name. You could even stack multiple routers - first the var/fn lookup and failing that, a more explicit router. Cheers, Pau

Re: Testing strategies for cljc files

2015-05-05 Thread Leon Grapenthin
You will have to import cljs.test and clojure.test conditionally for the respective platforms. Their APIs are very similar. Some conditionals might have to be added, depending on your use. On Wednesday, May 6, 2015 at 12:12:51 AM UTC+2, Daniel Compton wrote: > > I'm wanting to migrate some files

how goeth the STM experiment?

2015-05-05 Thread Raoul Duke
hi, What do people think of STM after all these years? What pros vs. cons are there - has the community evolved the list of them? thanks for any thoughts. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Surgo
Maybe I don't entirely understand what a web framework is, but it seems to me like Immutant is an example of something that might fit into a lot of the buckets. Could someone explain how that isn't the case? Thanks, -- Morgon -- You received this message because you are subscribed to the Googl

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

2015-05-05 Thread Sean Corfield
In the web framework thread, a number of routing libraries were mentioned but they all seemed to be based on explicit routing. I’m used to working in web environments where routing is usually implicit so that a request for: /foo/bar gets automatically routed to a method bar() in a hand

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-05 Thread kovas boguta
I'm mostly interested in something like http://docs.racket-lang.org/scribble/ On Mon, May 4, 2015 at 7:27 PM, wrote: > > > Am Dienstag, 5. Mai 2015 01:56:13 UTC+9 schrieb Sean Grove: >> >> I've been hoping someone would rebuild Codeq >> , now that tools.analyz

Testing strategies for cljc files

2015-05-05 Thread Daniel Compton
I'm wanting to migrate some files to cljc so a library can be used in Clojure and ClojureScript. I want to be able to run the same test suite against the Clojure and ClojureScript versions. What is the testing story for cljc files? If I made my test files cljc files as well, could I run clojure.te

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread adrian . medina
Because ' is a reader macro which expands to the list (quote some-symbol), so the metadata is applied to the list, and not the symbol. You can verify this in the REPL - (meta (quote ^:abc 'some-symbol)) On Tuesday, May 5, 2015 at 5:43:19 PM UTC-4, Andy- wrote: > > Frankly, I would've (meta ^:abc

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
I expect because 'some-symbol is shorthand for (quote some-symbol), so you're attaching the metadata to a list that disappears once it's evaluated. - James On 5 May 2015 at 22:43, Andy- wrote: > Frankly, I would've (meta ^:abc 'some-symbol) expected to work. Maybe > somebody else can weigh in o

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
Frankly, I would've (meta ^:abc 'some-symbol) expected to work. Maybe somebody else can weigh in on why this one is a no-go. On Tuesday, May 5, 2015 at 5:01:19 PM UTC-4, Andrey Antukh wrote: > > Thanks to both for the responses, but I stil not clearly understand. > > The documentation says very c

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
The documentation is rather misleading, as it implies that "obj" can be a symbol. However, because ^ is a reader macro, it is applied to "obj" before it is evaluated. Clojure maps, vectors and sets all evaluate to themselves, so attaching metadata to the unevaluated expression via the ^ reader mac

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Thanks to both for the responses, but I stil not clearly understand. The documentation says very clearly that: In addition to with-meta, there are a number of reader macros (The Reader: Macro Characters) for applying metadata to the expression following it: ^{:doc "How obj works!"} obj - Sets the

Re: Metadata loss. What am I doing wrong?

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

Re: A more flexible versio of -> ?

2015-05-05 Thread David James
In addition to the Swiss Arrows library, I'd also suggest the shield blazoned with a green arrow on a white bend on green from the House Sarsfield of Sarsfield, a noble house from Sarsfield in the Westerlands: http://awoiaf.westeros.org/index.php/House_Sarsfield On Tuesday, May 5, 2015 at 9:37:

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread James Reeves
When dealing with metadata, it's important to understand the difference between these two expressions: ^{:foo :bar} baz (with-meta baz {:foo :bar}) The first expression attaches metadata to the 'baz' symbol at compile time. The second expression attaches metadata to the data held in 'baz

Metadata loss. What am I doing wrong?

2015-05-05 Thread Andrey Antukh
Hi! I have some trouble with clojure metadata / reader and I do not know if I'm doing something wrong. I have this code: (defn some-func []) (def func ^:abc some-func) (assert (= (meta func) {:abc true})) (def data [[:bar (with-meta some-func {:abc true})] [:baz ^:abc some-func]])

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Kyle Dawkins
Justin Smith speaks the truth about Caribou. I'm also one of the team members, and although we did lose our funding, we're all still around and there are a number of active Caribou projects alive and well. It does have everything Justin says, and yes, it's imperfect, but it's also very easy to

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Justin Smith
Wow, what a thread! As one of the authors and designers of Caribou, I have a couple of clarifications to offer. When the initial post compared contributors and commits, it picked our "caribou" repo, which, while extensive, holds no code, only our docs. The actual code is in caribou-core (persi

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Sébastien Orban
To be honest it's disquieting that some of use think that because the problem is "solved" elsewhere we can't do better : we can, and we should. I appreciate the effort that has been made since the dawn of PHP for simple website - but we seem to be stuck on "Rails" iterative period - by that I

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Gary Schiltz
Colin's response is spot on. The Clojure ecosystem is a lot of fun, and is really good for solving complex problems, but I think it falls short for handling things that have already been solved in other less technically interesting ecosystems. Shopping carts and payment gateway integration, as

Re: Embedded systems and transpiling Clojure to Nim

2015-05-05 Thread Paul deGrandis
I'm just going to echo a few things - Timothy and I have talked at length about Clojure-like languages on other platforms. His ideas and general approach have led to some very promising work (Pixie), and I can personally vouch for RPython as a platform. My ideas led me to Terra ( http://terra

Re: A more flexible versio of -> ?

2015-05-05 Thread Tj Gabbour
I really like: https://github.com/jdevuyst/fletching-macros It's nice because you can use it with plain arrows... as little exceptions. On Tuesday, May 5, 2015 at 4:09:55 AM UTC+2, Frank Siler wrote: > > > On May 4, 2015, at 1546, Kaiyin Zhong > > wrote: > > > Wouldn't be nice to have somethin

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Dmitri
One way I could see this working is having a more opinionated profile like +site or something that sets up an app with authentication, logins, a default model and so on. I would definitely support merging the efforts on this front. Ping me by email, and we can try figure out the details. :) On

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Dmitri
Luminus uses a minimal amount of generated code. It completely embraces the composable library approach. The difference from rolling your own each time is that it provides some structure and it's a curated set of libraries that are known to work well together. On Tuesday, May 5, 2015 at 3:46:09

Experimental lightweight library for unit-checked math

2015-05-05 Thread 'wparke...@yahoo.com' via Clojure
I have created a *highly experimental* library for unit-checked math. I realize that there are some existing solutions, but I wanted something more lightweight that would layer on top of the existing Clojure/Java numeric system rather than create a new one. This is designed to provide validat

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Thorsten Wilms
On 05.05.2015 03:02, Daniel Compton wrote: What this may look like for Clojure in 2015 is probably very different than what it looked like for Ruby in 2004. It may be a traditional framework, a lein template, a standard pattern of code, a set of conventions and loosely coupled protocols, pretty m

Re: Clojure needs a web framework with more momentum

2015-05-05 Thread Daniel Kersten
On Monday, May 4, 2015 at 4:41:02 AM UTC-4, Sven Richter wrote: > One potential problem with this "web framework" as app template approach > is upgrade-ability. When 2.0 of your "framework" comes out, what happens > to an app generated from 1.0 that wants to benefit from the new > capabilities? >

Re: juxt/bidi ring question

2015-05-05 Thread Daniel Kersten
I'm going to take a wild guess and say: missing wrap-content-type middleware perhaps? On Mon, 4 May 2015 at 20:37 Fluid Dynamics wrote: > On Monday, May 4, 2015 at 3:21:19 PM UTC-4, clifford wrote: >> >> Thanks @fluiddynamics your right on the money. >> >> On Monday, 4 May 2015 17:34:26 UTC+2, c