Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thanks Ben, for very useful informations! 2013年7月27日土曜日 13時31分41秒 UTC+9 Ben: > > if you want to use that fmap (or, I'd think, the fmaps provided by either > morph or fluokitten) with uneven depths, you'd have to wrap them in a > defrecord or deftype, I'd expect. > I see. 2013年7月27日土曜日 13時37分28

Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thank you, Jason. The 'map-leaves' does the same as my 'mapf' and simpler. Its name and implementation is very sophisticated with other functions doing similar but different things. Thanks the information. Regards, Y.Kohyama 2013年7月27日土曜日 13時31分28秒 UTC+9 Jason Wolfe: > > This is 'map-leaves' in

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
On Fri, Jul 26, 2013 at 9:31 PM, Ben Wolfson wrote: > On Fri, Jul 26, 2013 at 9:27 PM, Yoshinori Kohyama wrote: > >> Thank you, Ben. >> >> If I think the map as a tree, then as a functor, what I do is 'fmap' (in >> Haskell or some languages), >> ,as you say. >> Thanks for saying that. >> >> Does

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
On Fri, Jul 26, 2013 at 9:27 PM, Yoshinori Kohyama wrote: > Thank you, Ben. > > If I think the map as a tree, then as a functor, what I do is 'fmap' (in > Haskell or some languages), > ,as you say. > Thanks for saying that. > > Does Algo supply things around Functor, Applicative and Monad? > I'm g

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jason Wolfe
This is 'map-leaves' in our open-source lib plumbing.map (besides the option for additional args): https://github.com/Prismatic/plumbing/blob/master/src/plumbing/map.clj Cheers, Jason On Friday, July 26, 2013 8:49:14 AM UTC-7, Yoshinori Kohyama wrote: > > Hello group. > > I wrote a tiny macro t

Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thank you, Ben. If I think the map as a tree, then as a functor, what I do is 'fmap' (in Haskell or some languages), ,as you say. Thanks for saying that. Does Algo supply things around Functor, Applicative and Monad? I'm going to look at Algo. Or anybody knows any other libraries or implementat

Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thank you, Dave. Yes, I'm thinking of a nested map as a sort of tree. Then, what I do may be called 'map-leaves', as you say. Is there an existing function named like that? Or did you say that just as 'an abstraction name'? Y.Kohyama 2013年7月27日土曜日 10時02分17秒 UTC+9 Dave Sann: > > if you are think

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
If the map is a tree with values at the leaves, then it's a functor and applying a function to the values is fmap. On Fri, Jul 26, 2013 at 6:02 PM, Dave Sann wrote: > if you are thinking of the nested map as a sort of tree - which you seem > to be doing - then map-leaves or something similar mi

Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thanks, Jay. Your reply helps me much. I often think which is better, (into {} (map (fn [[k v]] [k (f v)]) m)) and (reduce (fn [a [k v]] (assoc a k (f v))) m m) or (reduce-kv (fn [a k v] (assoc a k (f v))) m m) , where f is a function, m is a map. Any body have any opinion? Thanks. Y. Kohy

ANN: substantiation, An opinionated nested maps validations library

2013-07-26 Thread ronen
Substantiation is an opinionated simple nested map validation library: - Predicates and description kept separate. - Validation description map follows validated input structure. - Pure data structures to describe validations. - Composability of validations is trivial. - Validati

Re: Symbol.intern doesnt return already interned symbols?

2013-07-26 Thread Jeremy Heiler
On July 26, 2013 at 10:39:47 AM, Jürgen Hötzel (juer...@hoetzel.info) wrote: I did some memory profiling on a Clojure Application. I wondered why 361000 clojure.lang.Symbols exist. So I did some object browsing on the memory dump  and found duplicate symbols. After checking the source: static p

core.async: How to signal worker completion

2013-07-26 Thread Jeff Sigmon
I would like to signal after a channel is drained AND subsequently processed by workers inside go blocks. My understanding is that I could return a channel in my worker function and then close the channel when all of the workers have finished to signal completion. Since the channel can only be

Re: Does this abstraction have any existing name?

2013-07-26 Thread Dave Sann
if you are thinking of the nested map as a sort of tree - which you seem to be doing - then map-leaves or something similar might convey the intent. On Saturday, 27 July 2013 04:30:30 UTC+10, Jay Fields wrote: > > I'm not sure I'd call this more readable, but it's another option - using > clojur

Re: Does this abstraction have any existing name?

2013-07-26 Thread Takahiro Hozumi
I think clojure.walk is suited to this purpose. https://github.com/clojure/clojure/blob/master/src/clj/clojure/walk.clj See keywordize-keys as an example. On Saturday, July 27, 2013 2:31:21 AM UTC+9, Yoshinori Kohyama wrote: > > Thank you Gary. > There's no reason why this need to be a macro. > It

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Softaddicts
I do the same but it's because of my age and failing memory, glad that some younger folks face the same issue :) Luc P. > On Friday, July 26, 2013 10:30:04 AM UTC-7, greenh wrote: > > Finally, with respect to the “it’s too hard for newcomers” line of > > > argumentation, > > my reaction is: thi

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Phil Hagelberg
On Friday, July 26, 2013 10:30:04 AM UTC-7, greenh wrote: > Finally, with respect to the “it’s too hard for newcomers” line of argumentation, > my reaction is: this is silly. Do you *really* want to optimize Clojure for use by newcomers? The original complaint was not that it's too hard for new

[ANN] Formative 0.7.2 - now with ClojureScript support

2013-07-26 Thread Justin Kramer
Formative is a web forms library that handles rendering, parsing, and validating. It provides fully-baked defaults (e.g., Bootstrap compatibility), but is extensible. The biggest change since the last announcement is ClojureScript support. You can now use Formative server-side, client-side, or

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Cedric Greevey
On Fri, Jul 26, 2013 at 3:19 PM, Gary Trakhman wrote: > Open-source developers are paid for their work in lots of ways that > may/may-not involve cash. > But generally they're paid as they work, and if they stop working, they stop getting paid, like in most jobs. Of course, the actual coders of

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Andy Fingerhut
There are many who agree with Richard Stallman that it is unethical to distribute software without the source code. There are many who disagree with him, myself included. I think it is 100% ethical to sell proprietary software, sans source code. I only mention this in hopes that people interes

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Gary Trakhman
Open-source developers are paid for their work in lots of ways that may/may-not involve cash. Commercial devs and products are not necessarily evil, and can be good for the community. Who cares if software gets bought over and over again? That's the beauty of software! Competition actually still

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Cedric Greevey
On Fri, Jul 26, 2013 at 10:29 AM, Charlie Griefer wrote: > On Jul 25, 2013, at 8:15 PM, Cedric Greevey wrote: > > Someone makes free software plugins for nonfree software?! > > > On Thu, Jul 25, 2013 at 11:04 PM, Greg wrote: > >> You submit patches to nonfree software?! >> >> >> > I may regret

Re: Ring: How to auto-redirect URI's missing trailing slash

2013-07-26 Thread Steven Degutis
Yeah, that sounds possible. I'll take a shot at it. -Steven On Fri, Jul 26, 2013 at 1:55 PM, Brian Craft wrote: > Other (not clojure) frameworks do this with middleware that redirects to > the url + slash when a route lookup fails, and the url has no trailing > slash. > > Is that possible with

Re: Ring: How to auto-redirect URI's missing trailing slash

2013-07-26 Thread Brian Craft
Other (not clojure) frameworks do this with middleware that redirects to the url + slash when a route lookup fails, and the url has no trailing slash. Is that possible with ring? On Friday, July 26, 2013 10:45:33 AM UTC-7, Reginald Choudari wrote: > > Thanks for all the replies. > > Looks like

Re: Symbol.intern doesnt return already interned symbols?

2013-07-26 Thread Marshall Bockrath-Vandegrift
Jürgen Hötzel writes: > My Question was about the interning. AFAIK interning shoult only > return a "new" Symbol, when the Symbol wasn't interned already. We may already be on the same page. I was just pointing out that there aren’t any semantic benefits to that form of iterning for Symbols. T

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Gary Trakhman
This post takes quite a lot of things to extremes, but I think the main argument still stands. We need good defaults, not to totally change clojure into a newbie-friendly thing at the expense of what makes clojure special. This proposed change fixes a pervasive pain point in many codebases becaus

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jay Fields
I'm not sure I'd call this more readable, but it's another option - using clojure.walk (defn deep-update-vals [m f & args] (let [f (fn [[k v]] (if (map? v) [k v] [k (apply f v args)]))] (clojure.walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m))) On Fri, Jul 26, 2013 at 2:06

Re: Symbol.intern doesnt return already interned symbols?

2013-07-26 Thread Jürgen Hötzel
Hi Marshall, On Fri, Jul 26, 2013 at 5:39 PM, Marshall Bockrath-Vandegrift < llas...@gmail.com> wrote: > Jürgen Hötzel writes: > > > If a symbol X is interned twice, shouldn't the second Symbol.intern(X) > > return the previous interned symbol object? > > Symbols in Clojure can have metadata, a

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jay Fields
I defined update-vals in jry: https://github.com/jaycfields/jry/blob/master/src/clojure/jry.clj#L74-L75 It doesn't traverse nested maps, but I haven't ever needed that ability either. 1) I've never seen a name for that. 2) not in core. I'm sure it's been written 50 times in various helper libs. 3

Re: Ring: How to auto-redirect URI's missing trailing slash

2013-07-26 Thread Reginald Choudari
Thanks for all the replies. Looks like the ring library has a redirect function in ring.util.response namespace. It redirects using the 302 status code. Works for me. Although it is a pain to have to declare a redirect for every route. On Thursday, July 25, 2013 9:08:50 PM UTC-4, Reginald Ch

Re: Ring: How to auto-redirect URI's missing trailing slash

2013-07-26 Thread Reginald Choudari
Thanks for all the replies. Looks like the ring library has a redirect function in ring.util.response namespace. It redirects using the 302 message. Works for me. Although it is a pain to have to declare a redirect for every handler. On Thursday, July 25, 2013 9:08:50 PM UTC-4, Reginald Choud

Re: Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Thank you Gary. There's no reason why this need to be a macro. It has rewritten as a function. And I'd still like to hear any response about the same three questions. (require '[clojure.test :refer (with-test is run-tests)]) (with-test (defn mapf [f m & args] ((fn g [n] (if (map?

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread greenh
A couple thoughts, my own 2-cents-worth. First, I think I’m seeing an entirely legitimate concern being expressed by some developers that :use complicates life in their shops. Contrariwise, there’s clearly a set of developers who are in environments where :use feels very natural, and is of cons

Re: Does this abstraction have any existing name?

2013-07-26 Thread Gary Trakhman
Why does this need to be a macro? It doesn't actually manipulate code. Just turn this: (~f n# ~@args) into (apply f n args) in the function implementation. On Fri, Jul 26, 2013 at 11:49 AM, Yoshinori Kohyama wrote: > Hello group. > > I wrote a tiny macro to apply a function to values in lowes

Does this abstraction have any existing name?

2013-07-26 Thread Yoshinori Kohyama
Hello group. I wrote a tiny macro to apply a function to values in lowest levels in a map with arguments. Three questions: - Does this abstraction have any existing name? - Is there any existing function/macro to do similar things? - Would anyone improve this implementation? (requir

Re: Symbol.intern doesnt return already interned symbols?

2013-07-26 Thread Marshall Bockrath-Vandegrift
Jürgen Hötzel writes: > If a symbol X is interned twice, shouldn't the second Symbol.intern(X) > return the previous interned symbol object? Symbols in Clojure can have metadata, and so can’t have pure value-based identity. Keywords fill that role instead, which is why keywords can’t hold metad

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Lee Spector
PS, I wrote: > but I don't know of any projects dedicated to providing a complete > emacs-based Clojure environment with the usability and lack of learning curve > of FRED. I *do* know about https://mclide.com and https://github.com/TerjeNorderhaug/mclide, and it's author Terje Norderhaug

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Lee Spector
On Jul 26, 2013, at 3:02 AM, Andrew Inggs wrote: > On 25 July 2013 21:55, Lee Spector wrote: >> For Sean or anyone who finds Sean's narrative compelling (I do), imagine >> emacs without the learning curve! I say it's possible and I point to the >> long-extinct FRED (Fred Resembles Emacs Delibera

Re: What is a "state monad binding plan" (referring to code in core.async)

2013-07-26 Thread john
yes your explanations help me a lot! thank you for replying so quickly! I will try to work myself through your code as you suggest. Many thanks! Am Freitag, 26. Juli 2013 16:51:54 UTC+2 schrieb john: > > Hi, > I am trying to understand the code in > ioc_macros.clj

Re: What is a "state monad binding plan" (referring to code in core.async)

2013-07-26 Thread Timothy Baldridge
Well, I wrote the code, so I suppose I should comment on it a bit. The ioc_macros use a very loosely defined version of the state-monad. I don't know if the functions/macros follow all the monad laws, and I really don't care, but here's the problem: I needed to be able to track some state while pa

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Steven Degutis
+1 On Fri, Jul 26, 2013 at 9:56 AM, Timothy Baldridge wrote: > +1 to Charlie. If I ever went back to Python development I would plop down > whatever the going rate is for PyCharm (InteliJ Python IDE), that thing is > an awesome piece of tech. There are very few times I've been utterly blown > aw

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Timothy Baldridge
+1 to Charlie. If I ever went back to Python development I would plop down whatever the going rate is for PyCharm (InteliJ Python IDE), that thing is an awesome piece of tech. There are very few times I've been utterly blown away by an idea all the standard features of Python (testing, debugging, c

What is a "state monad binding plan" (referring to code in core.async)

2013-07-26 Thread john
Hi, I am trying to understand the code in ioc_macros.clj . I stumbled on the macro gen-plan which doc reads "Allows a user to define a state monad binding plan" I am wondering what makes th

Symbol.intern doesnt return already interned symbols?

2013-07-26 Thread Jürgen Hötzel
I did some memory profiling on a Clojure Application. I wondered why 361000 clojure.lang.Symbols exist. So I did some object browsing on the memory dump and found duplicate symbols. After checking the source: static public Symbol intern(String nsname){ int i = nsname.indexOf('/');

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Charlie Griefer
On Jul 25, 2013, at 8:15 PM, Cedric Greevey wrote: > Someone makes free software plugins for nonfree software?! > > > On Thu, Jul 25, 2013 at 11:04 PM, Greg wrote: >> You submit patches to nonfree software?! > I may regret asking this… but don't people deserve to get paid for their work? I

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Charlie Griefer
On Jul 25, 2013, at 12:37 PM, Sean Corfield wrote: > When I started doing Clojure, I used TextMate so it was an obvious > choice to try Sublime Text 2. I tried it on Mac, Windows, and Linux > and it drove me insane with its quirks, bugs, inconsistencies across > platforms and (at the time) very

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Phillip Lord
Laurent PETIT writes: >> The same logic could suggest we remove "or" because we can express it >> with "and" and "not". > > Except nobody complains about "or", "and" or "not" ;-) Actually, they are a right pain when writing my library, because I wanted to use them to mean something else. some was

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Phillip Lord
It's different, because it doesn't necessarily eval with the ns form. So, for example, nrepl.el has an "eval ns form" command. This would not work with a use form. Gary Trakhman writes: > You could also do (use 'clojure.test) below the ns form. One thing that > generally annoys me with 'ns' i

[ANN] 18th tutorial of modern-cljs series

2013-07-26 Thread Giacomo Cosenza
Hi all, I just published the 18th episode of the modern-cljs series. It talks about two topics: - the setup and configuration of a bREPL on top of an nREPL by using the piggieback nrepl middleware created by Chas (I always meet its great works on my way wherever I go - he's just amazing); - th

Re: Can we please deprecate the :use directive ?

2013-07-26 Thread Max Gonzih
Totally agree. :use is anti-pattern since :require :refer :all can do the same. If you have :use in ns macro and want to make :refer :all visible just put it at the end of ns macro, separated b empty line from other :require clauses. Having 2 ways of doing so simple thing as requiring code is m

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Niels van Klaveren
Live-editing OpenGL under Quill (Processing) worked very well in CCW last time I toyed with it. On Thursday, July 25, 2013 7:27:37 PM UTC+2, Chris Gill wrote: > > I find this interesting. I've been using light table mostly, but recently > I tried my hand at socket programming and light table flo

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Cedric Greevey
Would that include a contemporary user interface that can show trees properly, do graphical diffs, and be quickly taken up by any reasonably adept Windows or Mac user the way Eclipse, clooj, and IntelliJ can? On Fri, Jul 26, 2013 at 3:02 AM, Andrew Inggs wrote: > On 25 July 2013 21:55, Lee Spec

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Andrew Inggs
On 25 July 2013 21:55, Lee Spector wrote: > > For Sean or anyone who finds Sean's narrative compelling (I do), imagine > emacs without the learning curve! I say it's possible and I point to the > long-extinct FRED (Fred Resembles Emacs Deliberately) that was part of > Macintosh Common Lisp as a pr