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 stream and not
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
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),
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
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) (2
On Jan 23, 11:24 am, e evier...@gmail.com 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
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
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.*/
/*What did I
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 it's
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 been relaxed.
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, but
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
On Jan 23, 8:41 am, lpetit laurent.pe...@gmail.com 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
totally
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. mr.bl...@gmail.com wrote:
On Jan 23, 8:41 am, lpetit laurent.pe...@gmail.com 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
+1.
#{} is the empty set, () is the empty list, {} is the empty map.
Cheers,
--
Laurent
On 23 jan, 10:17, Konrad Hinsen konrad.hin...@laposte.net 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
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 opus...@gmail.com 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
On 23 jan, 03:00, Stuart Sierra the.stuart.sie...@gmail.com wrote:
On Jan 22, 6:51 pm, Peter Wolf opus...@gmail.com 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
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 konrad.hin...@laposte.net 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
On Fri, Jan 23, 2009 at 7:20 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
On Fri, Jan 23, 2009 at 5:30 AM, AndrewC. mr.bl...@gmail.com wrote:
On Jan 23, 8:41 am, lpetit laurent.pe...@gmail.com wrote:
Interesting. Are u sure joda-time is so widely in usage among java
developers ?
I
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
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)
On Jan 23, 4:53 am, Christophe Grand christo...@cgrand.net 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
On Jan 22, 11:17 am, Konrad Hinsen konrad.hin...@laposte.net 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
On Fri, Jan 23, 2009 at 7:12 AM, Chouser chou...@gmail.com wrote:
On Fri, Jan 23, 2009 at 7:20 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
On Fri, Jan 23, 2009 at 5:30 AM, AndrewC. mr.bl...@gmail.com wrote:
On Jan 23, 8:41 am, lpetit laurent.pe...@gmail.com wrote:
Interesting. Are
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 ko...@sietsma.com 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]
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
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
r.mark.volkm...@gmail.com
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
On Fri, Jan 23, 2009 at 9:41 AM, Mark Volkmann
r.mark.volkm...@gmail.com 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
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
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 zak.wil...@gmail.com wrote:
I'm trying my hand at genetic programming. (Full post about why and
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,
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
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 Clojure
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 gaetan.mor...@gmail.com
Hi everybody,
I am working in a
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 like:
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
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 opus...@gmail.com
For those who like IntelliJ, a new version of the plugin is
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 command
people who love doing stream processing would attack an extra allocation.
On Fri, Jan 23, 2009 at 12:09 PM, Konrad Hinsen
konrad.hin...@laposte.netwrote:
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
On Jan 23, 7:34 am, Stephen C. Gilardi squee...@mac.com 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
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:
Craig McDaniel craig...@gmail.com 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.
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 jawo...@berkeley.edu wrote:
Two mistakes:
First, if you want sum to take a vector, you should remove the from
the arglist.
Second,
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 rest of
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
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 download
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 laurent.pe...@gmail.com
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
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
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 received
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.
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 message
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))
On Jan 19, 4:29 pm, Jason Wolfe jawo...@berkeley.edu 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
prn
On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht onlya...@gmail.com 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
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 redc...@gmail.com wrote:
prn
On Fri, Jan 23, 2009 at 11:00 AM, Kevin Albrecht onlya...@gmail.com wrote:
Below are two operations that print (1 2 3 4). How can I do something
similar to print (1 2 3 4) to
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 anders.u.pers...@gmail.com
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
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 gaetan.mor...@gmail.com
Hello Laurent,
thank you for your
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 berlin.br...@gmail.com wrote:
Here is some code, my question relates to '(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 vfo...@gmail.com 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
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 opus...@gmail.com wrote:
For those who like IntelliJ, a new version of the plugin is available.
This one
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 r.mark.volkm...@gmail.comwrote:
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
On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson
ajustinjohn...@gmail.com wrote:
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann r.mark.volkm...@gmail.com
wrote:
This must be something I learned months ago and then forgot ...
embarassing!
What's the easiest way to determine if a sequence
On Fri, Jan 23, 2009 at 2:39 PM, Justin Johnson
ajustinjohn...@gmail.com wrote:
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann r.mark.volkm...@gmail.com
wrote:
This must be something I learned months ago and then forgot ...
embarassing!
What's the easiest way to determine if a sequence
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
On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
r.mark.volkm...@gmail.com 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 chou...@gmail.com wrote:
On Fri, Jan 23, 2009 at 3:39 PM, Justin Johnson
ajustinjohn...@gmail.com wrote:
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann r.mark.volkm...@gmail.com
wrote:
This must be something I learned months ago and then forgot ...
On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe jawo...@berkeley.edu 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
On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann
r.mark.volkm...@gmail.com 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:
On Fri, Jan 23, 2009 at 2:52 PM, Mark Engelberg mark.engelb...@gmail.comwrote:
On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe jawo...@berkeley.edu
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
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 chou...@gmail.com wrote:
On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
(contains? aeiou letter)
but that doesn't work either.
user= (some (set aeiou) dn'tndthsstinkngvwls)
\i
Why does this work
(some (set
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
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 chou...@gmail.com wrote:
On
#{aeiou} is the set containing the String aeiou. You want
#{\a \e \i \o \u}
On Jan 23, 4:04 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote:
On Fri, Jan 23, 2009 at 2:51 PM, Chouser chou...@gmail.com wrote:
On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
You are more than welcome. Enjoy!
I am interested that it works on your Mac. Others have reported
problems (but not with this particular JAR). What version of Mac and
IntelliJ are you using?
Peter
Francesco Bellomi wrote:
I installed it and it works really well,
-- thanks to the
On 23.01.2009, at 19:04, Stephen C. Gilardi wrote:
is something that ultimately invokes def. On the way to invoking
def, one could also allow compiling code, but not running it,
deferring initializers until some kind of load time. Macros
present a problem with this strategy, of course,
I'm trying to implement pig latin using only what's in core in the
simplest way possible.
Does anyone see a simpler way?
I'm not happy with using three functions (some, set and str) to
determine if a letter is a vowel.
(defn pig-latin [word]
(let [first-letter (first word)]
(if (some (set
On Fri, Jan 23, 2009 at 4:04 PM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
Why does this work
(some (set aeiou) e)
but this doesn't
(some #{aeiou} e)
I thought (set ...) was equivalent to #{...}.
(hash-set ...) is equivalent to #{...}
'set' takes a single collection as an
On Fri, Jan 23, 2009 at 3:00 PM, Chouser chou...@gmail.com wrote:
On Fri, Jan 23, 2009 at 2:17 PM, Mark Volkmann
r.mark.volkm...@gmail.com 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
instead of using binding and eval, you can generate a (fn ) form, eval
it, keep the result function stuffed away somewhere and apply it
instead of calling eval all the time
On Fri, Jan 23, 2009 at 1:10 PM, Zak Wilson zak.wil...@gmail.com wrote:
It does seem like a legitimate use for eval, at
On Fri, Jan 23, 2009 at 12:23 PM, Jason Wolfe jawo...@berkeley.edu
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.
Thanks.
I
Nice :)
On Fri, Jan 23, 2009 at 2:10 PM, Jason Wolfe jawo...@berkeley.edu wrote:
On Jan 19, 4:29 pm, Jason Wolfe jawo...@berkeley.edu 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
Every clojure function returns a value. Even if it is only used for
side effects, it still has to return something (probably nil).
-Jason
On Jan 23, 12:17 pm, wubbie sunj...@gmail.com wrote:
Is every function supposed to return something?
Of course, except for pure side-effects.
-sun
On
What is an idiom to call a function and also retain the result. For
example, I see myself doing this a lot, but it seems to more code than
would be needed.
(let [a (some-func)]
(when a
(println (a dosomething
-
I wish I could avoid having to use the 'let' in this case
I guess
1 - 100 of 146 matches
Mail list logo