On Fri, Dec 4, 2009 at 2:49 PM, Richard Newman wrote:
> > The problem is that it is an unreasonably high barrier to entry.
> > There MUST be an electronic-only way (and it must not require a cell
> > phone, CC#, &c.) if the full potential of this community is to be
> > unleashed upon clojure-cont
On Fri, Dec 4, 2009 at 7:40 PM, Luc Préfontaine wrote:
> I was about to say that. There's no need for the id's to be "contiguous",
> only to get them to grow to preserve ordering.
> If you can find a way in your design to increment the atom each time a
> transaction is retried then you would
> p
On Fri, Dec 4, 2009 at 8:57 AM, Miron Brezuleanu wrote:
> On Fri, Dec 4, 2009 at 2:33 PM, John Harrop wrote:
> > The problem is that it is an unreasonably high barrier to entry. There
> MUST
> > be an electronic-only way (and it must not require a cell phone, CC#,
>
On Fri, Dec 4, 2009 at 6:51 AM, Meikel Brandmeyer wrote:
> Hi,
>
> On 4 Dez., 05:17, John Harrop wrote:
> > > The rules on contrib are that the work must be original to the author.
> Even
> > > with Andrew's disclaimer that it be considered public do
On Fri, Dec 4, 2009 at 6:50 AM, Sergey Didenko wrote:
> Without the global transaction counter another problem arises.
>
> Suppose transaction B depends on ( results of ) transaction A. And they are
> executed from different threads. However they have the right order when
> executing the first tim
On Fri, Dec 4, 2009 at 4:41 AM, Lauri Pesonen wrote:
> 2009/12/2 Matthew Williams :
> > Using the Cocoa build of Emacs 23 (http://www.emacsformacosx.com) I
> > was able to get up and running extremely quickly with Technomancy's
> > swank-clojure install.
>
> This is very much off-topic, but...
>
On Thu, Dec 3, 2009 at 6:31 PM, Sergey Didenko wrote:
> Well, I'm not fluent with git yet. I'll create the github project, that can
> not be hard.
>
> In comparison with Prevayler, the persister does not block the reads,
> because it relies on Clojure STM. However it blocks the writes as
> Prevay
On Thu, Dec 3, 2009 at 10:41 AM, Stephen C. Gilardi wrote:
>
> On Dec 3, 2009, at 10:31 AM, Roman Roelofsen wrote:
>
> Are there any plans to add -$> to core or contrib?
>
> The rules on contrib are that the work must be original to the author. Even
> with Andrew's disclaimer that it be considered
On Wed, Dec 2, 2009 at 7:59 PM, Don wrote:
> I still can't figure it out. If have this set.
>
> a [2 4 6 7]
> b [1 3 9 2]
> c [2 4 5 6]
> d [6 1 3 8]
> e [4 8 2 1]
>
> If I do (reduce min (map #(get % 0) (list a b c d e)))
>
> It grabs the min value from index 0 of the five vectors and retu
On Wed, Dec 2, 2009 at 5:43 PM, Don wrote:
> I am having difficulty approaching this problem. I'm not sure if it
> can be done in one swoop, or requires a few steps.
>
> I have 5 vectors as such:
>
> a [2 4 6 7]
> b [1 3 9 2]
> c [2 4 5 6]
> d [6 1 3 8]
> e [4 8 2 1]
>
> And I want to take the m
On Tue, Dec 1, 2009 at 8:30 PM, Alex Osborne wrote:
> Clojure would be challenging language to start with, as (all?) the books
> and documentation are aimed at people who are already programmers. But
> if you like a challenge then perhaps that's even a good thing. If
> you're already a techie t
On Tue, Dec 1, 2009 at 11:10 AM, Ivan Sagalaev
wrote:
> Hello!
>
> I'm looking at Clojure for a couple of days, having watched two of
> Rich's video presentations. So I'm not yet familiar with Clojure's
> practical patterns but I can read the code :-).
>
> My question is how to model a non-blockin
>
> So, Clojure programmers, am I wrong? Should I pass on Clojure in favor
> of another langauge? Or learn Common Lisp or Scheme first, then try my
> hand at Clojure? Am I mistaken for a different reason? Or perhaps
> there are some criteria I should consider before diving in?
>
I, for one, think
On Mon, Nov 30, 2009 at 9:57 PM, Base wrote:
> Hi
>
> I have a database that has a table with complex java objects stored in
> a binary field.
>
> In java i would do something like:
>
> protected Object read(byte[] buf){
> Object obj = null;
> if (buf==null) return obj;
> try {
>
On Mon, Nov 30, 2009 at 7:07 AM, Joseph Smith wrote:
> setScale returns a new BigDecimal with a given scale, it does not change
> the original value.
>
I did not claim otherwise. The effect of with-precision is like an implicit
(.setScale foo) around every BigDecimal "foo", only more efficient s
On Mon, Nov 30, 2009 at 12:22 AM, Joseph Smith wrote:
> What you want is to set the 'scale' of the BigDecimal.
>
> There doesn't seem to be a nice clojure macro for it, but this works:
>user=> (.setScale (reduce + [15.00M 15.01M 3.00M 3.01M]) 3)
>36.020M
>
That's what with-precision does
One benefit of having a REPL: it makes regular expressions usable. So easy
to test and tweak your RE compared to the traditional compile/test/debug
cycle! I never even bothered with the java.util.regex package before Clojure
as it was too painful to use.
--
You received this message because you a
On Fri, Nov 27, 2009 at 7:48 PM, André Thieme
wrote:
> Let‘s say we have the functions A, B, C, D, E, F and G.
> A is calling B, B is calling C, C is calling D, and so on.
> Now a request R1 comes in, function A is called and this chain
> continues to,
> say, E.
> Now a reload happens. Some functi
On Fri, Nov 27, 2009 at 1:23 PM, John Harrop wrote:
> On Fri, Nov 27, 2009 at 12:46 PM, Richard Newman wrote:
>
>> > Maybe this ought to be fixed; i.e., if the reader sees #^{meta} 'foo
>> > it applies the metadata to foo first, then quotes it, resulting in
>>
On Fri, Nov 27, 2009 at 12:46 PM, Richard Newman wrote:
> > Maybe this ought to be fixed; i.e., if the reader sees #^{meta} 'foo
> > it applies the metadata to foo first, then quotes it, resulting in
> > the same thing as (quote #^{meta} foo).
>
> Why introduce that special case, when you can sim
We're maintaining a large database of tagged images and had a need to
perform "fuzzy search" of the database. The existing search tool takes exact
queries only. So it was necessary to hack up a little tool to sit between
the query source and the engine and transform the query into a "fuzzy
query".
On Fri, Nov 27, 2009 at 8:45 AM, Stefan Kamphausen
wrote:
> > Why? Well because #^ attaches the metadata to the next read form.
> > What's the next read form? It's 'greet. But in fact 'greet is just
> > sugar for (quote greet). So we're actually affixing the metadata to a
> > list containing t
On Thu, Nov 26, 2009 at 4:37 AM, Chris Jenkins wrote:
>
> (defn flip-cell [b x y]
> (let [row (nth b y)
> cell (nth row x)
> new-cell (- 1 cell)
> new-row (assoc row x new-cell)]
> (assoc b y new-row)))
>
(defn flip-cell [b x y]
(update-in b [y x] #(- 1 %)))
:)
--
You receive
On Thu, Nov 26, 2009 at 2:11 AM, Christophe Grand wrote:
> On Thu, Nov 26, 2009 at 8:05 AM, Robert Campbell wrote:
>
>> If you have this:
>>
>> user> (def f (future (Thread/sleep 2) :done))
>> #'user/f
>> user> @f ; this immediate deref blocks for 20 sec, finally returning
>> :block
>> :done
On Wed, Nov 25, 2009 at 12:40 PM, Gabi wrote:
> Very interesting indeed. I am not sure I understand completely, but by
> intuition I presume that the recursive call actually creates a new
> heap allocated LazySeq (with the function definition inside) .
Not quite; it creates a Java object one me
On Tue, Nov 24, 2009 at 6:01 AM, kony wrote:
> Hi,
>
> I found that resolve does not work correctly (I guess) when it is
> called from other thread than main:
>
> e.g.
>
> let define
>
> (def zz 123)
>
> and afterwords call:
>
> (.start (new Thread #(println (resolve 'zz
>
> for me it does no
On Tue, Nov 24, 2009 at 1:04 AM, Meikel Brandmeyer wrote:
> Hi,
>
> On Nov 24, 6:06 am, John Harrop wrote:
>
> > Oh, I have no problem with making money by using open source software,
> when
> > it's done in the manner that companies like Red Hat do it. It
On Mon, Nov 23, 2009 at 9:47 PM, Richard Newman wrote:
> 1- We have this license server, used to control the use of a
>> professional software (this one written using delphi).
>
>
> What are the ethics of using an open source product like Clojure to
> implement DRM restrictions for some other pro
On Mon, Nov 23, 2009 at 8:35 PM, Phlex wrote:
>
> > i'd be interested to hear who has successfully used clojure in
> > production.
>
> Hello,
>
> 1- We have this license server, used to control the use of a
> professional software (this one written using delphi).
What are the ethics of using an
On Mon, Nov 23, 2009 at 4:34 PM, Sergey Didenko wrote:
> Hi,
>
> Andre, Danny's first approach is about "syncing" only on the root
> object, so that every piece of data is behind one deref:
>
> (def root (ref {:persons [ ... no other refs here... ]))
>
> This approach is simpler to code but can le
On Mon, Nov 23, 2009 at 2:26 PM, Sean Devlin wrote:
> * Back to Multimethods *
>
> The power of the individual closures can be amplified when wrapped in
> a multimethod. Consider our String/Symbol/Keyword group.
>
> (defmulti visit-string (fn [& args] (second args))
>
> (defmethod visit-string cl
On Sun, Nov 22, 2009 at 4:25 PM, Martin DeMello wrote:
> On Mon, Nov 23, 2009 at 2:40 AM, John Harrop wrote:
> > Is there an explanation of monads out there that doesn't require the
> reader
> > to know Haskell to understand it? One that's generic to any FP-capable
&g
On Sun, Nov 22, 2009 at 4:32 PM, samppi wrote:
> Does a function that does this:
> (vary coll :x fn-x, :y fn-y)
> ; Equivalent to (assoc coll :x (fn-x (:x coll)), :y (fn-y (:y
> coll)))
> exist in the core or contrib APIs?
>
> I'm surprised that I can't find any. It's a very natural extension o
Is there an explanation of monads out there that doesn't require the reader
to know Haskell to understand it? One that's generic to any FP-capable
language?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
On Sun, Nov 22, 2009 at 12:55 PM, David Brown wrote:
> java.nio.channels.FileChannel contains some .write methods:
>
> [27] write : int (ByteBuffer)
> [28] write : int (ByteBuffer,long)
> [29] write : long (ByteBuffer[])
> [30] write : long (ByteBuffer[],int,int)
>
> I have an array of ByteBufers
How is it pronounced anyway, at the start? LINE... or LANE...?
--
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 your
On Sun, Nov 22, 2009 at 7:54 AM, Emeka wrote:
> John,
>
> You should have added that you code came from Programming Clojure.
>
It didn't. If it's the same as, or closely similar to, code from there, it's
entirely coincidental.
In Clojure there's usually several ways to do something, but often o
On Sun, Nov 22, 2009 at 6:05 AM, Michael Wood wrote:
> > You've got some kind of system problem confounding your results, I'll
> bet.
> > It got slower? One test actually hung?
> > My suspicion, of course, lies with the emacs environment you've just
> > confessed to using. Half the traffic on thi
On Sat, Nov 21, 2009 at 11:43 PM, Alex Osborne wrote:
> John Harrop wrote:
> > On Sat, Nov 21, 2009 at 9:03 PM, Alex Osborne >
> > (:import package1 class class class) (:import package2 class class)
> >
> >
> > I am. Especially since the latter already works.
On Sat, Nov 21, 2009 at 11:21 PM, David Brown wrote:
> On Sat, Nov 21, 2009 at 11:14:52PM -0500, John Harrop wrote:
>
> >1 second instead of 1/6 of a second. Yeah, like users will notice that
> >difference in startup times. :)
>
> I'm not actually complaining, but I
On Sat, Nov 21, 2009 at 9:03 PM, Alex Osborne wrote:
> John Harrop wrote:
>
> > 1: Improvements to the ns macro, such as described in a previous thread.
> > Particularly I'd like to see
> >
> > (:import package class class class)
> >
> > work. Thi
On Sat, Nov 21, 2009 at 8:57 PM, David Brown wrote:
> On Sat, Nov 21, 2009 at 08:42:26PM -0500, John Harrop wrote:
>
> >Are you talking about binding things like String.class to vars referenced
> by
> >symbols like String?
>
> Not just String.class, every single
On Sat, Nov 21, 2009 at 8:47 PM, David Brown wrote:
> On Fri, Nov 20, 2009 at 03:54:45PM -0800, Mike Hinchey wrote:
> >It's the . special form that makes the difference. In (. System
> >(getProperty)), the dot interprets System as a class and looks for a
> static
> >method (at read/compile time)
On Sat, Nov 21, 2009 at 8:30 PM, David Brown wrote:
> On Fri, Nov 20, 2009 at 06:37:18PM +, Jim Downing wrote:
>
> >I might have misunderstood, but isn't the problem the same as in Java;
> >you can't know from a static analysis which classes are going to be
> >loaded?
>
> Except that Clojure
One place where interop needs improvement: imports.
This is ridiculous:
#
sandbox=>
#
sandbox=>
#
sandbox=>
#
sandbox=>
#
sandbox=>
I shouldn't have to play guessing games or keep reaching for reference
materials. We need at least two improvements here.
1: Improvements to the ns macro, such as
On Fri, Nov 20, 2009 at 5:16 PM, Raoul Duke wrote:
> > Try with a 1.6 JVM...
>
> wow. it actually got worse than when i was using 1.5. ... so much for
> hallowed write-once-run-the-same-anywhere-ish of the jvm, d'oh.
>
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> (load-file "/tmp/test.clj")
> #'user/v
On Fri, Nov 20, 2009 at 2:28 PM, Richard Newman wrote:
> > But I should be able to know, through class inspection, whether my
> > 'main' program depends on a class which uses, say, the clojure.zip
> > namespace, and decide whether or not to include it. Or so I am
> > wondering.
>
> There are impe
On Thu, Nov 19, 2009 at 9:17 PM, Mark Triggs wrote:
> A good example is:
>
> (take 10 (repeatedly #(rand-int 100)))
>
> to get a bunch of random integers. I actually quite like this idiom,
> even if there's a bit of ascii involved :)
>
Why not abstract it some, though?
(defn rand-seq [range]
On Thu, Nov 19, 2009 at 7:51 PM, Alex Osborne wrote:
> John Harrop wrote:
> > This is just (sort (concat [1 2 3 4 5 6 7] [3 2 7])) though.
> >
> >
> > I think he also wants the original order of the first input coll to be
> > preserved, though. Sort woul
On Thu, Nov 19, 2009 at 7:15 PM, Alex Osborne wrote:
> John Harrop wrote:
> > On Thu, Nov 19, 2009 at 7:00 PM, Sean Devlin > <mailto:francoisdev...@gmail.com>> wrote:
> >
> > That's why there are two separate functions do do what you suggest
> >
On Thu, Nov 19, 2009 at 7:00 PM, Sean Devlin wrote:
> That's why there are two separate functions do do what you suggest
>
> user=>(interleave [1 2 3 4] [1 2 3 4])
> (1 1 2 2 3 3 4 4)
>
> user=> (concat [1 2 3 4] [1 2 3 4])
> (1 2 3 4 1 2 3 4)
>
Poor choice of example. I think he meant even if he
On Thu, Nov 19, 2009 at 2:39 PM, Timothy McDowell wrote:
> unsubscribe
Interesting. Most mailing lists I subscribe to get one of these a week, or
even a day. This is the first missent unsubscribe the clojure list's had in
months.
--
You received this message because you are subscribed to the G
On Thu, Nov 19, 2009 at 1:23 PM, Sean Devlin wrote:
> Try clojure.contrib.seq-utils :)
>
> As a learning exercise, I'd recommend re-writing it to be lazy. Your
> version is eager because it uses loop. In order to make it lazy,
> you'd want to construct a lazy-seq. See the macro w/ the same name
On Thu, Nov 19, 2009 at 4:31 AM, Lauri Pesonen wrote:
> (clojure.walk/macroexpand-all '(cond (even? 2) :foo (odd? 2) :bar :else
> :baz))
> (if (even? 2) :foo (if (odd? 2) :bar (if :else :baz nil)))
Eeeuw. Perhaps the cond macro should check if the last condition is
self-evaluating and, if it is
On Tue, Nov 17, 2009 at 6:24 PM, Richard Newman wrote:
> > I wonder if perhaps (into {} a-java-map) should work but no other
> > substitutions of a potentially-mutable map for a Clojure map.
>
> Baby, bathwater. Making a persistent map out of a Java map is
> expensive. Not everything that impleme
On Tue, Nov 17, 2009 at 5:06 PM, Sean Devlin wrote:
> Heh. Learn something new every day.
>
> This also works
>
> (into {} (System/getProperties))
And I'd much prefer it. Passing a mutable Java map around to functions that
expect a map but assume it will never change out from under them creates
On Tue, Nov 17, 2009 at 4:22 PM, Chouser wrote:
> On Tue, Nov 17, 2009 at 4:11 PM, John Harrop wrote:
> > On Tue, Nov 17, 2009 at 3:59 PM, nchubrich
> > wrote:
> >>
> >> How do you def a symbol that you make using (symbol)? I.E. if I try
>
On Tue, Nov 17, 2009 at 3:59 PM, nchubrich wrote:
> How do you def a symbol that you make using (symbol)? I.E. if I try
> to do (def (symbol "x") 2) I get:
> java.lang.Exception: Second argument to def must be a Symbol. (And
> why does it say the \second argument must be a symbol?)
>
Special fo
On Tue, Nov 17, 2009 at 2:31 PM, Chouser wrote:
> On Tue, Nov 17, 2009 at 8:40 AM, Jacek Laskowski
> wrote:
> >
> > I'm wondering what part is missing in "which provides a means for
> > nested contexts to communicate with code before it the call stack." at
> > http://clojure.org/vars? I think th
On Tue, Nov 17, 2009 at 2:17 PM, Stefan Kamphausen
wrote:
> Hi,
>
> On Nov 17, 8:12 pm, John Harrop wrote:
> > On Tue, Nov 17, 2009 at 1:46 PM, Sean Devlin >wrote:
> >
> > > I *THINK* what is meant by the "non-numeric" is anything that matches
On Tue, Nov 17, 2009 at 1:46 PM, Sean Devlin wrote:
> I *THINK* what is meant by the "non-numeric" is anything that matches
>
> #"[a-zA-z]"
>
Nah, it'll be anything that's allowed elsewhere AND is not a digit.
--
You received this message because you are subscribed to the Google
Groups "Clojure
On Tue, Nov 17, 2009 at 8:40 AM, Jacek Laskowski wrote:
> Hi,
>
> I'm wondering what part is missing in "which provides a means for
> nested contexts to communicate with code before it the call stack." at
> http://clojure.org/vars? I think the wording is broken at the end.
>
Probably "in":
"whic
On Mon, Nov 16, 2009 at 7:20 PM, Kent wrote:
> Hi,
>
> I am trying to use clojure to implement a "plugin" for some vendor
> supplied software.
>
> Here is a little background on the vendor supplied software. It
> expects me to implement a particular interface and then put the jar
> file containi
On Mon, Nov 16, 2009 at 12:42 AM, solussd wrote:
> I just finished an implementation of the Conway's Game of Life
> derivative, Highlife, in Clojure. It consists of a simple swing GUI
> and makes good use of Refs for coordinating grid updates. A more
> detailed description, source, and jars can b
On Sun, Nov 15, 2009 at 8:28 PM, Rich Hickey wrote:
> On Sun, Nov 15, 2009 at 4:49 AM, ajuc wrote:
> > On 15 Lis, 00:21, John Harrop wrote:
> >> On Sat, Nov 14, 2009 at 3:03 PM, ajuc wrote:
> >> > I have to install java one more time, when I try to sta
On Mon, Nov 16, 2009 at 2:16 AM, Michael Wood wrote:
> This is what I get with or without rlwrap from the command line. No
> IDE or anything like that:
>
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> ; some comment
> user=> #! something
> (println "blah")
> blah
> nil
> user=>
>
> i.e. the same as Dav
On Sun, Nov 15, 2009 at 8:17 PM, David Brown wrote:
> On Sun, Nov 15, 2009 at 04:20:19PM -0500, John Harrop wrote:
>
> >That's weird. It's not documented anywhere on the site. And it seems to
> hang
> >the REPL:
> >
> >user=> nil #!foo
> >
&
On Sun, Nov 15, 2009 at 7:32 PM, Alex Osborne wrote:
> ajuc wrote:
> > I would like to somehow hide the global hilbert-map into my function,
> > but I can't see how to do that.
> >
> > Is this possible? I know that I can just inert literal into my let,
> > but that degrades performance, when func
Interesting. It looks like Clojure's missing a few obvious optimizations,
and is reconstructing the literal structure each time the function is
called, or each time the value is used if the literal is directly at point
of use.
On the other hand, deref of a global is not exactly blindingly fast eit
On Sun, Nov 15, 2009 at 8:45 AM, Michael Wood wrote:
> 2009/11/14 John Harrop :
> > On Sat, Nov 14, 2009 at 1:42 PM, Richard Newman
> wrote:
> >>
> >> I like CL's package support for this kind of situation, where
> >> unexported symbols can still be
On Sat, Nov 14, 2009 at 6:03 PM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 14.11.2009 um 20:31 schrieb John Harrop:
>
>
> For situations like this, I find it handy to discover what reader-macros
>> are expanding to. This works well:
>>
>> user=>(defmacro expan
On Sun, Nov 15, 2009 at 4:49 AM, ajuc wrote:
> On 15 Lis, 00:21, John Harrop wrote:
> > On Sat, Nov 14, 2009 at 3:03 PM, ajuc wrote:
> > > I have to install java one more time, when I try to start java -
> > > server, I get:
> > > Error: no `server
On Sat, Nov 14, 2009 at 3:24 PM, John Harrop wrote:
> On Sat, Nov 14, 2009 at 2:51 PM, Kevin Q wrote:
>
>> Hi,
>> Thanks for the hint. I tried (map deref agents) and it did work. I
>> don't know if this is a bug?
>
>
> Nah, it's just being really sneak
On Sat, Nov 14, 2009 at 2:51 PM, Kevin Q wrote:
> Hi,
> Thanks for the hint. I tried (map deref agents) and it did work. I
> don't know if this is a bug?
Nah, it's just being really sneaky.
> > (fn* [p1__6536] ((clojure.core/deref p1__6536)))
>
Even I didn't notice it before. There's an extr
On Sat, Nov 14, 2009 at 3:03 PM, ajuc wrote:
> I have to install java one more time, when I try to start java -
> server, I get:
> Error: no `server' JVM at `F:\Program Files\Java\jre6\bin\server
> \jvm.dll
>
You need to use the one in F:\Program Files\Java\jdk6 instead.
I'm surprised your IDE
On Sat, Nov 14, 2009 at 1:42 PM, Richard Newman wrote:
> I like CL's package support for this kind of situation, where
> unexported symbols can still be reached via foo::bar, at the cost of
> an obvious "code smell".
This suggests an alternate fix for the private functions in macros problem:
1
On Sat, Nov 14, 2009 at 12:49 PM, Kevin Q wrote:
> I have a list of agents, each of which has a hasmap state. I want to
> get a list of values from the list of agents, naturally I used the map
> function and print the result of the map:
>
> (println
> (map #(@%) agents))
>
> However, when I run
On Sat, Nov 14, 2009 at 2:11 PM, John Harrop wrote:
> On Sat, Nov 14, 2009 at 11:42 AM, André Thieme <
> splendidl...@googlemail.com> wrote:
>
>> Dereferencing *persons* will result in:
>> {"Tina" #,
>> "Jeff" #,
>> "Karl&
On Sat, Nov 14, 2009 at 11:42 AM, André Thieme
wrote:
> Dereferencing *persons* will result in:
> {"Tina" #,
> "Jeff" #,
> "Karl" #}
> Great so far.
>
> People can become friends, so we need
> (defn add-friend [#^String person #^String friend]
> (dosync
>(let [p (get @*persons* person)
>
On Sat, Nov 14, 2009 at 6:19 AM, ajuc wrote:
> > > I would like to somehow hide the global hilbert-map into my function,
> > > but I can't see how to do that.
> >
> > Just put the literal directly into the function.
> >
> > > Is this possible? I know that I can just inert literal into my let,
> >
On Sat, Nov 14, 2009 at 8:55 AM, Albert Cardona wrote:
> On Fri, Nov 13, 2009 at 11:26 PM, Mike Hogye
> wrote:
> > Why is there an easy way to def a private function (defn-), but no
> > similarly easy way to def an arbitrary var as private?
>
>
> The way I see it, def- would encourage gratuitous
On Sat, Nov 14, 2009 at 3:45 AM, Mark Engelberg wrote:
> On Fri, Nov 13, 2009 at 12:58 AM, Konrad Hinsen
> wrote:
> > Coming from a Python background, I don't think access restrictions are
> > necessary. However, flagging fields as "not meant for use by
> > outsiders" could be of interest for doc
On Fri, Nov 13, 2009 at 8:50 PM, Mark Engelberg wrote:
> Rich, thanks for the extended explanation of the overlap between the
> old and new constructs; I found this explanation much clearer than
> what is currently on the wiki. Basically, the key for me was
> realizing that these new constructs a
On Fri, Nov 13, 2009 at 6:48 PM, ajuc wrote:
> Hello.
>
> I've tried to translate nice Hilbert-curve-index calculating function
> to clojure (http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-
> Spatial-indexing-with-Quadtrees-and-Hilbert-Curves).
>
> I've got sth like that:
>
> (def hilbert-ma
On Fri, Nov 13, 2009 at 1:23 PM, Chouser wrote:
> On Wed, Nov 11, 2009 at 4:24 PM, John Harrop wrote:
> > One question: how would Java class imports be dealt with? I think it
> should
> > be unified:
> > (ns foo
> > (uses java.io :only [File FileInputStream] :as
On Wed, Nov 11, 2009 at 10:46 PM, Kevin Tucker wrote:
> Yeah, sorry, missed that.
>
> How does making the gensyms unreadable make things worse for
> macroexpand than they are in CL?
It doesn't. Just worse than they currently are in Clojure. :)
--
You received this message because you are subsc
On Wed, Nov 11, 2009 at 2:04 PM, Nick Day wrote:
> Hi,
>
> I've been trying to implement a topological sort and have been
> struggling a bit. I have a map of symbol vs collection of symbols
> like:
>
> {a [b c], b [c], c [nil]}
>
> which can be read as 'a' depends on 'b' and 'c', 'b' depends on '
On Wed, Nov 11, 2009 at 3:54 PM, Laurent PETIT wrote:
> 2009/11/11 Andrew Boekhoff :
> >> > (:uses [clojure.core :exclude [read])
> >> > [clojure.contrib.graph]
> >> > [clojure.contrib.fcase]
> >> > [clojure.contrib.stream-utils :as su]
> >> > [clojure.contrib.def
On Wed, Nov 11, 2009 at 1:12 PM, Stephen C. Gilardi wrote:
> Before:
>
> (:refer-clojure :exclude [read])
> (:require (clojure.contrib [graph :as graph] [fcase :as fcase])
>[clojure.contrib.stream-utils :as su])
> (:use [clojure.contrib def except server-socket]
>clojure.con
On Tue, Nov 10, 2009 at 9:11 PM, Richard Newman wrote:
> > (ns foo.bar.baz
> > (:use [clojure.contrib.core :only (seqable?)]))
> >
> > (and thus violates the usual clojure rule of using vectors rather
> > than lists for groupings that are not invocations -- that is,
> > function calls, macro ca
So I have
(ns foo.bar.baz)
and I want to grab clojure.contrib.core/seqable?
What do I do?
(ns foo.bar.baz
(use clojure.contrib.core :only seqable?))
#
(ns foo.bar.baz
(use [clojure.contrib.core :only seqable?]))
#
(ns foo.bar.baz
(:use [clojure.contrib.core :only seqable?]))
#
etc.
On Tue, Nov 10, 2009 at 11:41 AM, John Harrop wrote:
> user=> (take 10 (p-lazy-seq 3 true (thread-local-rand 10)))
> (1 2 6 1 5 1 7 8 4 3)
>
> This should generate the random numbers on multiple threads, using multiple
> RNGs. In the limit, on multicore hardware and with
On Tue, Nov 10, 2009 at 10:41 AM, pmf wrote:
> On Nov 10, 7:07 am, David Brown wrote:
> > Ok. So, it's the existence of this future-like entity that blocks
> > upon deref until filled is indeed somewhat missing. It's not
> > particularly difficult to implement.
> >
> > This thing could easily
On Tue, Nov 10, 2009 at 7:21 AM, Rich Hickey wrote:
> Right - pervasive locals clearing will definitely do the trick here.
> Interestingly, when I was at Microsoft and asked them about handling
> this issue for the CLR they stated plainly it wasn't an issue at all -
> their system can fully detec
On Tue, Nov 10, 2009 at 1:00 AM, Richard Newman wrote:
> > I have a vector a [ [2 3] [4 5] [6 7] ]
> >
> > And I want to be able to get [2 3 4 5 6 7]
>
> user=> (reduce into [ [2 3] [4 5] [6 7] ])
> [2 3 4 5 6 7]
>
This and another solution have already been posted, but there's also:
(vec (appl
On Mon, Nov 9, 2009 at 10:04 PM, Kevin Tucker wrote:
> I in CL they can be read but aren't interned in any package so every
> time you read it you get a different symbol.
Yes, I know; I said that myself in the first post. But your first post
inspired in me the idea of simply making symbols that
On Mon, Nov 9, 2009 at 10:37 PM, Mark Engelberg wrote:
> Yes, it's in Clojure 1.0, it just doesn't have a convenient name.
>
> So give it a convenient name like this:
> (def empty-queue clojure.lang.PersistentQueue/EMPTY)
>
> and then you're ready to go.
>
> conj, peek, pop, into and all the other
On Mon, Nov 9, 2009 at 8:53 PM, Mark Engelberg wrote:
> On Mon, Nov 9, 2009 at 5:41 PM, John Harrop wrote:
> > In the meantime, the main thing still missing from Clojure is a
> convenient
> > queue.
>
> What's wrong with clojure.lang.PersistentQueue?
There is one?
On Mon, Nov 9, 2009 at 8:41 PM, John Harrop wrote:
> In the meantime, the main thing still missing from Clojure is a convenient
> queue. Lists and vectors both add and remove efficiently only at one end,
> and at the same end for add and remove in both cases. Doubly-linked lists
> c
On Mon, Nov 9, 2009 at 8:28 PM, John Harrop wrote:
> Why not:
>
> static public Object contains(Object coll, Object key){
> if(coll == null)
> return F;
> else if(coll instanceof Map)
> return ((Map) coll).containsKey(key) ?
1 - 100 of 359 matches
Mail list logo