1 Nov 2009 01:24
1 Nov 2009 01:33
Re: Infinite sequences hang sets and maps
Alex Osborne <ato <at> meshy.org>
2009-11-01 00:33:15 GMT
2009-11-01 00:33:15 GMT
Luke VanderHart wrote: > On Oct 29, 4:01 am, Mark Engelberg <mark.engelb... <at> gmail.com> wrote: >> I see your point that hashCode could be made to work on infinite >> sequences, but since hashing is almost always a prelude to testing for >> equality, I'm hard pressed to think of an example of why you'd want to >> be able to do this. Can you illustrate with an example? > Wouldn't hashCode be called every time you use an infinite sequence as > a key in a hash map? Yes, but this is another case where hashing is a prelude for testing equality. If there's a hash collision then the map will have to use equality testing to distinguish between two keys. If you make hashCode always work on infinite sequences, then sometimes using them as keys in maps will work and other times -- seemingly randomly -- it won't. In my opinion this is much worse than them never working as map keys. > That strikes me as a problem, since everything else in Clojure makes > perfectly good map keys. "Everything else" in Clojure is also printable and equality testable in finite time. There's just some things you can't do reliably with infinite sequences.
1 Nov 2009 03:57
Re: Compiling latest ClojureCLR
dmiller <dmiller2718 <at> gmail.com>
2009-11-01 02:57:56 GMT
2009-11-01 02:57:56 GMT
The latest commit allows ClojureCLR to run against the most recent commit of the DLR. >> The more final solution will be an installer that takes care of all of >> this. > > That sounds interesting. Any plans for clojure.contrib? I'd be really > interested in helping where I can, and porting clojure code to .NET is > something I can do. I'm aware of the fact that Clojure core isn't > ported completely yet, but I think work can proceed in parallel on > core and contrib. Some device to avoid duplicate work on porting > clojure.contrib would be nice. I'm hoping someone will step up on writing an installer. The only major piece of the core not completed is genclass. The main items on the agenda at the moment: 1) Finish BigDecimal to remove vjslib dependency (should be done in a few more days). 2) Implementing genclass 3) Creating an installer 4) Converting clojure.contrib Item (3) can be done by anyone with appropriate .Net skills. Item (4) requires Clojure app programmer knowledge more than Clojure internals knowledge.(Continue reading)
1 Nov 2009 07:15
Re: pointfree library
harrison clarke <notallama <at> gmail.com>
2009-11-01 06:15:55 GMT
2009-11-01 06:15:55 GMT
i have updated the library to use arrows, rather than just functions. (it still works with functions) to make a new kind of arrow, you need to implement: arr (creates an arrow from a function) >>> (combines arrows left to right) fst (makes arrow work on the first element of a vector, leaving the other elements alone) ttt (arrow works on second element of a vector if the first element is true) the other arrow combinators use those, so they don't need to be reimplemented for every kind of arrow. http://github.com/hclarke/pointfree-clojure
1 Nov 2009 08:57
Re: ClojureCLR - clojure.contrib.repl-utils
Miron Brezuleanu <mbrezu <at> gmail.com>
2009-11-01 07:57:12 GMT
2009-11-01 07:57:12 GMT
Hello, On Sat, Oct 31, 2009 at 11:57 PM, dmiller <dmiller2718 <at> gmail.com> wrote: > There is very little progress on clojure-clr.contrib. The process is > not that hard, just tedious. I can give hints to anyone who wants to > work on it. I plan to work on it next after finishing BigDecimal. Great. I'll try to get some work done on repl-utils. > I do see the issues tab on the github site. However, I've got > contributor status on that, so I may see things other don't. I don't > have admin capabilities on that site, so I can't enable it. That > would be up to Rich. > > I hope you can at least see the wiki tab. The issues tab is obviously right where it should be. I think I was looking at another repository when writing that email(Continue reading)> Regarding this specific issue, (apply (fn [] 1)) doesn't work in > ClojureJVM either, at least not the build I have. > > user=> (apply (fn [] 1)) > java.lang.IllegalArgumentException: Wrong number of args passed to: > core$apply (NO_SOURCE_FILE:0) Correct. My Clojure JVM version was a little (too) old, and ClojureCLR was fresh out of GitHub
![]()
1 Nov 2009 10:30
update-proxy doc - what is "this" ?
msappler <msappler <at> web.de>
2009-11-01 09:30:57 GMT
2009-11-01 09:30:57 GMT
user=> (doc update-proxy) ------------------------- clojure.core/update-proxy ([proxy mappings]) Takes a proxy instance and a map of strings (which must correspond to methods of the proxy superclass/superinterfaces) to fns (which must take arguments matching the corresponding method, plus an additional (explicit) first arg corresponding to this, and updates (via assoc) the proxy's fn map. nil can be passed instead of a fn, in which case the corresponding method will revert to the default behavior. Note that this function can be used to update the behavior of an existing instance without changing its identity. nil user=> --- It says:"the first arg corresponding to this" What is meant with "this"?
1 Nov 2009 14:09
1 Nov 2009 16:40
throw-if
John Harrop <jharrop117 <at> gmail.com>
2009-11-01 15:40:03 GMT
2009-11-01 15:40:03 GMT
There seems to be a bit of wasteful duplication in clojure: there's a private clojure.core/throw-if and there's clojure.contrib.except/throw-if. Making matters sillier, they have somewhat different argument lists.
Probably they should be merged into a public clojure.core/throw-if.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---
1 Nov 2009 18:44
java.lang.ClassFormatError: Duplicate field name&signature in class file
Gorsal <seth <at> tewebs.com>
2009-11-01 17:44:37 GMT
2009-11-01 17:44:37 GMT
Im having difficulties using gen-class in some cases (clojure.core/gen-class :name rcp.MyView :extends org.eclipse.ui.part.ViewPart :prefix "MyView362" :init init) (clojure.core/defn MyView362init [] [[] []]) (clojure.core/defn MyView362createPartControl [this parent] (println "HI")) (clojure.core/defn MyView362setFocus [this]) When i type in rcp.MyView i get an error java.lang.ClassFormatError: Duplicate field name&signature in class file Looking at the class expansion in eclipse, theres a duplicate init_var However, when i replace org.eclipse.ui.part.ViewPart with org.eclipse.core.commands.AbstractHandler there is no duplicate var. Whats going on here?
1 Nov 2009 20:20
Re: Periodic tasks
Emeka <emekamicro <at> gmail.com>
2009-11-01 19:20:53 GMT
2009-11-01 19:20:53 GMT
John,
Is like I am missing something? This thread mentioned making periodic tasks, there was a java example to it. However, what you posted I am yet to figure out how to make a periodic tasks possible.
Regards,
Emeka
On Sat, Oct 31, 2009 at 6:27 PM, John Harrop <jharrop117 <at> gmail.com> wrote:
On Sat, Oct 31, 2009 at 12:36 PM, Luke VanderHart <luke.vanderhart <at> gmail.com> wrote:Why not just run an agent that does something, then calls sleep for N
seconds, then calls the next thing?
Granted, it will eat up a thread in your agent thread pool, but if
you've only got one of these in the app it shouldn't be a problem.
Or you could go the Java route, and start a daemon thread manually.Or you could use send-off instead of send; send-off doesn't consume from a finite thread pool and is thus suitable for long-running (or blocking, e.g. I/O) tasks.Incidentally, if you ever want to simply reset the state of an agent to a particular value, analogously to ref-set and reset!, this can work:(defn set-agent [a v] (send a (fn [_] v)))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure <at> googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---
> Regarding this specific issue, (apply (fn [] 1)) doesn't work in
> ClojureJVM either, at least not the build I have.
>
> user=> (apply (fn [] 1))
> java.lang.IllegalArgumentException: Wrong number of args passed to:
> core$apply (NO_SOURCE_FILE:0)
Correct. My Clojure JVM version was a little (too) old, and ClojureCLR
was fresh out of GitHub
RSS Feed