Re: Proposed change to let- syntax

2013-07-19 Thread Daniel Dinnyes
Hi, This will sound strange from me, but are these macros really to be added to the core? Firstly, I don't see they extend the language in any way new. Instead they ease some very special cases, which could have been done with the combination of existing core functions/macros just as well,

Re: Proposed change to let- syntax

2013-07-19 Thread Michał Marczyk
On 19 July 2013 10:24, Daniel Dinnyes dinny...@gmail.com wrote: Why don't we have a candidate name-space, a separate library, like the contrib before, which most people who prefer to be on the cutting edge just include automatically. That would give reasonable feedback on how much traction new

Re: Proposed change to let- syntax

2013-07-19 Thread Jay Fields
I'm already using as- in prod. I think the ship has sailed on convincing Rich not to include them. On Fri, Jul 19, 2013 at 5:39 AM, Alex Baranosky alexander.barano...@gmail.com wrote: I use some- and cond- pretty heavily... I know I'm just one dude, but I am grateful they're in core so I

Re: Proposed change to let- syntax

2013-07-19 Thread Daniel Dinnyes
Yeah, seemingly I am still a newcomer here. As long as no one minds me coming up with great ideas, I don't mind looking stupid either... it will improve hopefully :) On Friday, July 19, 2013 9:38:48 AM UTC+1, Michał Marczyk wrote: On 19 July 2013 10:24, Daniel Dinnyes dinn...@gmail.com

Re: Proposed change to let- syntax

2012-12-02 Thread Terje Norderhaug
On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy a...@malloys.org wrote: The primary point of let- is that you can insert it into an existing - pipeline. (- foo (stuff) (blah) (let- foo-with-stuff (for [x foo-with-stuff] (inc x))) This use case of the macro now

Re: Proposed change to let- syntax

2012-12-02 Thread Terje Norderhaug
Here is the short form of the proposal below: 1. Make as- in Clojure 1.5 have a syntax and semantic matching how fn is used in pipelines. 2. Rename as- to fn- reflecting its similarity to fn. -- Terje Norderhaug On Sun, Dec 2, 2012 at 5:30 PM, Terje Norderhaug te...@in-progress.com wrote: On

Re: Proposed change to let- syntax

2012-12-01 Thread Steve Miner
gate- would work. Like guard- it doesn't have any connotations in the Clojure world, but it's learnable. I'll add one more: qual- ... short for qualified threading macro. Each clause is qualified by a test condition. Of course, there's always conde- to borrow from miniKanren and core.logic.

Re: Proposed change to let- syntax

2012-12-01 Thread Rich Hickey
On Nov 30, 2012, at 4:53 PM, Sean Corfield wrote: On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey richhic...@gmail.com wrote: A) let- becomes as- Fine with that. B) test- becomes cond- Fine with that (because I can't think of anything better). C) when- becomes some- and in doing

Re: Proposed change to let- syntax

2012-12-01 Thread Rich Hickey
I'll argue that if 'e' in conde is enough to imply 'each' then '-' in cond- is enough to imply it keeps threading. I think many people have ideas about - operators born of some of these libraries that supply a wealth of 'things you can use in -'. Most of their operators have '-' in their

Re: Proposed change to let- syntax

2012-12-01 Thread Andy Fingerhut
I don't have suggestions for the best names for these new things, but one good example in the doc string would go a long way to making it clearer what they *do* and how they are intended to be used. The doc strings are written once, but read thousands of times, and are your most reliable line

Re: Proposed change to let- syntax

2012-12-01 Thread Marek Šrank
+1 On Saturday, December 1, 2012 6:38:54 PM UTC+1, Andy Fingerhut wrote: I don't have suggestions for the best names for these new things, but one good example in the doc string would go a long way to making it clearer what they *do* and how they are intended to be used. The doc strings

Re: Proposed change to let- syntax

2012-12-01 Thread Sean Corfield
On Sat, Dec 1, 2012 at 6:33 AM, Rich Hickey richhic...@gmail.com wrote: Given that some- threads while non-nil but the fn some stops with the first logical true value, this seems counter-intuitive to me. when- seems better here, or while- perhaps? What other names were considered? when and

Re: Proposed change to let- syntax

2012-12-01 Thread Alex Baranosky
The more I watch this conversation, the more I like some- and cond-. What was the motivation for changing let- to as- ? let- made a lot of sense as a name to me. On Sat, Dec 1, 2012 at 6:48 AM, Rich Hickey richhic...@gmail.com wrote: I'll argue that if 'e' in conde is enough to imply 'each'

Re: Proposed change to let- syntax

2012-12-01 Thread Alex Baranosky
Nevermind that. The answer is that as- would reduce arg order and destructuring expectations. Makes sense. So for whatever small amount it is worth I officially have been convinced of all the new names. On Sat, Dec 1, 2012 at 12:08 PM, Alex Baranosky alexander.barano...@gmail.com wrote: The

Re: Proposed change to let- syntax

2012-11-30 Thread Rich Hickey
I'm not satisfied with the names for the new threading macros either. The new names being considered for let-, test- and when- are: A) let- becomes as- reduces arg order and destructuring expectations. B) test- becomes cond- cond- was the original name, and, protestations about not

Re: Proposed change to let- syntax

2012-11-30 Thread Jay Fields
On Fri, Nov 30, 2012 at 10:37 AM, Rich Hickey richhic...@gmail.com wrote: The new names being considered for let-, test- and when- are: A) let- becomes as- I prefer -as, but don't feel strongly about it. (- 1 str (-as one-str (count one-str) (* 2 one-str))) ;;

Re: Proposed change to let- syntax

2012-11-30 Thread Alex Baranosky
I've got a utility function I've been using called `conditionally-transform` which is a non-macro version of `test-`. I think both cond- and if- have a similar problem in that, if you already understand if/cond/- then it gives you little insight into how the new threading macro works. Both these

Re: Proposed change to let- syntax

2012-11-30 Thread Steve Miner
I propose guard- to avoid the cond- confusion. If we're voting, as- is good. I liked when-. On Nov 30, 2012, at 10:37 AM, Rich Hickey richhic...@gmail.com wrote: I'm not satisfied with the names for the new threading macros either. The new names being considered for let-, test- and when-

Re: Proposed change to let- syntax

2012-11-30 Thread Ben Wolfson
On Fri, Nov 30, 2012 at 10:15 AM, Alex Baranosky alexander.barano...@gmail.com wrote: I've got a utility function I've been using called `conditionally-transform` which is a non-macro version of `test-`. Likewise, except with use a HOF called conditionalize: (defn conditionalize When called

Re: Proposed change to let- syntax

2012-11-30 Thread Ben Wolfson
On Fri, Nov 30, 2012 at 10:15 AM, Alex Baranosky alexander.barano...@gmail.com wrote: I've got a utility function I've been using called `conditionally-transform` which is a non-macro version of `test-`. Likewise, except with use a HOF: (defn conditionalize [pred f] (fn [ args] (if (apply

Re: Proposed change to let- syntax

2012-11-30 Thread Rich Hickey
On Nov 30, 2012, at 1:15 PM, Alex Baranosky wrote: I've got a utility function I've been using called `conditionally-transform` which is a non-macro version of `test-`. I think both cond- and if- have a similar problem in that, if you already understand if/cond/- then it gives you little

Re: Proposed change to let- syntax

2012-11-30 Thread Rich Hickey
On Nov 30, 2012, at 1:49 PM, Steve Miner wrote: I propose guard- to avoid the cond- confusion. Yeah, that came up. Guards in other langs are short circuiting, just like cond. Another in that camp was gate- -- You received this message because you are subscribed to the Google Groups

Re: Proposed change to let- syntax

2012-11-30 Thread Sean Corfield
On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey richhic...@gmail.com wrote: A) let- becomes as- Fine with that. B) test- becomes cond- Fine with that (because I can't think of anything better). C) when- becomes some- and in doing so, tests for non-nil rather than truth. Given that

Re: Proposed change to let- syntax

2012-11-30 Thread Alex Baranosky
gate- is an interesting possiblity. On Fri, Nov 30, 2012 at 1:53 PM, Sean Corfield seancorfi...@gmail.comwrote: On Fri, Nov 30, 2012 at 7:37 AM, Rich Hickey richhic...@gmail.com wrote: A) let- becomes as- Fine with that. B) test- becomes cond- Fine with that (because I can't think of

Re: Proposed change to let- syntax

2012-11-16 Thread Alex Nixon
On 16 November 2012 01:25, Mark Engelberg mark.engelb...@gmail.com wrote: On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy a...@malloys.org wrote: The primary point of let- is that you can insert it into an existing - pipeline. That makes sense. It does - thanks for the clarification. So is

Re: Proposed change to let- syntax

2012-11-16 Thread Jay Fields
I think using 'let' is what makes this confusing. I'd like to have a macro/fn for both ideas being discussed in this thread, ideally they'd both be named in a way that causes the least amount of confusion. I'm not sure what those names are, perhaps (- 1 (inc) (rebind a-num (- 2 a-num)

Re: Proposed change to let- syntax

2012-11-16 Thread Jay Fields
another thought - a really nice thing about if, let, and if-let is that if you know how to use if and let, if-let just makes sense. You can't say the same about -, let, and let- with the current proposal. On Fri, Nov 16, 2012 at 7:32 AM, Alex Nixon a...@swiftkey.net wrote: On 16 November 2012

Re: Proposed change to let- syntax

2012-11-16 Thread László Török
+1, looking at the latest master, I think they need a better docstring, or rather an example of use that makes it easier to grasp. Regards, Laszlo 2012/11/16 Jay Fields j...@jayfields.com another thought - a really nice thing about if, let, and if-let is that if you know how to use if and

Proposed change to let- syntax

2012-11-15 Thread Alex Nixon
Hi all, I find the proposed function let- in Clojure 1.5 very useful, but a bit ugly. The arguments are backwards when compared to vanilla let, and it doesn't support destructuring where it easily could (which I believe would be helpful when threading 'state-like' maps, as I find let- very

Re: Proposed change to let- syntax

2012-11-15 Thread Mark Engelberg
Where did you find the proposal? I can't find any info about let- -- 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

Re: Proposed change to let- syntax

2012-11-15 Thread Andy Fingerhut
Check git commit logs from a month or so ago. Rich Hickey committed it. Andy Sent from my iPhone On Nov 15, 2012, at 2:41 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Where did you find the proposal? I can't find any info about let- -- You received this message because you are

Re: Proposed change to let- syntax

2012-11-15 Thread Alex Nixon
For reference, the current implementationhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6753 . On 15 November 2012 22:44, Andy Fingerhut andy.finger...@gmail.com wrote: Check git commit logs from a month or so ago. Rich Hickey committed it. Andy Sent from my

Re: Proposed change to let- syntax

2012-11-15 Thread Mark Engelberg
Thanks Alex. My two cents is that your syntax is more the way I'd expect it to look, starting off like an actual let with support for destructuring, followed by the forms. Only advantage I can think of for the one in core is that it enforces that you only have one binding. Basing let- off of

Re: Proposed change to let- syntax

2012-11-15 Thread Alex Nixon
Thanks for the comments. Regarding the bindings, I'd point out that if-let and when-let already work this way (enforcing one binding) and so it isn't introducing any inconsistency. On 15 November 2012 23:34, Mark Engelberg mark.engelb...@gmail.com wrote: Thanks Alex. My two cents is that

Re: Proposed change to let- syntax

2012-11-15 Thread Alan Malloy
The primary point of let- is that you can insert it into an existing - pipeline. (- foo (stuff) (blah) (let- foo-with-stuff (for [x foo-with-stuff] (inc x))) Your proposal breaks this. On Thursday, November 15, 2012 10:35:59 AM UTC-8, Alex Nixon wrote: Hi all, I

Re: Proposed change to let- syntax

2012-11-15 Thread Mark Engelberg
On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy a...@malloys.org wrote: The primary point of let- is that you can insert it into an existing - pipeline. That makes sense. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send