Hi,
On 3 Nov., 00:40, Rasmus Svensson r...@lysator.liu.se wrote:
I think the problem is that this reduction will build an expression like this:
(map + ... (map + ... (map + ... (map + ... one million nesting
levels
When clojure tries to realize an element of the resulting lazy
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 ..
Thanks Konrad. I will look at it.
Sunil
On Wed, Nov 3, 2010 at 1:08 PM, Konrad Hinsen konrad.hin...@fastmail.netwrote:
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
On Wed, Nov 3, 2010 at 2:35 AM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
On 3 Nov., 00:40, Rasmus Svensson r...@lysator.liu.se wrote:
I think the problem is that this reduction will build an expression like
this:
(map + ... (map + ... (map + ... (map + ... one million nesting
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.
--
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
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 (T.))
On Wed, Nov 3, 2010 at 10:32 AM, ka sancha...@gmail.com 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
On 11/2/2010 12:38 PM, Laurent PETIT wrote:
2010/10/30 Tim Dalyd...@axiom-developer.org:
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
On Wed, Nov 3, 2010 at 1:04 AM, Vivek Khurana hiddenharm...@gmail.comwrote:
On Nov 2, 8:56 pm, Ken Wesson kwess...@gmail.com 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,
2010/11/3 Tim Daly d...@axiom-developer.org:
On 11/2/2010 12:38 PM, Laurent PETIT wrote:
2010/10/30 Tim Dalyd...@axiom-developer.org:
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
On Nov 3, 6:32 am, ka sancha...@gmail.com 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
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:
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 1:08
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 sancha...@gmail.com wrote:
Hi Alex, Can we have a section: Clojure
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 sancha...@gmail.com wrote:
Clojure 1.2.0
1:1 user=
1:2 user=
Hi,
On 3 Nov., 14:58, Adrian Cuthbertson adrian.cuthbert...@gmail.com
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
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
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
Hi,
On 3 Nov., 15:37, Mark Hamstra markhams...@gmail.com 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
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 wmacgy...@gmail.com wrote:
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 jim.d...@gmail.com 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
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
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 Prolog.
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,
Speed dating at the clojure conj, yay ! (not totally non-sense, really)
2010/11/3 Alexy Khrabrov alexy.khrab...@gmail.com:
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
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
On Wed, Nov 3, 2010 at 5:37 AM, Stuart Sierra
the.stuart.sie...@gmail.com 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
On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart
luke.vanderh...@gmail.com 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
Sean Corfield seancorfi...@gmail.com wrote ..
On Wed, Nov 3, 2010 at 8:51 AM, Luke VanderHart
luke.vanderh...@gmail.com 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
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
Does anybody know if this fix made it to the released jar?
On Oct 17, 12:18 am, Mike Hinchey hinche...@gmail.com 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
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
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
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
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)
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
On Fri, Oct 29, 2010 at 21:32, Michael Gardner gardne...@gmail.com 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
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
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,
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
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
On Wed, Nov 3, 2010 at 10:59 AM, buckmeist...@gmail.com 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
On Wed, Nov 3, 2010 at 12:22 PM, Paul Ingles p...@forward.co.uk 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
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
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 dchristianb...@gmail.com wrote:
Clojuredocs mentioned that opts could be passed to clojure.java.io/
Writer, but (little Java background),
Sean Corfield seancorfi...@gmail.com 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
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
On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer
mwm-keyword-googlegroups.620...@mired.org 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
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,
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
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 p...@forward.co.uk wrote:
Hi,
I've been playing around with breaking apart a list of postal codes to
be stored in a tree with leaf
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 Wed,
I really like this idea.
On Wed, Nov 3, 2010 at 1:16 PM, Laurent PETIT laurent.pe...@gmail.comwrote:
Speed dating at the clojure conj, yay ! (not totally non-sense, really)
2010/11/3 Alexy Khrabrov alexy.khrab...@gmail.com:
Badges could have much bigger font/be more readable, but they are
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.
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
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 +
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
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
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.Object
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
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 create
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 [trie
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
Groups
On Wed, 3 Nov 2010 16:26:13 -0700
Sean Corfield seancorfi...@gmail.com wrote:
On Wed, Nov 3, 2010 at 3:31 PM, Mike Meyer
mwm-keyword-googlegroups.620...@mired.org wrote:
We're facing that now, and with a mono-lingual system, you know
everyone can contribute to any part of the project. If
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
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
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
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,
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
On Wed, Nov 3, 2010 at 7:47 PM, Nick Brown nwbr...@gmail.com 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
On Wed, Nov 3, 2010 at 8:51 PM, Mike Meyer
mwm-keyword-googlegroups.620...@mired.org 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
72 matches
Mail list logo