On 21/06/13 15:06, Andy Fingerhut wrote:
Colin showed pretty clearly in his email that he was using lein
uberjar followed by running the JVM explicitly with his own command
line, so Leiningen has no way to affect the JVM command line options
in that case.
oops! I thought Michael meant the
it but it is
certainly nasty code!
Also note that if I move the body out of the 'let' version of the array
into another function passing in the array then the performance is the same
as the 'def' version, so even if def is a problem it isn't the only cause.
using 'let' or passing the array as parameter
It is not broken. It fulfills the discussed goal of having independent
parallel calls in a let-like macro. Thus the name plet.
Using a previous binding in another binding of plet was no goal. Therefore
you can use the normal let macro.
In a library one should add the intention to use it only
here would be
in the style of a let form:
(let [result-1 (api/api-call-1)
result-2 (api/api-call-2)
result-3 (api/api-call-3)]
(views/some-view result-1 result-2 result-3)
There doesn't appear to be anything in core that does, this - after a brief
discussion in the IRC channel, I
guv is broken if your let form introduces bindings that depend on earlier
bindings:
user= (plet [a 2 b a] b)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: a
in this context, compiling:(NO_SOURCE_PATH:1)
user= (clojure.pprint/pprint (macroexpand-1 '(plet [a 2 b a] b
and refers to the
earlier binding, and the two expressions can't be evaluated in parallel.
On Sat, Apr 27, 2013 at 8:59 AM, Ben Wolfson wolf...@gmail.com wrote:
guv is broken if your let form introduces bindings that depend on
earlier bindings:
user= (plet [a 2 b a] b)
CompilerException
, and the two expressions can't be evaluated in parallel.
On Sat, Apr 27, 2013 at 8:59 AM, Ben Wolfson wolf...@gmail.com wrote:
guv is broken if your let form introduces bindings that depend on
earlier bindings:
user= (plet [a 2 b a] b)
CompilerException java.lang.RuntimeException: Unable
That library and others like it (e.g., oh, I dunno, babbage) impose more
overhead, though, than a simple let form, if you just want to use something
one-off in one place.
On Sat, Apr 27, 2013 at 5:05 PM, Alan Busby thebu...@thebusby.com wrote:
Hi All,
You may want to take a look
On 24/03/13 03:00, Stephen Compall wrote:
This expression should evaluate to 12.
Nice catch! This one does :)
(defmacro let-timed
[bindings body]
(let [parts (partition 2 bindings)
names (map first parts)
results (map #(list 'clojure.core/time (second %)) parts
Can anyone see anything wrong with this little macro? It comes pretty
handy to me when I want to time each an every expression in a let
statement...
(defmacro let-timed
[bindings code]
(let [parts(partition 2 bindings)
names (map first parts)
results (map #(list
On Saturday, March 23, 2013 2:09:02 PM UTC+1, Jim foo.bar wrote:
(defmacro let-timed
[bindings code]
I would write that as [bindings body] which is also recommended by
http://dev.clojure.org/display/design/Library+Coding+Standards
(let [parts(partition 2 bindings
On Sat, 2013-03-23 at 13:09 +, Jim - FooBar(); wrote:
results (map #(list 'time (second %)) parts)] ;;don't time at
compile-time, just build the timing expression for later use
(let [time 4]
(let-timed [what 8]
(+ time what)))
This expression should evaluate to 12
*excuse me, when I read the storm src,I catch some code as follows*
*
*
*(let [{:keys [root watcher auth-conf], :or {auth-conf auth-conf, root
root, watcher watcher}} {:auth-conf a, :watcher bbb}]*
*(println auth-conf)(println root)(println watcher)*
*)*
*
*
*I don't know what's
This the syntax for map destructuring. Works on function argument vector
and let bindings.
You'll find multiple online resources that explain this clearly.
Sent from phone. Please excuse brevity.
On 14 Mar 2013 21:07, zlj844...@gmail.com wrote:
*excuse me, when I read the storm src,I catch
Hi,
The when-let macro is great, but it accepts only one binding. Why? Are
there any reason why this macro was not ever extended to support multiple
bindings (defined, for example,
here: http://inclojurewetrust.blogspot.ru/2010/12/when-let-maybe.html)?
(when-let* [x (something
In the short time I've been active in the list, I've seen this topic come
up a couple of times, and they both have come up really close to each other
also, there's been one in December
https://groups.google.com/forum/?fromgroups=#!searchin/clojure/let-else/clojure/1g5dEvIvGYY/EWjwFGnS-rYJand
-let* (with your
preferred semantics) can be defined in terms of existing constructs.
It doesn't need to be primitive the way fn* is.
--
Ben Wolfson
Human kind has used its intelligence to vary the flavour of drinks,
which may be sweet, aromatic, fermented or spirit-based. ... Family
and social
vary-meta slipped my mind! I've updated the gist to include it. The reason
I check for IObj and IMeta is that I want symbols and other custom deftypes
to recieve the metadata as well.
I thought about namespacing the let-names, but for my current purposes I
don't need that extra data (although
On Sat, Feb 9, 2013 at 4:20 PM, vemv v...@vemv.net wrote:
Then library consumers can specify either [com.example/awesomelib 1.4.0],
[com.example 1.4.0-DEBUG], or [com.example 1.4.0-NO-DEBUG] in their
:dependencies vector, in the corresponding project.clj.
If no version directive is specified,
this into the util.clj in my project that needs this most,
to good effect.
David
On Friday, February 8, 2013 12:18:54 PM UTC-5, vemv wrote:
Given that: a) fns can have names for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach
, it might interest you performing the tagging tree-recursively (e.g.
in (let x [[][][]]) the four colls would get tagged), and with namespaced
names.
More importantly, how are you using this? One thing I haven't thought about
yet is how to map the tags to stack traces.
--
--
You received
+1 on this line of thought. We are definitely interested in decomplecting
dev mode utility from production lean-and-meanness.
One question along this path is What options exist in Java/maven land for
doing multiple releases of the same artifact with e.g. different
performance and debugging
Going the build route, probably use maven to produce debug and production
artifacts of differing versions: blah-1.0.0-DEBUG.jar and blah-1.0.0.jar.
Rather than go that route and the ensuing naming convention madness, I
wonder how much we could rely on the JIT to push the decision of debug vs
: the
NO-DEBUG versions would simply set certain vars to false. For example,
for the idea I'm proposing there would be *tagging-let*, which defaulted to
true.
Would this adress the Android story as well?
--
--
You received this message because you are subscribed to the Google
Groups Clojure group
there would be *tagging-let*, which defaulted
to true.
Would this adress the Android story as well?
--
--
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
:18:54 PM UTC+1, vemv wrote:
Given that: a) fns can have names for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach (where possible) the names of the bindings to their corresponding
values?
For example, the improved let I'm
purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach (where possible) the names of the bindings to their corresponding
values?
For example, the improved let I'm thinking of would translate this input:
(ns my.namespace)
(defn do-it
(let
in profiles.clj: {:user {:debug-dependencies
false}}
Does it sound good enough?
On Friday, February 8, 2013 6:18:54 PM UTC+1, vemv wrote:
Given that: a) fns can have names for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let letauto
attach
Given that: a) fns can have names for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach (where possible) the names of the bindings to their corresponding
values?
For example, the improved let I'm thinking of would translate
for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach (where possible) the names of the bindings to their corresponding
values?
For example, the improved let I'm thinking of would translate this input:
(ns my.namespace)
(defn do
2013/2/8 vemv v...@vemv.net
Do you see such a mechanism being incorporated to clojure.core/let -
should I open a ticket?
Only for debugging and not before it has a proven implementation. For
production, we actually want less metadata. At least in memory constrained
environments like android
10:18:54 AM UTC-7, vemv wrote:
Given that: a) fns can have names for debugging purposes, and b) data
structures can have metadata, wouldn't it be a good idea to let let auto
attach (where possible) the names of the bindings to their corresponding
values?
For example, the improved let I'm
On Feb 8, 2013, at 7:56 PM, Daniel Glauser danglau...@gmail.com wrote:
This sounds like a great idea. I was working with some tests today and it
would have been really useful to have some way to query the current
function/execution context. Seems like passing that through all lets would
The docs are clear that the test occurs before the bindings:
(doc if-let)
-
clojure.core/if-let
([bindings then] [bindings then else oldform])
Macro
bindings = binding-form test
If test is true, evaluates then with binding-form bound to the value of
test
Hi all,
I'm a little bit confused about the semantic of if-let macro.
Suppose to call it as follows with map destructoring:
(if-let [{key1 :key1} {:key2 a string}]
true
false))
It returns true.
But,
(let [{key1 :key1} {:key2 a string}]
(if key1
true
false
From the expansion we can see that if-let determine the result based on
the second param, in your case: {:key2 a string}, not the local binding
you assumed(key1), and
I think it is reasonable, for example, if we have the following code:
(if-let [{key1 key2} {:key2 a string}]
true
false
Uhm, I do not agree.
Suppose tha you have a function returning a map of errors (a valip validator
lib real case) like the following
{:email [Email can't be empty] :password [Password can't be empty]}
If I want to select just the email errors I would write something like that
(if-let [{errors
ah, compare
(if-let [{errors :email} (function-returning-error email password)]
true
false)
with
(let [{errors :email) (function-returning-errros email password)]
(if errors
true
false))
I'm not saying that if-let is wrong, I'm saying I would never use
Agree with you that it is very misleading when using map-destructure in
if-let, the same applies to sequential-destructure:
user= (if-let [[_ x] [1 nil]] true false)
true
On 13-1-30 下午5:23, Mimmo Cosenza mimmo.cose...@gmail.com wrote:
Uhm, I do not agree.
Suppose tha you have a function
that means never use if-let with sequential destructoring, which brings me to
say: never use if-let, because I don't' like to remember such thing while
coding and then become crazy to catch my error because of a misleading language
feature.
mimmo
On Jan 30, 2013, at 10:32 AM, James Xu
I find it helpful to view if-let as a minor variation on if, with the only
difference being that you choose to bind the results of the test-expression
to some name(s). if-let doesn't care about the values bound to the
variables named in binding-target (which might be an arbitrarily complex
If-let does the right thing. What would your intuition expect for
(if-let [{a :a b :b} {:a 1 :b nil}]
true
false)
For your particular use-case, what you want is more along the lines of
(if-let [errors (:password (fn-returning-errors))]
...)
On Wednesday, January 30, 2013, Ben Smith
Perhaps I've been a little bit rude with if-let, but I really do not see how
(if-let [{erros :email} (function-returning-errors email password)]
true
false)
is not misleading. I now that the tested value is the one returning from the
function call and not the value assigned
Interesting to see this interpretation of if-let... I'd always read it
as if the condition is truthy then let the binding be the condition
and evaluate the first expression else just evaluate the second
expression. Since the binding could create multiple named values (in
general), I'm not sure how
On Wednesday, January 30, 2013 8:51:47 PM UTC+1, Gary Verhaegen wrote:
For your particular use-case, what you want is more along the lines of
(if-let [errors (:password (fn-returning-errors))]
...)
yes, precisely!
mimmo
--
--
You received this message because you are subscribed
On Thursday, January 31, 2013 1:49:40 AM UTC+1, Sean Corfield wrote:
but now that you've posted this, I
can see some potential for confusion when folks first encounter
if-let... Presumably the same confusion could arise for when-let?
yes, this is the confusion that you can incur
for responding is to let you know that if you really want such
behavior, macros let you roll your own without much trouble.
Andy
On Jan 3, 2013, at 10:24 PM, Edward Tsech wrote:
Hey guys,
if-let and when-let macros support only 2 forms in binding vector:
(if-let [x 1 y 2
Sorry guys, I forget to mention that it should behave like let in Clojure
or like let* in Scheme.
I mean e.g.:
(if-let* [x 1 y nil z (inc y)]
(+ x y z)
0) ; = 0
;; (inc y) shouldn't be evaluated here.
Which means and doesn't work there.
In terms of implementation I mean smth like
I don't know if it will answer your history question, but there was a
fairly long discussion about this last year:
https://groups.google.com/forum/?fromgroups=#!searchin/clojure/let-else/clojure/1g5dEvIvGYY/EWjwFGnS-rYJ
Cheers,
Dave
On Fri, Jan 4, 2013 at 7:23 AM, Edward Tsech edts
/?fromgroups=#!searchin/clojure/let-else/clojure/1g5dEvIvGYY/EWjwFGnS-rYJ
Cheers,
Dave
On Fri, Jan 4, 2013 at 7:23 AM, Edward Tsech edt...@gmail.comjavascript:
wrote:
Sorry guys, I forget to mention that it should behave like let in
Clojure
or like let* in Scheme.
I mean e.g
On Thu, Jan 03, 2013 at 11:14:30PM -0800, Evan Mezeske wrote:
Wouldn't it be more accurately named if-and-let if it supported that? E.g.
(if (and x y z) ...).
I can see regular if-let being useful with more than one form, just
using the last value for the conditional.
(if-let [a expr, b
On Fri, Jan 04, 2013 at 08:58:40AM +0100, Tassilo Horn wrote:
At least in my experience, it usually matters a lot which form actually
evaluated to nil. But it's easy to write a macro `if-let-all' or so,
which would expand into
(let [x 1 y nil z 3]
(if (and x y z)
(+ x y z)
0
bindings in when-let/if-let and about the behavior. Nearly everyone agreed
it was obvious that as soon as you hit a variable that is bound to nil, you
bail out of the expression, short-circuiting further evaluations and
returning nil (for when-let) or the else clause (for if-let).
There were a few
indentation due to if-let-if combinations.
This wouldn't be such a limitation if you could use anonymous functions
among the chained functions (since then you could set up a function with
the hole anywhere you want), but this doesn't work.
I do this regurarly:
(- x (fun1 arg1) (#(fun2 arg2
that there
was actually very broad consensus about the desirability of multiple
bindings in when-let/if-let and about the behavior. Nearly everyone agreed
it was obvious that as soon as you hit a variable that is bound to nil, you
bail out of the expression, short-circuiting further evaluations
weird. I would absolutely want if-let to use (and ..) on my bindings.
All bindings in then clause, no bindings in else clause. Inside
the bindings vector -- as in a regular let, that is, each init
expression sees the bindings established earlier.
Note that if-let -- as it currently stands, I mean
On Fri, Jan 4, 2013 at 11:59 AM, Marko Topolnik marko.topol...@gmail.comwrote:
I do this regurarly:
(- x (fun1 arg1) (#(fun2 arg2 %)) ...)
It works, but I still don't like it, I find that extra hash and parens
distasteful.
Thanks for that idea. Don't know why I never thought to do that.
On Fri, Jan 4, 2013 at 2:35 PM, Michał Marczyk michal.marc...@gmail.comwrote:
Note that if-let -- as it currently stands, I mean -- doesn't make the
binding available to the else branch (so there's no way of telling
if the init expression turned out to be false or nil). The above would
Hey guys,
if-let and when-let macros support only 2 forms in binding vector:
(if-let [x 1 y 2]
...)
java.lang.IllegalArgumentExcepdtion: if-let requires exactly 2 forms in
binding vector(NO_SOURCE_FILE:1)
Why doesn't if-let support any even amount of binding forms as let does?
e.g.
(if-let
Wouldn't it be more accurately named if-and-let if it supported that?
E.g. (if (and x y z) ...).
On Thursday, January 3, 2013 10:24:57 PM UTC-8, Edward Tsech wrote:
Hey guys,
if-let and when-let macros support only 2 forms in binding vector:
(if-let [x 1 y 2
Edward Tsech edts...@gmail.com writes:
java.lang.IllegalArgumentExcepdtion: if-let requires exactly 2 forms
in binding vector(NO_SOURCE_FILE:1)
Why doesn't if-let support any even amount of binding forms as let
does?
e.g.
(if-let [x 1 y 2 z 3]
(+ x y z)
0) ; = 6
(if-let [x 1 y nil
]
3 (let
4 [abs
5(fn [n
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
:
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 renamed
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.
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
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
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
+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
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
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
:
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
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 short
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
...@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))) ;; returns 2
The thing that I like about
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
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
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
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
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
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
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
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
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
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 01
+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
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
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
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
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 subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
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
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
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
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
You could also let every function take a map as input/output.
Then, b could return a map with key :result-b or similar.
This result would then pass through the rest of the functions and be
accessible in e.
Like this:
a ; = {:result-a ...}
b ; = {:result-b ... :result-a ...}
...
d ; = {... :result
Appreciate everyone's responses! I'll certainly check out the let- option.
jason
On Friday, October 26, 2012 6:16:28 AM UTC-7, Jonathan Fischer Friberg
wrote:
You could also let every function take a map as input/output.
Then, b could return a map with key :result-b or similar.
This result
a let into the middle
of the thread calls without making a large mess? The only suggestion I've
gotten so far is to move calls A and B into a let before the thread-first
so I can process their return values.
jason
--
You received this message because you are subscribed to the Google
Groups
a
b
c
d
e)
And let's say that I need to process and save the result of function b as
a second parameter to function e (function b returns a file, and function e
needs the extention of that file). How would I drop a let into the middle
of the thread calls without making
let- seems to rebind the same name repeatedly, so that probably wouldn't help.
You could easily create a macro that bound a new name if it encounters
a literal vector in the arguments and evaluated the remaining forms in
the context of those bindings:
(somevariantof- url
a
[file b]
c
the extention of that file). How would I drop a let
into the middle of the thread calls without making a large mess? The
only suggestion I've gotten so far is to move calls A and B into a let
before the thread-first so I can process their return values.
jason
Pallet's thread-exp library has a let
201 - 300 of 669 matches
Mail list logo