On 22.01.2009, at 19:50, Rich Hickey wrote:
>>
>> Does that mean that calling seq on a stream converts the stream into
>> a seq for all practical purposes? That sounds a bit dangerous
>> considering that so many operations in Clojure call seq implicitly.
>> One can easily have a seq "steal" a str
The power set of a set S is defined as the set of all subsets of S.
Here is one possible implementation of a powerset function. To stay
true to the spirit of the above definition, I've written it in a way
that manipulates the sets in set form as much as possible (not quite
an easy task since thi
Interesting. Are u sure joda-time is so widely in usage among java
developers ?
Anyway, as far as I remember, one of the benefits of clojure running
on an existing VM (the JVM) is to leverage all the existing APIs.
Since the date/time support would be in clojure-contrib (and not
clojure-core), c
Hello,
As per the docs for keywords ( http://clojure.org/reader ), keywords
cannot contain '.'.
"They cannot contain '.' or name classes."
However, the following works on the repl:
user=> :..
:..
user=> (keyword? :..)
true
Are '.'s allowed and the docs need updating? Or should
we see an excep
On 23.01.2009, at 09:35, Mark Engelberg wrote:
> Now, here's the puzzle. Let's say you want to convert this idea over
> to working with lists, or perhaps sequences in general.
>
> Should (powerset '(1 2 3)) print as:
> (() (1) (2) (3) (1 2) (1 3) (2 3) (1 2 3))
> or
> (nil (1) (2) (3) (1 2) (1 3
On Jan 23, 11:24 am, e wrote:
> wow. I wonder if I could use this for the quicksort I was talking about.
Interesting question. I can't think of an elegant way to implement an
agent based parallel quicksort because await cannot be used
recursively. So I implemented a version using Futures inst
Rich Hickey a écrit :
> Again, I don't see the enormous side effect. Steams form a safe,
> stateful pipeline, you'll generally only call seq on the end of the
> pipe. If you ask for a seq on a stream you are asking for a (lazy)
> reification. That reification and ownership is what makes the p
Christophe Grand a écrit :
> I relaxed the constraint saying that "a stream ensures that /*every call
> to seq on a stream will return the same seq" to be */"a stream ensures
> that /*every call to seq on a stream will return the same seq as long as
> the stream state doesn't change".*/
> /*Wha
Christophe Grand a écrit :
> I relaxed the constraint saying that "a stream ensures that every call
> to seq on a stream will return the same seq" to be "a stream ensures
> that every call to seq on a stream will return the same seq as long as
> the stream state doesn't change".
Well currently
Parth Malwankar a écrit :
> Hello,
>
> As per the docs for keywords ( http://clojure.org/reader ), keywords
> cannot contain '.'.
>
> "They cannot contain '.' or name classes."
>
>
http://groups.google.com/group/clojure/msg/eac27b0bd6f823f7
Rich Hickey: "As far as '.', that restriction has bee
I don't think the function passed to "some" should be called a
predicate, since it is not constrained to true/false. The docstring
agrees with you, however.
Stuart
> Hi,
>
> It means that some of the maps can be nil, but at least one of them
> has to be non-nil. "some" requires a predicate,
The power set function for lists should use () as the empty set. If
you use nil, then it seems that you would have
(powerset nil) => (nil)
but this is wrong, since the only subset of an empty set is the empty
set. You could try to fix this by making
(powerset nil) => nil
but then your functi
On Jan 23, 8:41 am, lpetit wrote:
> Interesting. Are u sure joda-time is so widely in usage among java
> developers ?
I use it and so do all my friends :)
I believe there are moves afoot to get it included in the JDK sooner
or later.
https://jsr-310.dev.java.net/
--~--~-~--~~-
This is just something contrived I was playing around with and I know
it is silly. I just have a couple of questions about it.
(defn create-a [firstName lastName]
(defn getFirstName [] firstName)
(defn getLastName [] lastName)
(fn [operator & operands]
(apply operator operands)))
(def
Thanks. I really appreciate seeing that example. There are more answers
there than even the original question . . . like how easily you time the
performance and how easily you make random lists of values. . . .also the
use of "remove" in that code you grabbed to avoid having two filters is
totall
Hi Kurt,
Am 23.01.2009 um 05:23 schrieb zoglma...@gmail.com:
> (defn create-a [firstName lastName]
> (defn getFirstName [] firstName)
> (defn getLastName [] lastName)
> (fn [operator & operands]
>(apply operator operands)))
It's important to note that, regardless of the lexical context,
On Fri, Jan 23, 2009 at 5:30 AM, AndrewC. wrote:
>
> On Jan 23, 8:41 am, lpetit wrote:
>> Interesting. Are u sure joda-time is so widely in usage among java
>> developers ?
>
> I use it and so do all my friends :)
>
> I believe there are moves afoot to get it included in the JDK sooner
> or late
+1.
#{} is the empty set, () is the empty list, {} is the empty map.
Cheers,
--
Laurent
On 23 jan, 10:17, Konrad Hinsen wrote:
> On 23.01.2009, at 09:35, Mark Engelberg wrote:
>
> > Now, here's the puzzle. Let's say you want to convert this idea over
> > to working with lists, or perhaps seq
Or try the IntelliJ plugin, if you like that IDE
http://code.google.com/p/clojure-intellij-plugin/
It works fine on Windows and Linux. We are currently fixing the Mac.
P
Matt Clark wrote:
> If you're not already an emacs user, I found it can be quite the
> learning curve getting into it. So
Hi,
On 23 jan, 01:43, Peter Wolf wrote:
> Hi Laurent,
> 1) Does Eclipse use the server for resolving references?
Currently, the only resolved references are those that come from a
clojure environment launched by the user. So yes.
When time comes to resolve references for the needs of the editor
On 23 jan, 03:00, Stuart Sierra wrote:
> On Jan 22, 6:51 pm, Peter Wolf wrote:
>
> > However, if there is only one Clojure image used for references and the
> > like, what happens if someone calls an infinite loop, or infinite
> > recursion, in a file. Does the Clojure server hang/blow up?
>
Hi Achim,
I think I understand now.
> It's important to note that, regardless of the lexical context, def(n)
> creates global/top-level definitions (contrary to scheme, i believe).
>
(defn create-a [firstName lastName]
(defn getFirstName [] firstName)
(defn getLastName [] lastName)
(fn
On Jan 23, 3:31 am, Konrad Hinsen wrote:
> On 22.01.2009, at 19:50, Rich Hickey wrote:
>
>
>
> >> Does that mean that calling seq on a stream converts the stream into
> >> a seq for all practical purposes? That sounds a bit dangerous
> >> considering that so many operations in Clojure call seq
On Fri, Jan 23, 2009 at 7:20 AM, Mark Volkmann
wrote:
>
> On Fri, Jan 23, 2009 at 5:30 AM, AndrewC. wrote:
>>
>> On Jan 23, 8:41 am, lpetit wrote:
>>> Interesting. Are u sure joda-time is so widely in usage among java
>>> developers ?
>>
>> I use it and so do all my friends :)
>>
>> I believe t
Looking for opinions from Clojure internals Wizards...
I am thinking about "safe loading" for IDEs (see other thread). IDEs
need a way to load and resolve code, without calling script code that
might be in the file.
I was looking the code called by load-file and load. Here is
Compiler.eval(
On Fri, Jan 23, 2009 at 7:56 AM, zoglma...@gmail.com
wrote:
>
>> It's important to note that, regardless of the lexical context, def(n)
>> creates global/top-level definitions (contrary to scheme, i believe).
>>
>
> (defn create-a [firstName lastName]
> (defn getFirstName [] firstName)
> (defn
On Jan 23, 4:53 am, Christophe Grand wrote:
> Christophe Grand a écrit :> I relaxed the constraint saying that "a stream
> ensures that /*every call
> > to seq on a stream will return the same seq" to be */"a stream ensures
> > that /*every call to seq on a stream will return the same seq as l
On Jan 22, 11:17 am, Konrad Hinsen wrote:
> On 22.01.2009, at 16:27, Rich Hickey wrote:
>
> >> Now it works - fine. But what happened to the seq that now owns the
> >> stream? Nothing refers to it, so it should be gone.
>
> > No, the stream must refer to it, in order to keep its promise to
> >
On Fri, Jan 23, 2009 at 7:12 AM, Chouser wrote:
>
> On Fri, Jan 23, 2009 at 7:20 AM, Mark Volkmann
> wrote:
>>
>> On Fri, Jan 23, 2009 at 5:30 AM, AndrewC. wrote:
>>>
>>> On Jan 23, 8:41 am, lpetit wrote:
Interesting. Are u sure joda-time is so widely in usage among java
developers ?
Rich Hickey a écrit :
> I think you lose the game overall.
I'm sorry if I sounded provocative, I was trying to better understand
the model you propose with streams. Thanks for your answer: it made
thinks clearer to me.
> With what you are proposing:
>
> (if (seq astream)
> (do-something-with
On Jan 22, 6:16 pm, Korny Sietsma wrote:
> Hi folks,
> Is there any way to make a function that takes primitive parameters?
> It seems you can't, but I might be missing something.
> I have the following code (a start to playing with mandelbrot sets):
>
> (defn step [x0, y0, xn, yn]
> (let [xm
On Jan 23, 9:35 am, Christophe Grand wrote:
> Rich Hickey a écrit :> I think you lose the game overall.
>
> I'm sorry if I sounded provocative, I was trying to better understand
> the model you propose with streams. Thanks for your answer: it made
> thinks clearer to me.
>
> > With what you are
Since we've been discussing using the Joda Time library from Clojure
... if anyone is interested in a quick intro. to the Joda Time
library, I have a PDF of some slides I put together for a recent
project at http://www.ociweb.com/mark/programming/JodaTime.pdf.
--
R. Mark Volkmann
Object Computin
Joda Time is also a good fit for Clojure because all features in the
library have a functional implementation, whereas the current built-in
Java classes tend to use non-functional/non-threadsafe mechanisms.
- Mark M.
On Fri, Jan 23, 2009 at 9:14 AM, Mark Volkmann
wrote:
>
> On Fri, Jan 23, 2009
On Fri, Jan 23, 2009 at 9:14 AM, Mark Volkmann
wrote:
>
> I think some reasons to use Joda Time instead of new code for
> data/time calculations include:
I'm not arguing for new date-time code. I'm arguing for a good clean
functional wrapper around code that already ships with Java. What
Matt
I'm trying my hand at genetic programming. (Full post about why and
how, with code coming soon - I promise.) My current technique uses a
genetic algorithm to generate a list of symbols, numbers and other
lists of the same form. The head is the name of any of several
functions. I'm trying to figure
On Fri, Jan 23, 2009 at 9:41 AM, Mark Volkmann
wrote:
>
> Since we've been discussing using the Joda Time library from Clojure
> ... if anyone is interested in a quick intro. to the Joda Time
> library, I have a PDF of some slides I put together for a recent
> project at http://www.ociweb.com/mar
Sorry Mark, my mistake. Thanks for the correction James.
On Jan 22, 6:12 pm, James Reeves wrote:
> On Jan 22, 10:15 pm, Frank wrote:
>
> > I found two libraries written by Christophe Grand:
>
> Only Enlive was written my Christophe; Ring was written by Mark. From
> what I gather Ring is an abs
There was a recent suggestion here:
http://groups.google.com/group/clojure/msg/32d323e15f8ce624
about the proper value of:
(clojure.contrib.lazy-seqs/combinations)
(and perhaps by extension (clojure.contrib.lazy-seqs/combinations '())
(or any number of empty seq arguments))
Thanks Chouser,
No, I really didn't have any intentions with this example. I was
merely exploring around. In hindsight it is also obvious why this
works.
(defn foo[]
(defn bar [x] (* x 2))
nil)
(foo)
(bar 2)---> returns 4
I just didn't realize initially what was going on... that defn bi
Hi Zak,
I think this is a reasonable use of eval, since you're evaluating an
expression that is generated at run-time. The alternatives are messy.
-Stuart Sierra
On Jan 23, 10:20 am, Zak Wilson wrote:
> I'm trying my hand at genetic programming. (Full post about why and
> how, with code comi
If a speed boost is what you're going for, you can probably get one
from type coercion and (if you're not worried about overflow)
unchecked-math. As an example:
(defn step [x0, y0, xn, yn]
(let [dx0 (double x0)
dy0 (double y0)
dxn (double xn)
dyn (double yn)
On Jan 23, 2009, at 8:38 AM, Peter Wolf wrote:
Looking for opinions from Clojure internals Wizards...
I can think of only one Clojure internals Wizard, but I have some
thoughts.
I am thinking about "safe loading" for IDEs (see other thread). IDEs
need a way to load and resolve code, wit
Hi everybody,
I am working in a software company specialized in Eclipse based
product development (and member of the Eclipse Fundation). We are very
interesting in clojure features and we plan to use it in some of our
products. I am currently working on clojure integration in OSGi
Bundles in orde
On Jan 23, 2009, at 17:15, Stephen C. Gilardi wrote:
> I recently changed my "user.clj" file to be purely full of
> definitions. I think it fits well with the "require"/"use" model
> that reloading ought to only affect what's available to call after
> the load, not actually "do" (in the Clo
Hello Gaetan,
I'm one of the core developers of clojuredev, an open source project whose
goal is to provide clojure support for the Eclipse IDE.
What you say below is interesting, please see what I have noted inline -->
2009/1/23 gaetan
>
> Hi everybody,
>
> I am working in a software company s
On Jan 23, 2009, at 16:20, Zak Wilson wrote:
> that appear in these lists and evaluate them as code. My current
> technique looks like this:
>
> (def a)
> (def b)
> (defn try-rule [r val-a val-b]
>(binding [a val-a
> b val-b]
> (eval r)))
>
> and an example call looks
On Jan 23, 2009, at 14:04, Rich Hickey wrote:
>> Then why not make a pipeline using lazy sequences right from the
>> start? I don't see anything that I could do better with streams than
>> with lazy sequences.
>>
>
> There are a couple of advantages. First, streams are faster, at least
> 2x faste
2009/1/23 Konrad Hinsen
>
> On Jan 23, 2009, at 17:15, Stephen C. Gilardi wrote:
>
> > I recently changed my "user.clj" file to be purely full of
> > definitions. I think it fits well with the "require"/"use" model
> > that reloading ought to only affect what's available to call after
> > the loa
For those who like IntelliJ, a new version of the plugin is available.
This one has numerous fixes, but is mostly interesting because the
Debugger and Profiler work (or at least JProfiler).
The Debugger and Profiler currently treat Clojure as compiled Java, and
don't know how to go from byte
Hello,
Could you place some screenshots in a wiki page ?
I'm too lazy to install IntelliJ yet, but maybe with some appealing
screenshots I could change my mind ;-)
Thanks,
--
Laurent
2009/1/23 Peter Wolf
>
> For those who like IntelliJ, a new version of the plugin is available.
> This one
So I've noticed one of the most common questions in #clojure from
beginners is how to install SLIME. Working with SLIME can be messy
work[1], so I've written some functionality to help out with that.
If you check out my "installer" branch of clojure-mode[2] you can see
the clojure-install comman
See also this thread:
http://groups.google.com/group/clojure/browse_thread/thread/134642cc76de17f7?hl=en#
where I also proposed putting power-set in clojure.contrib. I'm just
waiting to hear back from Rich about a few potential changes to core,
and then I will dump all of my remaining proposals
people who love doing stream processing would attack an extra allocation.
On Fri, Jan 23, 2009 at 12:09 PM, Konrad Hinsen
wrote:
>
> On Jan 23, 2009, at 14:04, Rich Hickey wrote:
>
> >> Then why not make a pipeline using lazy sequences right from the
> >> start? I don't see anything that I could
Chouser writes:
> ...except of course that every external dependency is an increased
> burden on the users of any code I write. It seems likely that a
> pretty substantial percentage of use cases could be handled in a way
> that would allow either Java lib to be used underneath. That way I
> w
On Jan 23, 7:34 am, "Stephen C. Gilardi" wrote:
> There was a recent suggestion here:
>
> http://groups.google.com/group/clojure/msg/32d323e15f8ce624
>
> about the proper value of:
>
> (clojure.contrib.lazy-seqs/combinations)
>
> (and perhaps by extension (clojure.contrib.lazy-seqs
Hi,
I got the following and don't know what's wrong with it.
thanks in advance.
user=> (defn sum [ & more ]
((fn [total other]
(if other
(recur (+ total (first other)) (rest(other)))
total))
0 more))
#'user/sum
user=> (sum [1 2 3 4])
java.lang.ClassCastException: clojure.lang.Laz
Craig McDaniel writes:
>> I wonder if it wouldn't be a good idea to move the call to binding
>> fromsocket-replinto accept-fn. It seems like a reasonable default to
>> rebind *in* and *out* for the duration of the accepting function; the
>> example uses this as does my application.
>
> I'm not s
Two mistakes:
First, if you want sum to take a vector, you should remove the & from
the arglist.
Second, (rest(other)) should be (rest other).
This buys you:
user> (defn sum [more ]
((fn [total other]
(if other
(recur (+ total (first other)) (rest other))
Just to clarify: I dont' care what the type of the output is. I guess
(seq [[]]) would actually be more consistent with the existing
function. The point is that the output of 0-arg combinations should
be a seq containing an empty vector (or whatever other types, I don't
care), not an empty seq.
Thanks Jason.
Anyway I'd like to have (sum) returns 0 so I used [& more].
Is there any way to specify 0 or more args?
-sun
On Jan 23, 12:49 pm, Jason Wolfe wrote:
> Two mistakes:
>
> First, if you want sum to take a vector, you should remove the & from
> the arglist.
> Second, (rest(other)) sh
On Jan 23, 2009, at 11:52 AM, Konrad Hinsen wrote:
Some questions this raises:
- Should libs be restricted to definitions (and lib support things
like "ns" and (some kind of) "load-resource") only?
- Should the appearance of an "ns" form automatically make that
restriction enforced for the re
On Jan 23, 2009, at 12:53 PM, Jason Wolfe wrote:
Just to clarify: I dont' care what the type of the output is. I guess
(seq [[]]) would actually be more consistent with the existing
function. The point is that the output of 0-arg combinations should
be a seq containing an empty vector (or wha
Thanks for "clojure-dev" that was exaktly what i was looking for.
I have first a problem get it running, the reason was i download
EasyEclipse-JavaDesktop
on Vista it have problem both with clojure-dev and internal update,
and still i dide't install
it in "Program Files"
I removed it and downlo
On Jan 23, 2009, at 1:11 PM, Stephen C. Gilardi wrote:
I'd be interested in hearing from Chouser before making the change.
He added combinations to lazy-seqs.
I think it's quite cool that simply removing the "when" accomplishes
this.
--Steve
smime.p7s
Description: S/MIME cryptographic
Hello Laurent,
thank you for your interest.
2009/1/23 Laurent PETIT
> Hello Gaetan,
>
> I'm one of the core developers of clojuredev, an open source project whose
> goal is to provide clojure support for the Eclipse IDE.
> What you say below is interesting, please see what I have noted inline --
tree-seq assumes the root is a branch:
user=> (tree-seq (constantly false) seq [1 2 3])
([1 2 3] 1 2 3) ; I expected ([1 2 3])
Is this a bug?
Christophe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" gro
Christophe Grand a écrit :
> tree-seq assumes the root is a branch:
> user=> (tree-seq (constantly false) seq [1 2 3])
> ([1 2 3] 1 2 3) ; I expected ([1 2 3])
>
> Is this a bug?
>
I know it's documented but I don't understand why.
--~--~-~--~~~---~--~~
You rece
Hi Wubble,
Looking at the code you have above I thought I might point out that
rather than create an anonymous function inside of sum and then call
it immediately after finishing its description, you could just use the
loop/recur construct which is much more idiomatic clojure code. If you
decide
I type this expression in the REPL (trunk 1228):
user=> (let [s (.keySet {:a 1})] [(set? s) (ifn? s)])
[false false]
But I expected it to return [true true].
Is this an oversight, or is there a good reason for this behavior?
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.
--~--~
>
> On Jan 23, 2009, at 1:11 PM, Stephen C. Gilardi wrote:
>
>> I'd be interested in hearing from Chouser before making the change.
>> He added combinations to lazy-seqs.
>
> I think it's quite cool that simply removing the "when" accomplishes
> this.
Yes, exactly :) Returning nil for no-arg
Below are two operations that print (1 2 3 4). How can I do something
similar to print ("1 2 3" 4) to standard out?
(println '("1 2 3" 4))
-> (1 2 3 4)
(def x "1 2 3")
(println `(~x 4))
-> (1 2 3 4)
--Kevin Albrecht
--~--~-~--~~~---~--~~
You received this messag
thanks
-sun
On Jan 23, 1:43 pm, vthakr wrote:
> Hi Wubble,
>
> Looking at the code you have above I thought I might point out that
> rather than create an anonymous function inside of sum and then call
> it immediately after finishing its description, you could just use the
> loop/recur constru
Clojure supports functions with multiple arities (http://clojure.org/
functional_programming).
Assuming you don't actually care if you call the function with a
vector, you can do something like this:
(defn sum
([] 0)
([acc & r]
(if (nil? r)
acc
(recur (+ acc (first r)) (re
On Jan 19, 4:29 pm, Jason Wolfe wrote:
> I've been doing some OO-type Clojure programming, and have run into
> the following (quite minor) annoyance:
>
> I've defined a struct with a :class of ::Foo in namespace
> my.long.namespace.foo.
>
> In another namespace my.long.namespace.bar, I want to de
prn
On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote:
>
> Below are two operations that print (1 2 3 4). How can I do something
> similar to print ("1 2 3" 4) to standard out?
>
> (println '("1 2 3" 4))
> -> (1 2 3 4)
>
> (def x "1 2 3")
> (println `(~x 4))
> -> (1 2 3 4)
>
> --Kevin Albr
Are all of these considered "reader macros"?
; (comment)
@ (deref)
^ (get metadata)
#^ (add metadata)
' (quote)
#"..." (regex)
` (syntax quote)
~ (unquote)
~@ (unquote splicing)
#' (var quote)
#{...} (set)
#(...) (anonymous function)
Is it correct that these are not considered "reader macros"?
Ah, exactly what I was looking for, thanks.
On Jan 23, 11:15 am, Kevin Downey wrote:
> prn
>
> On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht wrote:
>
> > Below are two operations that print (1 2 3 4). How can I do something
> > similar to print ("1 2 3" 4) to standard out?
>
> > (println '(
I work for NVIDIA doing 3d graphics engines and editor platforms on
both PC and embedded platforms.
Konrad, the extra memory allocation is often the difference between
something fitting inside a cache line on a CPU and hitting main ram.
Last time I looked, I believe the difference is a factor of
2009/1/23 anderspe
>
> Thanks for "clojure-dev" that was exaktly what i was looking for.
>
> I have first a problem get it running, the reason was i download
> EasyEclipse-JavaDesktop
> on Vista it have problem both with clojure-dev and internal update,
> and still i dide't install
> it in "Prog
OK, I understand better now, I think.
Did you experience the problems you have exposed ? Or is it an anticipation
of problems ?
If so, can you expose the tests data, so that one can also experiment with
them ?
2009/1/23 Gaetan Morice
> Hello Laurent,
> thank you for your interest.
>
> 2009/1/2
Here is some code, my question relates to '(not (nil?...':
(if (not (nil? (regex-search-keyword (regex-get-text) line)))
(add-select-style styles-vec all-bold)
(add-select-style styles-vec light)))
Could I have done the following or is (not (nil? ... a better
approach.
The only two false values in Clojure are false and nil. Everything
else is logically true. If your function returns nil/false or a
result, you don't need (not (nil? (...)))
On Jan 23, 2:59 pm, BerlinBrown wrote:
> Here is some code, my question relates to '(not (nil?...':
>
> (if (not (nil? (
Is every function supposed to return something?
Of course, except for pure side-effects.
-sun
On Jan 23, 3:02 pm, Vincent Foley wrote:
> The only two false values in Clojure are false and nil. Everything
> else is logically true. If your function returns nil/false or a
> result, you don't ne
OK, if these are not wanted in core right now, will anyone sign off
for adding them to clojure.contrib?
I can't say I like the idea of having two sets of functions that do
exactly the same thing, but ... sometimes you just don't want things
to run ~1000 times slower than they should.
-Jason
--~
I installed it and it works really well,
-- thanks to the authors for their work.
btw, I installed it directly on my mac, without building it.
Francesco
On Jan 23, 6:08 pm, Peter Wolf wrote:
> For those who like IntelliJ, a new version of the plugin is available.
> This one has numerous fixe
This must be something I learned months ago and then forgot ... embarassing!
What's the easiest way to determine if a sequence contains a given value?
I thought there would be something like this: (include? [2 4 7] 4) -> true
That doesn't exist.
I know I can do this: (some #{4} [2 4 7])
Having to
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann wrote:
>
> This must be something I learned months ago and then forgot ...
> embarassing!
> What's the easiest way to determine if a sequence contains a given value?
> I thought there would be something like this: (include? [2 4 7] 4) -> true
> That d
On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson
wrote:
> On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann
> wrote:
>>
>> This must be something I learned months ago and then forgot ...
>> embarassing!
>> What's the easiest way to determine if a sequence contains a given value?
>> I thought there w
On Fri, Jan 23, 2009 at 2:39 PM, Justin Johnson
wrote:
> On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann
> wrote:
>>
>> This must be something I learned months ago and then forgot ...
>> embarassing!
>> What's the easiest way to determine if a sequence contains a given value?
>> I thought there w
And Rich Hickey writes:
> You can use the logo on the wikipedia article on Clojure, but only if
> you spell my name correctly :)
May I use the logo for the identi.ca group? ( http://identi.ca/group/clj )
Jason
--~--~-~--~~~---~--~~
You received this message beca
On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
wrote:
>
> (contains? "aeiou" letter)
>
> but that doesn't work either.
user=> (some (set "aeiou") "dn'tndthsstinkngvwls")
\i
Or, if you must,
user=> (clojure.contrib.seq-utils/includes? "aeiou" \o)
true
--Chouser
--~--~-~--~~---
On Fri, Jan 23, 2009 at 2:45 PM, Chouser wrote:
>
> On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson
> wrote:
>> On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann
>> wrote:
>>>
>>> This must be something I learned months ago and then forgot ...
>>> embarassing!
>>> What's the easiest way to determi
On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe wrote:
>
> OK, if these are not wanted in core right now, will anyone sign off
> for adding them to clojure.contrib?
>
Well, *I* want these changes you've proposed in the core, but of
course, I'm not in charge. I guess the real question is, what is
On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann
wrote:
>
> Are all of these considered "reader macros"?
[snip]
> Is it correct that these are not considered "reader macros"?
I don't see any distinction made in the code:
http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/Li
On Fri, Jan 23, 2009 at 2:52 PM, Mark Engelberg wrote:
>
> On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe
> wrote:
> >
> > OK, if these are not wanted in core right now, will anyone sign off
> > for adding them to clojure.contrib?
> >
>
> Well, *I* want these changes you've proposed in the core, b
>
> Currently, there is no way to write a function that takes/returns
> primitives, all of the signatures are Object based.
>
And please keep them so! Turtles all the way down solves many, many
problems.
For performance, whoever in need, just cache the int/float/double/etc.
values locally
On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote:
>
> On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
> wrote:
>>
>> (contains? "aeiou" letter)
>>
>> but that doesn't work either.
>
> user=> (some (set "aeiou") "dn'tndthsstinkngvwls")
> \i
Why does this work
(some (set "aeiou") "e")
but this doe
It does seem like a legitimate use for eval, at least at first glance.
The biggest problem is that using eval this way is really slow when
each rule is being tested on hundreds of inputs.
Interesting alternative, Konrad. I can probably take advantage of the
fact that all of the functions I'm call
Hi Mark,
set takes a single argument, a coll, and #{} is a literal form that
can have a variable number of args.
To make them equivalent:
(set "aeiou")
-> #{\a \e \i \o \u}
#{(seq "aeiou")}
-> #{(\a \e \i \o \u)}
Stuart
>
> On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote:
>>
>> On Fri, J
1 - 100 of 163 matches
Mail list logo