Re: Datestreams

2011-11-01 Thread Baishampayan Ghose
On Wed, Nov 2, 2011 at 11:01 AM, Benny Tsai wrote: > Untested, since I don't have JodaTime installed, but something like this > maybe? > > (defn day-of-week-stream [& day-nums] >   (filter #((set day-nums) (.. % dayOfWeek get)) (today+all-future-dates))) This one is a good solution. No need to in

Re: Datestreams

2011-11-01 Thread Alex Baranosky
Thank you, gents. Both answers were simple and worked. I'm going with the interleave solution as it enables me to compose different streams I have without tweaking the implementations of each of them separately. Thanks again, Alex On Wed, Nov 2, 2011 at 1:31 AM, Benny Tsai wrote: > Untested, si

Re: ANN: core.logic 0.6.5 release

2011-11-01 Thread Ambrose Bonnaire-Sergeant
What happened to reify and inc? Ambrose On Wed, Nov 2, 2011 at 12:10 PM, David Nolen wrote: > Just cut a new release that hopefully makes playing with core.logic a lot > less tedious. > > From 0.6.4 to 0.6.5 > > > Enhancements > --- > * Consolidate all the useful name spaces into clojure.c

Re: Datestreams

2011-11-01 Thread Benny Tsai
Untested, since I don't have JodaTime installed, but something like this maybe? (defn day-of-week-stream [& day-nums] (filter #((set day-nums) (.. % dayOfWeek get)) (today+all-future-dates))) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Datestreams

2011-11-01 Thread Alex Baranosky
Could it be so simple?! Exciting. I'm going to have to try this out asap. On Wed, Nov 2, 2011 at 1:24 AM, Jonas wrote: > Hi > > Have you looked at the interleave function[1]? I'd guess that's the one > you want. > > /Jonas > > [1] > http://clojure.github.com/clojure/clojure.core-api.html#cloju

Re: Datestreams

2011-11-01 Thread Jonas
Hi Have you looked at the interleave function[1]? I'd guess that's the one you want. /Jonas [1] http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/interleave -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Datestreams

2011-11-01 Thread Alex Baranosky
I'm having trouble seeing how I should create a lazy sequence of all Mondays and Thursdays. Currenty I just generate two sequences, one of Mondays and one of Wednesdays, but this leaves me with a seq of seqs which is making future calculations on this sequence more complicated than I'd like. Belo

Re: Homoiconicity in clojure (macro power)

2011-11-01 Thread Alex Baranosky
Julian, I saw no flames fired from Craig - and I am particularly intrigued by non-Lisp languages such as Ioke that are homoiconic and have macros. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

form-zip

2011-11-01 Thread George Jahad
surely this one's been written before, but i needed it the other day and couldn't find it. form-zip returns a zipper from a clojure form. user=> (require '[clojure.zip :as zip]) user=> (use 'form-zip.core) user=> (-> '{1 2 3 4} form-zip zip/next zip/remove zip/root) {3 4} fz-node-seq returns a

ANN: core.logic 0.6.5 release

2011-11-01 Thread David Nolen
Just cut a new release that hopefully makes playing with core.logic a lot less tedious. >From 0.6.4 to 0.6.5 Enhancements --- * Consolidate all the useful name spaces into clojure.core.logic * We now only overload ==, no more need to exclude reify or inc You can use core.logic in your own p

Re: Homoiconicity in clojure (macro power)

2011-11-01 Thread Julian
Julian writes: >> I wonder what would be required for a modification to the clojure reader in >> order to do this... >No intention of picking on Julian, but do we really have to re-live all >of the flamewars and jawflapping of comp.lang.lisp on the clojure group >again? You're giving me flas

Re: update to clojure.tools.cli

2011-11-01 Thread Sean Corfield
On Tue, Nov 1, 2011 at 10:59 AM, gaz jones wrote: > The update is therefore going to break the existing API which you > obviously need to be aware of if you are currently using 0.1.0 and > intend to upgrade to 0.2.0. ... > Apologies for anyone upset by the timing / notification of the changes > --

Re: update to clojure.tools.cli

2011-11-01 Thread Sean Corfield
It's on Maven Central now... On Tue, Nov 1, 2011 at 11:59 AM, Aaron Bedra wrote: > It's strange that it hasn't made it to central yet. ... > On Tue, Nov 1, 2011 at 1:59 PM, gaz jones wrote: >> The release has been cut, but the last time I checked it still hadn't >> hit maven central, so this is

Re: Loop performance issue with variable

2011-11-01 Thread Sean Corfield
On Tue, Nov 1, 2011 at 4:29 AM, redraiment wrote: > user=> (def n 1) > #'user/n > user=> (time (loop [cnt 1 sum 0] (if (zero? cnt) sum (recur > (dec cnt) (+ sum cnt) > "Elapsed time: 605.564858 msecs" > 50005000 > user=> (time (loop [cnt n sum 0] (if (zero? cnt) sum (re

Re: Thoughts on a polyglot app server?

2011-11-01 Thread Peter Buckley
They announced it today: http://immutant.org/news/2011/11/01/announcing/ -Original Message- From: Jason Toy Sender: clojure@googlegroups.com Date: Tue, 1 Nov 2011 13:48:54 To: Clojure Reply-To: clojure@googlegroups.com Subject: Re: Thoughts on a polyglot app server? Any more plans or i

Re: Loop performance issue with variable

2011-11-01 Thread David Nolen
n is stored in a var and thus boxed. You can cast it to primitive long with (long n). On Tuesday, November 1, 2011, redraiment wrote: > Hi all, > > My environment is, Kubuntu 11.10, Clojure v1.3 and sun-java6-jdk. I > issued the following forms in REPL: > > user=> (def n 1) > #'user/n > u

Re: Homoiconicity in clojure (macro power)

2011-11-01 Thread Craig Brozefsky
Julian writes: > I wonder what would be required for a modification to the clojure reader in > order to do this... No intention of picking on Julian, but do we really have to re-live all of the flamewars and jawflapping of comp.lang.lisp on the clojure group again? You're giving me flashbacks 8

Re: Thoughts on a polyglot app server?

2011-11-01 Thread Jason Toy
Any more plans or ideas on this? On Sep 29, 1:48 pm, Jim wrote: > The TorqueBox[1] team is toying with the idea of exposing to Clojure > the abstractions we currently expose to Ruby. We're looking for > feedback from you guys to see what you use now to solve these > problems, what you'd like to s

ANN: metrics-clojure 0.1.0

2011-11-01 Thread Steve Losh
Last night I released an initial version of metrics-clojure, which is a thin Clojure wrapper around Coda Hale's awesome metrics[1] library: http://github.com/sjl/metrics-clojure http://bitbucket.org/sjl/metrics-clojure If you haven't seen Coda's talk about metrics it's worth the watch: http://pi

Loop performance issue with variable

2011-11-01 Thread redraiment
Hi all, My environment is, Kubuntu 11.10, Clojure v1.3 and sun-java6-jdk. I issued the following forms in REPL: user=> (def n 1) #'user/n user=> (time (loop [cnt 1 sum 0] (if (zero? cnt) sum (recur (dec cnt) (+ sum cnt) "Elapsed time: 605.564858 msecs" 50005000 user=>

Re: Lazy behavior

2011-11-01 Thread Ingo
The problem with the direct call of the readLine() method is that it might not work some day like it appears to work today. Specifically, the meaning of your program depends on: - evaluation order the compiler chooses - the fact that the compiler obviously does not do common subexpression

Re: Empty list type

2011-11-01 Thread Chouser
2011/11/1 Sebastián Galkin : > On Tuesday, November 1, 2011 9:33:31 PM UTC-2, David Nolen wrote: >> >> (isa? (type '(:foo :bar)) clojure.lang.IPersistentList) => true >> (isa? (type ()) clojure.lang.IPersistentList) => true >> (isa? (type (list)) clojure.lang.IPersistentList) => true > > oh that's

Re: Empty list type

2011-11-01 Thread Sebastián Galkin
On Tuesday, November 1, 2011 9:33:31 PM UTC-2, David Nolen wrote: > > (isa? (type '(:foo :bar)) clojure.lang.IPersistentList) => true > (isa? (type ()) clojure.lang.IPersistentList) => true > (isa? (type (list)) clojure.lang.IPersistentList) => true > oh that's right Thank you! -- You received t

Re: clojure.core/max and NaN

2011-11-01 Thread Alexander Taggart
See http://dev.clojure.org/jira/browse/CLJ-738 for clarity on this issue. -- 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

Re: Empty list type

2011-11-01 Thread Mark Rathwell
On Tue, Nov 1, 2011 at 7:33 PM, David Nolen wrote: > (isa? (type '(:foo :bar)) clojure.lang.IPersistentList) => true > (isa? (type ()) clojure.lang.IPersistentList) => true > (isa? (type (list)) clojure.lang.IPersistentList) => true > (type ()) ;=> clojure.lang.PersistentList$EmptyList EmptyLis

Re: Empty list type

2011-11-01 Thread David Nolen
(isa? (type '(:foo :bar)) clojure.lang.IPersistentList) => true (isa? (type ()) clojure.lang.IPersistentList) => true (isa? (type (list)) clojure.lang.IPersistentList) => true 2011/11/1 Sebastián Galkin > Can somebody explain the rationale behind this?: > > (isa? (type '(:foo :bar)) clojure.lang

Empty list type

2011-11-01 Thread Sebastián Galkin
Can somebody explain the rationale behind this?: (isa? (type '(:foo :bar)) clojure.lang.PersistentList) => true (isa? (type ()) clojure.lang.PersistentList) => false (isa? (type (list)) clojure.lang.PersistentList) => false -- You received this message because you are subscribed to the Goo

Re: with-redefs and inlined functions

2011-11-01 Thread Brian Marick
> On Nov 1, 2011, at 11:17 AM, Chas Emerick wrote: > >> FWIW, it doesn't look like `every?` has any inlining: Ah, I see what's actually going on. My mistake. It's good to hear about how to do the inline check. Thanks! - Brian Marick, Artisanal Labrador Now working at http://path11.com Cont

Re: Homoiconicity in clojure (macro power)

2011-11-01 Thread Julian
There are some examples of homoiconicity in other languages here: http://c2.com/cgi/wiki?HomoiconicExampleInManyProgrammingLanguages (being TCL, Joy and Io) Also worth noting is the recent work by Ola Bini on Ioke. Another interesting homoiconic language was Apple's Dylan language - which tran

Re: clojure.core/max and NaN

2011-11-01 Thread Ben Smith-Mannschott
On Tue, Nov 1, 2011 at 21:00, Michael wrote: > > > On Nov 1, 12:14 pm, Ben Smith-Mannschott > wrote: >> 3. Define that min and max will ignore any NaN arguments. > > What is: > > (min NaN NaN) > > in this situation;  ()? The part of the message you didn't quote implies that it would behave as (m

Re: Please announce release & breaking API changes of libraries hosted at github.com/clojure on this mailing list

2011-11-01 Thread Stuart Halloway
> Recently released clojure.tools.cli 0.2.0 has breaking API changes that, as > it turns out [1], were announced on the clojure-dev > mailing list but not here. While clojure-dev archives are indeed public, many > regular Clojure users are not aware of that mailing list and cannot join it > easil

Re: Await and thread blocking?

2011-11-01 Thread AndyK
Sometimes the obvious is too obvious - call timed-agent and then Thread/sleep while the timer of known duration runs. One further question however, is there any significant difference between calling the timed-agent worker function in send-off or in add-watch? For my needs, the task that runs does

Re: Await and thread blocking?

2011-11-01 Thread AndyK
After a bit more digging - Timer is a background thread so clearly that's not going to mesh well as a foreground blocking activity with agent (which is what I get for plugging along one path and trying to bring in another path without thinking things through). But the question remains - any ideas f

Await and thread blocking?

2011-11-01 Thread AndyK
I would like to block the thread until an agent has done its thing - in this case serving as a cap on a timer. I had thought that wrapping a call to the timed-agent function with await would do just that, but apparently not. At least in the repl, the function returns immediately and you can follow

2011 ClojureCLR survey responses summarized

2011-11-01 Thread dmiller
A summary of the responses to the recent ClojureCLR survey is available at http://clojureclr.blogspot.com/2011/11/results-of-2011-clojureclr-survey.html This is only a summary of the data. Editorializing, conclusion-izing and other opinion-izing will come later. -David -- You received this me

Re: Dynamic test creation?

2011-11-01 Thread AndyK
How would (run-tests 'my-namespace) know to run all those dynamic tests? I thought that it parsed the namespace for 'my-namespace when you call it. Or is it that the call to defcsvtests sets off a chain of macro resolutions before run-tests can even do its thing (so that it appears to run-tests lik

Re: clojure.core/max and NaN

2011-11-01 Thread Michael
On Nov 1, 12:14 pm, Ben Smith-Mannschott wrote: > 3. Define that min and max will ignore any NaN arguments. What is: (min NaN NaN) in this situation; ()? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: Please announce release & breaking API changes of libraries hosted at github.com/clojure on this mailing list

2011-11-01 Thread gaz jones
Just to clarify.. no I'm not. On Tue, Nov 1, 2011 at 2:52 PM, gaz jones wrote: > Hey dude, as I mentioned in the git link you pointed at there... > apologies for any confusion. The intent was always to make an > announcement WRT the breaking changes. I think you just caught me in > the middle of

Re: Please announce release & breaking API changes of libraries hosted at github.com/clojure on this mailing list

2011-11-01 Thread gaz jones
Hey dude, as I mentioned in the git link you pointed at there... apologies for any confusion. The intent was always to make an announcement WRT the breaking changes. I think you just caught me in the middle of the "merging the changes into master and getting a release cut" process. I am not making

Re: Please try the alphas and betas!

2011-11-01 Thread Aaron Bedra
I'm with Phil on this one. The alphas and betas are synced to maven central. You don't need any additional repositories in your project file. They are announced on the list when they are cut and always have a brief list of changes since the last release. They are easy to find if you follow this li

Re: shortcut for anonymous function literal and syntax quote

2011-11-01 Thread Joop Kiefte
In common lisp for fun I have replicated the #(+ 1 %) syntax without reader macros as (@ + 1 %), I could try to convert that to clojure to see if it suits you... Em terça-feira, 1 de novembro de 2011, Razvan Rotaru escreveu: > Yeah, you are probably right. But I figured asking never hurts... > Th

Re: shortcut for anonymous function literal and syntax quote

2011-11-01 Thread Razvan Rotaru
Yeah, you are probably right. But I figured asking never hurts... Thanks for the reply. Razvan On Oct 19, 10:50 pm, Alan Malloy wrote: > Not really. In _Let Over Lambda_'s section on reader macros, he > creates a reader macro #`(foo bar a1 a2) that expands to (lambda (a1 > a2) `(foo bar ,a1 ,a2)

Re: anyone interested in a small game?

2011-11-01 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i went a step further: since my asteroids are all immutable, they don't contain a renderer. the renderer would either require a reference to the asteroids data, position, size and so on - if that "changes" the renderer would be obsolete - or would req

Re: update to clojure.tools.cli

2011-11-01 Thread Aaron Bedra
It's strange that it hasn't made it to central yet. This is normally a few hours on the high end and it's been over 12 now. I double checked that the release hit sonatype https://oss.sonatype.org/content/repositories/public/org/clojure/tools.cli/0.2.0/ We might need to summon the all mighty Stua

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-01 Thread Matthew Boston
Fogus, could you give me rights to edit or just add me to these extras: ClojureScript, Clojure tooling, Heroku Drinkup, Overture, The web and Clojure. Thanks, Matthew Boston @bostonaholic On Oct 26, 7:48 pm, Michael Fogus wrote: > I've given edit rights to organizers and people on this thread,

update to clojure.tools.cli

2011-11-01 Thread gaz jones
Hi, I have made some changes to tools.cli to fix an annoying bug arround boolean flags and the inability to collect 'trailing arguments'. Whilst gathering opinions on these changes, a few other suggestions were made such as removing all magic functions and System/exit calls. The update is therefor

Re: clojure.core/max and NaN

2011-11-01 Thread Brian Hurt
On Tue, Nov 1, 2011 at 12:14 PM, Ben Smith-Mannschott wrote: > > 2 Make NaN contagious > - > > Define min and max to return NaN if and only if at least one of their > arguments is NaN. This seems most in keeping with the (admittedly > perverse) behavior of NaN as specified. >

Re: anyone interested in a small game?

2011-11-01 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 got icq/skype/jabber/anything else? Am 31.10.2011 10:37, schrieb Vikrant Behal: > Yes, I am interested. Wanna get some practical experience in > clojure. > > Cheers! Vikrant Behal +91 8884963403 > > P Please do not print this email unless it is abso

Please announce library releases on the main Clojure group

2011-11-01 Thread Rich Hickey
Are you a Clojure library developer? Did you just cut a release of some sort? Did you mention it on the main Clojure group (clojure@googlegroups.com)? If not, you made a mistake. The group remains a primary means of staying informed about Clojure for thousands of people. Please include it in a

Please announce release & breaking API changes of libraries hosted at github.com/clojure on this mailing list

2011-11-01 Thread Michael Klishin
Recently released clojure.tools.cli 0.2.0 has breaking API changes that, as it turns out [1], were announced on the clojure-dev mailing list but not here. While clojure-dev archives are indeed public, many regular Clojure users are not aware of that mailing list and cannot join it easily (my reques

Re: with-redefs and inlined functions

2011-11-01 Thread Chas Emerick
FWIW, it doesn't look like `every?` has any inlining: => (with-redefs [every? (constantly 5)] (every?)) 5 The metadata seems to confirm: => (meta #'every?) {:ns #, :name every?, :arglists ([pred coll]), :added "1.0", :static true, :doc "Returns true if (pred x) is logical true for every x

Re: clojure.core/max and NaN

2011-11-01 Thread Ben Smith-Mannschott
I've opened http://dev.clojure.org/jira/browse/CLJ-868 "The min and max functions in clojure.core behave unpredictably when one or more of their arguments is Float/NaN or Double/NaN. This is because the current implementation assumes that > provides a total ordering, but this is not the case when

with-redefs and inlined functions

2011-11-01 Thread Brian Marick
Clojure sometimes inlines functions. `every?` is an example. As a result, you can have a function that uses `every?`, call it like so: (with-redefs [every? (fn [& args] (println "Hi mom!") false)] (function-that-calls-every)) ... and not get the results that the text of the program calls for.

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-01 Thread Jim Oly
I am interested in the cKanren and go meetings, and I would be happy to add myself to them if given spreadsheet access. Jim On Oct 31, 6:36 am, Fogus wrote: > I've added everyone to this thread as an editor of the spreadsheet. > Please feel free to add yourself and your sessions at your leisure

Re: Lazy behavior

2011-11-01 Thread Nicolas
I have done futher experimentations and have found that, if I call directly readLine method, it work like a normal stream: (let [reader (java.io.BufferedReader. (java.io.FileReader. "liars.txt"))] [(.readLine reader) (.readLine reader) (.readLine reader) (.readLine reader)]) => ["5" "Stephen 1