Re: let-while

2014-03-05 Thread Dan Cross
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 pattern of looping over

Re: let-while

2014-03-05 Thread Dan Cross
(And for context, here is Christophe's 'while-let' from 2009): (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 On Wed, Mar 5, 2014 at 5:09 AM, Dan Cross wrot

Re: A faster clojure startup

2014-03-05 Thread Max Gonzih
This is brilliant amount of work! Looking forward to play with new patch on my ARM devices. On Friday, February 28, 2014 6:16:44 PM UTC+3, Gal Dolber wrote: > > Here're some notes on the lean compiler I've been working on for > clojure-objc > > http://galdolber.tumblr.com/post/78110050703/reduce

Re: How to replace code inside a macro

2014-03-05 Thread Konrad Hinsen
--On 4 Mar 2014 23:07:27 -0800 milinda wrote: I wanted macro to work like following. ( (let [x 10] (+ x (defpop This should generate function like (defn execute [tu3455] (let [x 10] (+ x tu3455))) Try this: (defmacro [body] `(macrolet [(~'defpop [] 'tu#)] (defn execute

Re: core.async pub/sub

2014-03-05 Thread Scott Johnson
not sure when then added this but it looks like pub and sub are in the async lib now. any differences between what they have now and what you need? looking for some examp

Re: paredit+regex question

2014-03-05 Thread Erlis Vidal
Hi all Thanks for all the replies. @Magnar: Thanks for the quick key combination I'll add that to my cheat sheet ;) @Phillip: Wow! I'm wondering why paredit doesn't fix this issue. Thanks for the patch! @Oleh: I will definitively will take a look at this, I'm starting with paredit and I'm liking

Solving allocation problems; code review and core.logic

2014-03-05 Thread Laurens Van Houtven
Hi! I've been experimenting solving some real-world problems related to organizing a sizable (2000-3000 people) programming conference with a strong open source flavor. My next problem is a bit more daunting. This conference has a financial aid program. People who can not afford to come to the

Re: Solving allocation problems; code review and core.logic

2014-03-05 Thread David Nolen
I'm cross posting this to the miniKanren mailing list. It sounds like core.logic or cKanren could be applied to your problem but would need more details. I also wouldn't rule out finite domain solvers like JaCoP. David On Wed, Mar 5, 2014 at 9:52 AM, Laurens Van Houtven <_...@lvh.cc> wrote: >

Re: paredit+regex question

2014-03-05 Thread Phillip Lord
Erlis Vidal writes: > @Phillip: Wow! I'm wondering why paredit doesn't fix this issue. Thanks for > the patch! Because this syntax is specific to clojure and not all lisps! Hopefully, I'll get around to submitting a patch to paredit at some point. If not me, I am sure someone will do it! Phil

fn and let are special forms or macros?

2014-03-05 Thread Plínio Balduino
Hi there Clojure.org says fn and let are special forms, but using the macro sourceshows that both are macros calling fn* and let* respectivelly. So fn and let are "special special forms", or clojure.org is incorrect/outdated? If fn and let are really special forms and not macros, could you expla

Re: fn and let are special forms or macros?

2014-03-05 Thread Tassilo Horn
Plínio Balduino writes: Hi Plínio, > Clojure.org says fn and let are special forms, but using the macro > sourceshows that both are macros calling fn* and let* respectivelly. > > So fn and let are "special special forms", or clojure.org is > incorrect/outdated? Well, they are correct from a use

Re: [ANN] Clojure 1.6.0-beta2

2014-03-05 Thread Alex Miller
I have not heard of any regressions or other critical issues with beta2. If you know of anything, please let me know asap - we plan to release RC1 soon. Alex On Thursday, February 27, 2014 4:39:28 PM UTC-6, Alex Miller wrote: > > That first line should be 1.6.0-beta2 of course. :) > > On Thurs

Re: Accumulate results without state?

2014-03-05 Thread Dean Laskin
I rewrote it using reduce as Jarrod suggested. It looks good to my newbie eyes now, but I'm interested in any other feedback. (defn failures [file] (with-open [rdr (clojure.java.io/reader file)] (reduce (fn [accu input] (if (re-matches #"^[^,]+,[^,]+,FAIL,.*$" input)

Re: [ANN] Clojure 1.6.0-beta2

2014-03-05 Thread Sean Corfield
We've been running our (World Singles) test suite against 1.6.0-master-SNAPSHOT for some time as a matter of course and haven't tripped over anything so far (that I can recall). The only change in our bugbase due to 1.6.0 was the earlier change to disallow keyword literals that start with a digi

Re: How to replace code inside a macro

2014-03-05 Thread milinda
Thanks Konrad. Your unquoting trick worked. But I am not exactly sure how to reason about these types of situations. Can you please shed some lights behind the logic of above unquoting if possible. Thanks Milinda On Wednesday, March 5, 2014 8:33:03 AM UTC-5, Konrad Hinsen wrote: > > --On 4 Mar

Re: [ANN] Clojure 1.6.0-beta2

2014-03-05 Thread Michael Klishin
2014-03-05 21:47 GMT+04:00 Sean Corfield : > We've been running our (World Singles) test suite against > 1.6.0-master-SNAPSHOT for some time as a matter of course and haven't > tripped over anything so far (that I can recall). The only change in our > bugbase due to 1.6.0 was the earlier change to

[ANN] PigPen 0.2.0

2014-03-05 Thread Matt Bossenbroek
Announcing PigPen 0.2.0! https://github.com/Netflix/PigPen PigPen is map-reduce for Clojure, or distributed Clojure. Write idiomatic Clojure code and run it on thousands of machines. New in 0.2.0: * Brand new wiki: https://github.com/Netflix/PigPen/wiki * Performance improvements! * Fold: ht

Re: finding value nearest x

2014-03-05 Thread Yehonathan Sharvit
In the sorted-set solution, you forgot to handle the case where all the values in the sorted-set are greater than 136... On Saturday, 25 September 2010 17:55:33 UTC+2, Chouser wrote: > > On Sat, Sep 25, 2010 at 10:44 AM, Nicolas Oury > > > wrote: > > On Sat, Sep 25, 2010 at 3:40 PM, Jules > >

Re: [GSoC]: How to participate

2014-03-05 Thread cej38
Any of these projects would be a welcome addition to the Clojure world, but I personally hope that the Linear Algebra project is worked on and that it uses NDArray from last year as the starting point. Congratulations on being picked as a host community again. I am excited to see what comes ou

Any Previous Work on Javadoc to Docstring Conversion?

2014-03-05 Thread ian.tegebo
I'm interested in converting javadoc to docstrings in cases like "amazonica" where clojure code is created by reflecting on java classes. Unless I missed something, the status quo has us referring to the original Javadoc via web browser. One then needs to understand enough of the conversion t

Re: Solving allocation problems; code review and core.logic

2014-03-05 Thread Alex Engelberg
I released a library yesterday called Loco, which might be what you're looking for. (David mentioned JaCoP, which is very similar to the Java library that Loco runs on.) You might also want to check out this blog post

Re: Clojure performance question

2014-03-05 Thread Jarrod Swart
Thanks for the elaboration, I just wanted to make sure I understood. -- 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: Solving allocation problems; code review and core.logic

2014-03-05 Thread Laurens Van Houtven
Hi David and Alex, Thanks for your replies! I'm having trouble communicating it, and the underspecifiedness doesn't help. Perhaps that just means I don't really understand the problem. Please let me know if any particular parts are hazy. What we *really* care about is getting people to the confe

1.6.0-beta2 / sumatra / graal / okra / hsa / gpgpu

2014-03-05 Thread Jules
Guys, I had to try building and running the Sumatra/Java8 stack - this claims to be able to JIT Java8 closures into HSAIL (from memory: Heterogeneous Architecture Independent Language), which can then either be run on an HSAIL emulator (in this case Okra) or, if you have HSA enabled h/w (which

Re: Solving allocation problems; code review and core.logic

2014-03-05 Thread Jordan Berg
Sounds like you might be able to model it as a knapsack problem with budgets as weights and scores as values. For a little intuition into what will happen, consider a greedy algorithm to solve the knapsack. Assuming that the individual budgets are relatively small compared to the total budget the

Re: Solving allocation problems; code review and core.logic

2014-03-05 Thread Mark Engelberg
The potential problem with modeling it as a knapsack problem is that it assumes that grant-giving is an all-or-nothing affair. Another reasonable way to model it is to assume that if I'm given, say $80 out of $100 requested, then I have an 80% chance of going. With such a model, let's say I have

Re: Solving allocation problems; code review and core.logic

2014-03-05 Thread Mark Engelberg
Overall, though, I agree with Jordan's point. You don't really need any sophisticated constraint solving to solve the problem as you've described it -- the greedy approach works fine in this context. Simply sort all the applicants in descending order by score divided by amount of money requested,

Re: How to replace code inside a macro

2014-03-05 Thread curiousGuy
Milinda if you are asking about the ~' that simply allows you to quote a symbol without the namespace resolution that a backquote ` provides. If you are trying to capture a local lexical value or otherwise do not want the full namespace resolved for the symbol, then you must use an ordinary quot

[ANN] New Caribou Release: Version 0.14.0

2014-03-05 Thread Ryan Spangler
Hello Clojure People, Happy to announce the release of a new version of Caribou! http://let-caribou.in/ There are a lot of improvements in this latest release. We have tried to incorporate all of the feedback we have received since its initial release (which has been massive!). A small sele

Re: Clojure on top of ObjC?

2014-03-05 Thread D. Theisen
Hey, Nathan! Am Montag, 6. Mai 2013 07:15:34 UTC+2 schrieb Nathan Sorenson: > > > On Tuesday, 23 April 2013 13:37:59 UTC-7, Steven Degutis wrote: >> >> While this is certainly neat, it doesn't allow Clojure to be used as >> an embedded scripting language inside an ObjC app. >> > > Since the Cloj

Re: Any Previous Work on Javadoc to Docstring Conversion?

2014-03-05 Thread Tobias Kortkamp
I have just uploaded some code I wrote earlier this year, where I originally set out to generate some useful docstrings for Java classes and methods. It currently uses javadoc on all Java source files on the classpath and creates a map with the extracted information. I never finished it, but thi

Re: How to replace code inside a macro

2014-03-05 Thread Leif
Hi, Milinda. I'll try to explain my reasoning of the situation. I always find it helpful to macroexpand if I'm having trouble: ;; original version user=> (macroexpand-1 '( boby)) (clojure.tools.macro/macrolet [(defpop [] tu1282)] ;; <- undef. lookup (clojure.core/defn user/execute [tu12