Re: Some questions about Clojure Protocols

2010-11-03 Thread Meikel Brandmeyer
Hi, On 4 Nov., 04:58, ka wrote: > (defprotocol OnlyHalfCooless x y z) > > Instead of > (defn is-this-cool? [o] (satisfies? Coolness o)) > > I need to now write: > (defn is-this-cool? [o] (or (instance? Cool1 o) (instance? Cool2 o)) > or, (even worse) > (defn is-this-cool? [o] (and (satisfies? On

Re: From jetty to war?

2010-11-03 Thread Sean Corfield
On Wed, Nov 3, 2010 at 8:51 PM, Mike Meyer wrote: >> Solution: don't have monolingual programmers on your team :) > What, we shouldn't hire Americans? :-) Normally that joke is aimed at Brits like me :) > That only helps if everyone actually knows all the languages involved Well, smart people p

Re: A suggestion for the next Conj

2010-11-03 Thread Ken Wesson
On Wed, Nov 3, 2010 at 7:47 PM, Nick Brown wrote: > We could set up a web app that uses data mining algorithms to analyze > people's interests, experience with Clojure, industries they work in, > Myers-Briggs type, and other information to put together compatible > small groups of people. Or you

Re: Resources on optimizing Clojure code

2010-11-03 Thread Ken Wesson
If you're looking to generate all the numbers with exactly two prime factors (counting multiplicity), I have clojure code that generates the ones up to 10^8 in under two minutes: com.example.sbox=> (time (count (semiprimes-to 1))) "Elapsed time: 106157.33292 msecs" 41803068 It's single-th

Re: *warn-on-reflection* broken in 1.2?

2010-11-03 Thread Stuart Campbell
I get the expected result in my REPL via SLIME: user> *clojure-version* {:major 1, :minor 2, :incremental 0, :qualifier ""} user> (set! *warn-on-reflection* true) true user> (defn foo [s] (.charAt s 1)) Reflection warning, NO_SOURCE_FILE:1 - call to charAt can't be resolved. #'user/foo Regards, S

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Andy Fingerhut
One more suggestion: Try simply creating one giant map that maps complete postal code strings directly to the associated data values, without any tree data structure explicitly created in your code. The code will be a lot simpler, and the underlying data structure is likely to be competit

*warn-on-reflection* broken in 1.2?

2010-11-03 Thread Ken Wesson
The website has this example: (set! *warn-on-reflection* true) -> true (defn foo [s] (.charAt s 1)) -> Reflection warning, line: 2 - call to charAt can't be resolved. -> #user/foo When I try this in a Clojure 1.2 REPL generated by Enclojure 1.4.0/NB 6.9.1 I don't see the reflection warning in any

Re: Some questions about Clojure Protocols

2010-11-03 Thread ka
> AFAIK, it is not possible. You must implement all the different protocols. > It might look desapointing, but on the other hand it is not necessary. > (As there is no static typing in Clojure) > What is your use-case? Current use case is that I want an abstraction which comprises of a set of oper

Re: From jetty to war?

2010-11-03 Thread Mike Meyer
On Wed, 3 Nov 2010 16:26:13 -0700 Sean Corfield wrote: > On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer > wrote: > > We're facing that now, and with a mono-lingual system, you know > > everyone can contribute to any part of the project. If different parts > > are in different languages, then people

Re: Bug with instance? inside deftypes

2010-11-03 Thread ka
>> I would guess the problem is referring to T inside the deftype. This also works: (deftype T [] Object (equals [this o] (if (= T (class o)) true false))) But as Meikel said hope that this is not the end of the story. -- You received this message because you are subscribed to the Google Group

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Justin Kramer
Check out assoc-in, get-in, and update-in. They make working with nested maps a breeze. Here's a rewrite of your code: (ns user (:require [clojure.string :as str] [clojure.java.io :as io])) (def postcode-trie (with-open [r (io/reader "/path/to/data.csv")] (reduce (fn [tri

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Michael Gardner
On Nov 3, 2010, at 8:31 PM, Andy Fingerhut wrote: > I'd recommend changing your code to use Java chars instead of single-char > Java strings. That plus the change Paul suggests below should reduce memory > consumption significantly. Another option is to .intern() the strings. You'll still crea

Re: Reloading java classes

2010-11-03 Thread Alexy Khrabrov
On Nov 3, 2010, at 9:24 PM, Seth wrote: > Is it possible to reload modified classes? I would likely to quickly > test my java classes with clojure. http://www.zeroturnaround.com/jrebel/ Used to have a free, um, Scala license too... -- Alexy -- You received this message because you are subscri

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Andy Fingerhut
In addition to this, note that every java.lang.String, i.e. every "A" in your example data structures below, requires storage for one java.lang.Object (8 bytes on 32-bit JVMs, 16 bytes on 64-bit JVMs) plus an array of java char's, where I think that is equal to the size of a java.lang.Objec

Reloading java classes

2010-11-03 Thread Seth
Is it possible to reload modified classes? I would likely to quickly test my java classes with clojure. -- 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

Re: From jetty to war?

2010-11-03 Thread faenvie
btw.: me too has great respect for ruby/rails one of the nice aspects of clojure is, that multiple currents and flavours of modern programming accumulate/reconvene in there. like evolution. diversity is good. it produces its own power and controversy. my fazit: clojure has great potential for we

Re: A question on distributed computing

2010-11-03 Thread Rosko
Hi Vivek, thanks for the info on the Cornell projects. (- jiff f) [2] Fabric: a federated, distributed system for securely and reliably storing, sharing, and computing information. http://www.cs.cornell.edu/projects/fabric/ The Fabric programming language is based on Jif. [1] Jif: Java + inform

Re: A suggestion for the next Conj

2010-11-03 Thread Nick Brown
We could set up a web app that uses data mining algorithms to analyze people's interests, experience with Clojure, industries they work in, Myers-Briggs type, and other information to put together compatible small groups of people. I just had a "How big of a nerd can I be?" moment. But that doesn

Re: Clojure application in the wild, to learn beautiful Clojure technique(s) from

2010-11-03 Thread Sergey Didenko
Try ants demo - https://github.com/krukow/ants-demo. It's an updated version of the original Rich Hickey demo. On Sun, Oct 31, 2010 at 9:13 PM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > Thanks for these applications to look at. These look nice, but don't have > much use for STM.

Re: A suggestion for the next Conj

2010-11-03 Thread Sean Allen
I really like this idea. On Wed, Nov 3, 2010 at 1:16 PM, Laurent PETIT wrote: > Speed dating at the clojure conj, yay ! (not totally non-sense, really) > > 2010/11/3 Alexy Khrabrov : > > Badges could have much bigger font/be more readable, but they are not the > only, and not the main thing; a mi

Re: Resources on optimizing Clojure code

2010-11-03 Thread Leif Walsh
If you want to do this, you can do it simpler, without the loop and temp var: (defn twice-composite? [n] (->> (take-while #(< % n) prime-seq) (every #(or (divides? (* 2 %) n) (not (divides? % n but this is not what you want. See the hints I sent you off the list. On We

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Leif Walsh
Why not just sort the text file and then build the merged trees directly, without the numerous intermediate trees? On Wed, Nov 3, 2010 at 12:22 PM, Paul Ingles wrote: > Hi, > > I've been playing around with breaking apart a list of postal codes to > be stored in a tree with leaf nodes containing

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Paul Mooser
I could be missing something, but since you say you're running into problems as your data gets large, I think you're possibly running into 2 things: 1. You're reading all the data into memory, and keeping it there, in the form of the lines from the file. 2. The way you're defining postcodes-from-f

Re: to macro or not?

2010-11-03 Thread Tim Daly
For writing DSLs, consider the excellent speak of cgrand at the conj : (not= DSL macros) Here are the slides: http://speakerrate.com/talks/4895-not-dsl-macros Yes, I saw the slides. I disagree with the speaker, at least, from what I could see from the slides. If you could argument more, this

Re: From jetty to war?

2010-11-03 Thread Sean Corfield
On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer wrote: > We're facing that now, and with a mono-lingual system, you know > everyone can contribute to any part of the project. If different parts > are in different languages, then people working in one area won't > necessarily be able to help with other

Re: Resources on optimizing Clojure code

2010-11-03 Thread Mark Engelberg
All the time spent factoring is wasted. You can *construct* and/or count the semiprimes far more efficiently than your method of factoring each number one a time in order to filter the semiprimes from the entire range of numbers up to 10^8. Your approach is fundamentally slow; this has nothing to

Re: From jetty to war?

2010-11-03 Thread Mike Meyer
Sean Corfield wrote .. > Why are folks so insistent on monolingual systems? We're facing that now, and with a mono-lingual system, you know everyone can contribute to any part of the project. If different parts are in different languages, then people working in one area won't necessarily be able

Re: Spit is core now. How to append?

2010-11-03 Thread Daniel Bell
I figured it out; if anyone has trouble with this in the future and Googles this, it's done by (spit f content :append true) On Nov 3, 1:57 pm, Daniel Bell wrote: > Clojuredocs mentioned that opts could be passed to clojure.java.io/ > Writer, but (little Java background), I'm having a hard time f

Re: A suggestion for the next Conj

2010-11-03 Thread Sean Corfield
Another possibility is to have something online, based on registration, that let's people write a little bit about themselves and offers tags or some such so attendees can find interesting / similar (or different!) people to meet. I've used such networking apps at a couple of conferences but I don'

Re: Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Ken Wesson
On Wed, Nov 3, 2010 at 12:22 PM, Paul Ingles wrote: > (defn merge-tree > [tree other] > (if (not (map? other)) >tree >(merge-with (fn [x y] (merge-tree x y)) >tree other))) > You can get rid of the anonymous function here and just do (merge-with merge-tree tree other).

Re: From jetty to war?

2010-11-03 Thread Sean Corfield
On Wed, Nov 3, 2010 at 10:59 AM, wrote: > This was/is one of the original selling points and philosophies of Rails - a > monolingual system should mean less context switching, less glue code for > things to talk to each other, fewer bugs and mistakes stemming from > uniformity of language, and

Spit is core now. How to append?

2010-11-03 Thread Daniel Bell
Clojuredocs mentioned that opts could be passed to clojure.java.io/ Writer, but (little Java background), I'm having a hard time figuring out what the analog to "options" is in the Java API. Any help? Thanks, -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: A suggestion for the next Conj

2010-11-03 Thread buckmeisterq
I agree about the "speed dating" concept or something to have each of us talk at least once with everyone else (as long as the group size is feasible). We mostly all groan at these ice breaker type activities but they do tend to work ok at getting people in larger groups to interact at least on

Re: From jetty to war?

2010-11-03 Thread buckmeisterq
> Why are folks so insistent on monolingual systems? This was/is one of the original selling points and philosophies of Rails - a monolingual system should mean less context switching, less glue code for things to talk to each other, fewer bugs and mistakes stemming from uniformity of language,

Constructing Nested Trees and Memory Consumption

2010-11-03 Thread Paul Ingles
Hi, I've been playing around with breaking apart a list of postal codes to be stored in a tree with leaf nodes containing information about that area. I have some code that works with medium-ish size inputs but fails with a GC Overhead error with larger input sets (1.5m rows) and would really appr

Re: Clojure on Javascript

2010-11-03 Thread Michael Ossareh
On Fri, Oct 29, 2010 at 21:32, Michael Gardner wrote: > Agreed. What is the point of Javascript on the server side? Familiarity? > Consistency with client-side code? > I guess what Java was meant to be, to some degree? "Write once run anywhere". I for one am still hankering for a great way to w

Clojure coalesce function at SO with monads - help's needed

2010-11-03 Thread Jacek Laskowski
Hi, When I stumbled upon the question "Clojure coalesce function" at StackOverflow today, I saw a place for "reverted" maybe-m and sequence-m monads. It seemed to have been easy, but turned out not. I can't figure out how to use monads for the task at hand. Could someone point me into a right dire

Re: Resources on optimizing Clojure code

2010-11-03 Thread Dan Kefford
One idea that I had was to inline the factoring logic into twice- composite. Who cares about the factors? We just want to know if there are two or not: (defn twice-composite? [n] (loop [ps prime-seq tmp n p-count 0] (if (< 2 p-count) false (if (= 1 tmp)

Re: From jetty to war?

2010-11-03 Thread Luke VanderHart
I have no problem at all with polyglot systems. That said, Clojure, as a general-purpose programming language, is in my subjective opinion superior to Ruby. Furthermore, there is nothing special about Ruby that makes it particularly suited to webapps (MVC webapps, perhaps, but MVC is not the only

Re: Resources on optimizing Clojure code

2010-11-03 Thread Mark Engelberg
Your Clojure implementation of your particular approach is reasonable, but you need a cleverer approach. I'll send you a hint offline. -- 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

Re: Resources on optimizing Clojure code

2010-11-03 Thread Dan Kefford
Sorry for the delayed response. OK... here's an example; my solution to problem 187: (defn divides? [n d] (zero? (rem n d)) ) (declare prime? prime-seq) (defn prime? [n] (if (< n 2) false (every? #(not (divides? n %)) (take-while #(<= (* % %) n) prime- seq))) ) (def prime? (memoize

Re: Is this bug in Google AppEngine, appengine-clj or Clojure itself?

2010-11-03 Thread Miki
Does anybody know if this fix made it to the released jar? On Oct 17, 12:18 am, Mike Hinchey wrote: > I think it is caused by those 2 clojure bugs (which seem to be the same > thing).  You may be able to work around that problem by patching > appengine-clj to hint the method call to be on the pub

Re: A suggestion for the next Conj

2010-11-03 Thread Ulises
Are there any plans on having an edition of the Conj somewhere in europe? If not, I'd like to suggest we have one over here :) U -- 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 p

Re: A suggestion for the next Conj

2010-11-03 Thread Laurent PETIT
2010/11/3 nicolas.o...@gmail.com : > Very fast 3 minutes talk could be fun too. interspaced between 2 talks, hmm, interesting ! (but it could have worked for the first conj where we were just 200, but maybe will not work for the next, if we're > 1000 :-) ) > > Name, nicknames, and what you are us

Re: From jetty to war?

2010-11-03 Thread faenvie
most companys i know - i have come around a lot last years - clearly prefer spring to grails because: 1. the integration-aspect is much more important for them than partial productivity win or promise. 2. java is established in their tech portfolio groovy is not clojure is completely out of scop

Re: From jetty to war?

2010-11-03 Thread lprefontaine
Sean Corfield wrote .. > On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart > wrote: > > I have nothing but respect for Rails, and I look forward to the day > > when Clojure has a comparable system. > > I sort of have to ask "why?" - what's wrong with using Rails on JRuby > for the front end and Cl

Re: From jetty to war?

2010-11-03 Thread Sean Corfield
On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart wrote: > I have nothing but respect for Rails, and I look forward to the day > when Clojure has a comparable system. I sort of have to ask "why?" - what's wrong with using Rails on JRuby for the front end and Clojure for the model? Why are folks so

Re: Some questions about Clojure Protocols

2010-11-03 Thread Mark Engelberg
On Wed, Nov 3, 2010 at 5:37 AM, Stuart Sierra wrote: > Protocols provide just one thing: polymorphic functions. They are not > intended to provide "type" or hierarchy like Java classes / > interfaces. Well, they also provide a second thing -- a way to bundle multiple functions as something that i

Re: A suggestion for the next Conj

2010-11-03 Thread nicolas.o...@gmail.com
Very fast 3 minutes talk could be fun too. Name, nicknames, and what you are using Clojure for. No slides of course. Best, Nicolas. -- 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 t

Re: A suggestion for the next Conj

2010-11-03 Thread Laurent PETIT
Speed dating at the clojure conj, yay ! (not totally non-sense, really) 2010/11/3 Alexy Khrabrov : > Badges could have much bigger font/be more readable, but they are not the > only, and not the main thing; a mixer format is, and it should be something > deliberate as even random motion over 2 d

Re: A suggestion for the next Conj

2010-11-03 Thread Alexy Khrabrov
Badges could have much bigger font/be more readable, but they are not the only, and not the main thing; a mixer format is, and it should be something deliberate as even random motion over 2 days is not enough to bring all particles next to each other! -- Alexy On Nov 3, 2010, at 12:52 PM, Chri

Re: A suggestion for the next Conj

2010-11-03 Thread Christopher Petrilli
I was thinking that it would be handy if the "badges" next year had space for that. I'd be happy to whip up something to collect the data and print the badges. Chris On Wed, Nov 3, 2010 at 12:35 PM, Alexy Khrabrov wrote: > I'd really like to meet everybody from IRC and github, but apparently mi

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread David Nolen
On Wed, Nov 3, 2010 at 12:38 PM, David Nolen wrote: > On Wed, Nov 3, 2010 at 11:53 AM, Sunil S Nandihalli < > sunil.nandiha...@gmail.com> wrote: > >> thanks Jim for your email. I will try to get my hands on Reasoned >> Schemer.. :) >> Sunil. >> > William Byrd's dissertation, http://gradworks.umi.

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread David Nolen
On Wed, Nov 3, 2010 at 11:53 AM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > thanks Jim for your email. I will try to get my hands on Reasoned Schemer.. > :) > Sunil. > I've been working through it and it's an eye-opening book, particularly for me as I'm not that familiar with Prolo

Re: A suggestion for the next Conj

2010-11-03 Thread Alexy Khrabrov
I'd really like to meet everybody from IRC and github, but apparently missed some. So perhaps we can have a meet-and-greet session, where folks will stand up and announce their IRC and github nicks! We also need some color coding, as @hiredman could be easily confused with @liebke! @alexyk -

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread Sunil S Nandihalli
thanks Jim for your email. I will try to get my hands on Reasoned Schemer.. :) Sunil. On Wed, Nov 3, 2010 at 7:44 PM, jim wrote: > Sunil, > > I've been away from that code for a while, so I forget the details > about its cut operator. However, I would really encourage you to read > The Reasoned

Re: From jetty to war?

2010-11-03 Thread Luke VanderHart
Ok... Fair enough. Most of my comment related to Spring, not to Grails. Grails has other issues which I won't get into here. I have nothing but respect for Rails, and I look forward to the day when Clojure has a comparable system. On Nov 2, 2:32 pm, Wilson MacGyver wrote: > On Tue, Nov 2, 2010

Re: Java gotchas now clojure gotchas

2010-11-03 Thread Meikel Brandmeyer
Hi, On 3 Nov., 15:37, Mark Hamstra wrote: > It would seem that a solution to this problem would be to treat such > automatic boxing/upcasting similar to reflection -- i.e., have an > option that causes Clojure to spit out a warning when such boxing/ > upcasting occurs, alerting the performance c

Re: Java gotchas now clojure gotchas

2010-11-03 Thread Mark Hamstra
It would seem that a solution to this problem would be to treat such automatic boxing/upcasting similar to reflection -- i.e., have an option that causes Clojure to spit out a warning when such boxing/ upcasting occurs, alerting the performance conscious of the need to change the code that is gener

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread jim
Sunil, I've been away from that code for a while, so I forget the details about its cut operator. However, I would really encourage you to read The Reasoned Schemer, which is where that code came from. I'm also intending to change it to use Fogus' unifier when I get home. Jim On Nov 3, 8:14 am,

Re: Bug with instance? inside deftypes

2010-11-03 Thread Meikel Brandmeyer
Hi, On 3 Nov., 14:58, Adrian Cuthbertson wrote: > I would guess the problem is referring to T inside the deftype. This works; > > (deftype T [] Object (equals [this o] (if (instance? (class this) o) > true false))) > (let [t (T.)] (.equals t t)) > ==> true I hope that this is not the end of the

Re: Bug with instance? inside deftypes

2010-11-03 Thread Adrian Cuthbertson
I would guess the problem is referring to T inside the deftype. This works; (deftype T [] Object (equals [this o] (if (instance? (class this) o) true false))) (let [t (T.)] (.equals t t)) ==> true On Wed, Nov 3, 2010 at 12:39 PM, ka wrote: > Clojure 1.2.0 > 1:1 user=> > 1:2 user=> > 1:3 user=>

Re: REQUEST for feedback on http://clojure.org

2010-11-03 Thread Alex Miller
Michael: thanks for those tips. I can't do anything about those but I will raise it... ka: you can find that kind of stuff now on the Clojure confluence pages: http://dev.clojure.org/display/design/Home On Nov 2, 10:43 pm, ka wrote: > Hi Alex,  Can we have a section: Clojure - What's next? Dish

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread Sunil S Nandihalli
Hi Konrad, It is really nice .. But I was wondering if it had a cut operator or predicate .. similar to '!' in prolog.. Thanks, Sunil. On Wed, Nov 3, 2010 at 1:20 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Thanks Konrad. I will look at it. > Sunil > > > On Wed, Nov 3, 2010 at

Re: A question on distributed computing

2010-11-03 Thread Christopher Petrilli
Before going down this road, I'd strongly recommend reading Ross Anderson's paper "Programming Satan's Computer": http://www.cl.cam.ac.uk/~rja14/Papers/satan.pdf In addition, Ross has generously put the first edition of his book "Security Engineering" online: http://www.cl.cam.ac.uk/~rja14/book.

Re: Some questions about Clojure Protocols

2010-11-03 Thread Stuart Sierra
On Nov 3, 6:32 am, ka wrote: > 1.  How to combine protocols? Just define types that extend all the protocols. > On a related note if I have a protocol P how can I create a protocol > with is a union of P and java.lang.Comparable ? You can't. But you can define a type that extends both P and Com

Re: to macro or not?

2010-11-03 Thread Laurent PETIT
2010/11/3 Tim Daly : > > > On 11/2/2010 12:38 PM, Laurent PETIT wrote: >> >> 2010/10/30 Tim Daly: >>> >>>  Macros in lisp get used for three general purposes, at least >>> in my experience. >>> >>> The first purpose is efficiency. In common lisp you will find >>> that you can generate very machine-

Re: A question on distributed computing

2010-11-03 Thread Ken Wesson
On Wed, Nov 3, 2010 at 1:04 AM, Vivek Khurana wrote: > > > On Nov 2, 8:56 pm, Ken Wesson wrote: > > > That seems impossible assuming you don't trust the software running on > the > > other node. > > > > It is not impossible. There are projects by Cornell .University, > jiff[1] and fabric[2] whic

Re: to macro or not?

2010-11-03 Thread Tim Daly
On 11/2/2010 12:38 PM, Laurent PETIT wrote: 2010/10/30 Tim Daly: Macros in lisp get used for three general purposes, at least in my experience. The first purpose is efficiency. In common lisp you will find that you can generate very machine-efficient (aka optimized fortran level) binary ins

Re: Some questions about Clojure Protocols

2010-11-03 Thread nicolas.o...@gmail.com
On Wed, Nov 3, 2010 at 10:32 AM, ka wrote: > 1.  How to combine protocols? > AFAIK, it is not possible. You must implement all the different protocols. It might look desapointing, but on the other hand it is not necessary. (As there is no static typing in Clojure) What is your use-case? > 2. Do

Bug with instance? inside deftypes

2010-11-03 Thread ka
Clojure 1.2.0 1:1 user=> 1:2 user=> 1:3 user=> (deftype T [] Object (equals [this o] (if (instance? T o) true false))) user.T 1:4 user=> (def t (T.)) #'user/t 1:5 user=> (.equals t t) false 1:6 user=> (deftype T [] Object (equals [this o] (if (= T (class o)) true false))) user.T 1:7 user=> (def t (

Some questions about Clojure Protocols

2010-11-03 Thread ka
1. How to combine protocols? For example I have protocols walks, talks, sleeps, now how might I come up with an abstraction which walks-talks-and-sleeps ? In Java one might create an interface which extends multiple interfaces. Although getting an instance which walks-talks-and-sleeps is made ea

Re: A question on distributed computing

2010-11-03 Thread nicolas.o...@gmail.com
Some things are certainly possible. It depends whether you consider all computers to be friendly of some of them to be evil. If all of them are friendly, you can annotate your data by permissions. Else, you need either to check what you send to other computers, or crypt with different keys. --

Re: StackOverflowError while using map inside a reduce

2010-11-03 Thread John Szakmeister
On Wed, Nov 3, 2010 at 2:35 AM, Meikel Brandmeyer wrote: > Hi, > > On 3 Nov., 00:40, Rasmus Svensson wrote: > >> I think the problem is that this reduction will build an expression like >> this: >> >>     (map + ... (map + ... (map + ... (map + ... > levels> >> >> When clojure tries to reali

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread Sunil S Nandihalli
Thanks Konrad. I will look at it. Sunil On Wed, Nov 3, 2010 at 1:08 PM, Konrad Hinsen wrote: > On 3 Nov 2010, at 06:04, Sunil S Nandihalli wrote: > > Hello everybody, >> I was wondering if one can code in a way semantically similar to prolog >> using the backtracking monads.. Has anybody tried

Re: clojure-backtracking-monads .. can it emulate prolog?

2010-11-03 Thread Konrad Hinsen
On 3 Nov 2010, at 06:04, Sunil S Nandihalli wrote: Hello everybody, I was wondering if one can code in a way semantically similar to prolog using the backtracking monads.. Has anybody tried it .. ? I did see the tutorial which demonstrates backtracking monads .. http://brehaut.net/blog/201