5, 2014 at 5:09 AM, Dan Cross wrote:
> On Saturday, October 17, 2009 11:42:28 PM UTC-4, mbrodersen wrote:
>
>> It would be great to have while-let in contrib. Then I don't have to
>> maintain let-while myself :-)
>
>
> I'm reviving this ancient thread because of co
On Saturday, October 17, 2009 11:42:28 PM UTC-4, mbrodersen wrote:
> It would be great to have while-let in contrib. Then I don't have to
> maintain let-while myself :-)
I'm reviving this ancient thread because of core.async. This seems like
just the thing for the common pa
It would be great to have while-let in contrib. Then I don't have to
maintain let-while myself :-)
Morten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send e
On Sat, Oct 17, 2009 at 2:27 PM, Christophe Grand wrote:
> (defmacro while-let
> "Makes it easy to continue processing an expression as long as it is true"
> [binding & forms]
> `(loop []
> (when-let ~binding
>~...@forms
>(recur
>
This does look like the best implemen
On Oct 18, 5:27 am, Christophe Grand wrote:
> (defmacro while-let
> "Makes it easy to continue processing an expression as long as it is true"
> [binding & forms]
> `(loop []
> (when-let ~binding
> �...@forms
> (recur
Nice! Would you be willing to add it to contrib? I
That's a nice improvement Christophe. Exactly the kind of answer I was
looking for.
Thanks!
Morten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googleg
Hi all,
On Sat, Oct 17, 2009 at 2:12 AM, John Harrop wrote:
> On Fri, Oct 16, 2009 at 7:58 PM, mbrodersen wrote:
>
>>
>> Hi,
>>
>> I am new to Clojure and I am wondering if there is anything similar to
>> the following macro already built in:
>>
>&
On Sat, Oct 17, 2009 at 3:32 AM, Timothy Pratley
wrote:
>
> > But name is multiply evaluated. This might be preferable:
>
> Hi John,
>
> Could you explain this a bit more for me? I can understand if the
> condition is duplicated that is unnecessary calculation but don't
> appreciate the issue with
> I don't think the multiple evaluation matters in this case, since it's
> the name parameter, which will in all sane cases be a simple symbol.
> gensyms are needed when multiple evaluation could cause side-effects
> or an expensive function to be computed multiple times, which is not
> the case h
On Oct 17, 10:32 am, Timothy Pratley wrote:
> > But name is multiply evaluated. This might be preferable:
>
> Hi John,
>
> Could you explain this a bit more for me? I can understand if the
> condition is duplicated that is unnecessary calculation but don't
> appreciate the issue with the binding
> But name is multiply evaluated. This might be preferable:
Hi John,
Could you explain this a bit more for me? I can understand if the
condition is duplicated that is unnecessary calculation but don't
appreciate the issue with the binding name... both versions of the
macro seem to expand to iden
I think I understand what you are trying to do John but it doesn't
have the same semantics though.
If you use the first definition, the following expression:
(let-while [x (if (> (rand) 0.2) "Yep!" nil)] (println x) (println
(str x
will work correctly (it will print &
On Fri, Oct 16, 2009 at 8:12 PM, John Harrop wrote:
> (defmacro let-while
> "Makes it easy to continue processing an expression as long as it
> is true"
> [[name expr] & forms]
> (let [n# ~name]
> `(loop []
>(let [~n# ~expr]
>
On Fri, Oct 16, 2009 at 7:58 PM, mbrodersen wrote:
>
> Hi,
>
> I am new to Clojure and I am wondering if there is anything similar to
> the following macro already built in:
>
> (defmacro let-while
>"Makes it easy to continue processing an expre
Hi,
I am new to Clojure and I am wondering if there is anything similar to
the following macro already built in:
(defmacro let-while
"Makes it easy to continue processing an expression as long as it is
true"
[[name expr] & forms]
`(loop []
15 matches
Mail list logo