On 31.12.2008, at 17:56, Rich Hickey wrote:
>> Does the Clojure compiler calculate the constant expression (. Math
>> log 0.5) once, or at every function call?
>
> Every call. Clojure does not know that Math/log is a pure function.
OK, then I'll use this near-trivial macro:
(defmacro const
"
On 01.01.2009, at 01:19, Mark Engelberg wrote:
> and pasted below. I'd like to hear some comments on whether I'm
> utilizing multimethods correctly,
I can't say, being new to multimethods as well, but...
> and whether functions like this
> would be beneficial for inclusion in the clojure contr
Thanks Chouser,
Happy new year!
sun
On Jan 1, 12:37 am, Chouser wrote:
> On Wed, Dec 31, 2008 at 11:41 PM, wubbie wrote:
>
> > Hi all,
>
> > what's the new syntax for this?
> > It is part of the code below which was translation by Stu.
>
> That's a nifty little function. This just fixes the
I got repl to start with a small change to swank-clojure:
http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779ad6e79e37a44d84432
On Thu, Jan 1, 2009 at 1:44 AM, Mark Hoemmen wrote:
> I've been having trouble with Emacs + SLIME + Clojure. I've been
> using Bill Clementson's
Hello and happy new year,
I've started this year with playing around with clojure macros and
wrote a macro that
behaves in a way I don't understand:
(defmacro foo
([x] `(list ~x ~x))
([x n] (if (<= n 0)
`(foo ~x)
`(foo ~(foo x)
~(- n 1)
(foo :a 0)
Hello,
just a follow up: I discovered that I sent the macro def twice and
than applied the macro. If the first time the defmacro is evaluated
then the resulting macro works as I expected. But when I send the same
defmacro a second time to the interpreter, the macro behaves as
described below.
Can
On Jan 1, 2009, at 5:45 AM, synphonix wrote:
>
> Hello and happy new year,
>
> I've started this year with playing around with clojure macros and
> wrote a macro that
> behaves in a way I don't understand:
>
> (defmacro foo
> ([x] `(list ~x ~x))
> ([x n] (if (<= n 0)
> `(foo ~x)
>
Thanks a lot.
This year starts well (I learned something :-)
Regards
Poul
--~--~-~--~~~---~--~~
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
To unsubscribe
I hesitate to extend this unpleasant thread, but here's a relevant
post that definitely takes a stand on the commenting issue:
http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html
As usual with Steve, it's a funny post, so I hope nobody takes it too
seriously :)
Hugh
On Wed, Dec 31,
Dear vimming Clojurians,
a long overdue release of VimClojure is available. This is
mainly a bugfix and maintenance release. It brings the
highlighting, indenting and completion up-to-date with
current Clojure. Highlighting for contrib is there for a few
modules, but it's far from being complete.
HotSpot folds FP constants in a few rare cases, and I don't thing
Math.log is one of them. For instance you can't fold "x+0.0" into "x"
in case "x" happens to be negative 0. Math.log is a pure function so
it would be possible, but I don't think it made the short-list of hot
FP functions to optim
Yes, this does work too. I'll forward on your patch to Jeffrey.
Thanks,
Bill
On Thu, Jan 1, 2009 at 5:55 AM, Remco van 't Veer wrote:
>
> I got repl to start with a small change to swank-clojure:
>
>
> http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779ad6e79e37a44d84432
>
>
It should be noted that (in order to use the new slime-repl mods (if
you download the latest slime and apply Remco's patch), you will have
to modify your .emacs startup to include the following:
(slime-setup '(slime-repl))
- Bill
On Thu, Jan 1, 2009 at 11:40 AM, Bill Clementson wrote:
> Yes, th
The amount of comments is difficult to balance and yes as you get more
experience, you'd rather cram
as much code lines in a screen shot as possible. 0 comments ? No that's
not good. The other extreme he shows
is also not viable. If maintaining the comments takes as much time as
maintaining the co
Konrad and Cliff -- both useful replies, thank you :-)
Happy New Year everyone!
mfh
--~--~-~--~~~---~--~~
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
To un
Given that there's nothing like letrec in Clojure, and that let acts
like let* in CL, I gather that local recursive functions are possible
whereas local mutually recursive ones are not. Is that correct? If so,
will they ever be in the future?
Rock
--~--~-~--~~~---~--~
Hi!
Just noticed nice article Parallel Universe in Technology Review which
mentioned Clojure on page 4
http://www.technologyreview.com/computing/21806/page4/.
Regards,
DiG
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
On Jan 1, 5:55 am, "Remco van 't Veer" wrote:
> I got repl to start with a small change to swank-clojure:
>
> http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779a...
I changed that one line to say
(defslimefn create-repl [target] '(user user))
and the SLIME repl works, but th
On Thursday 01 January 2009 11:47, Rock wrote:
> Given that there's nothing like letrec in Clojure, and that let acts
> like let* in CL, I gather that local recursive functions are possible
> whereas local mutually recursive ones are not. Is that correct? If
> so, will they ever be in the future?
Hi,
For some reason the Classname/staticField macro is not working
properly for me.
graphics=> (AudioSystem/getSystem)
#
graphics=> AudioSystem/getSystem
java.lang.Exception: No such namespace: AudioSystem (NO_SOURCE_FILE:0)
I'll try and demonstrate the problem using one of the standard
librari
On Jan 1, 10:19 pm, CuppoJava wrote:
> Hi,
> For some reason the Classname/staticField macro is not working
> properly for me.
>
> graphics=> (AudioSystem/getSystem)
> #
>
> graphics=> AudioSystem/getSystem
> java.lang.Exception: No such namespace: AudioSystem (NO_SOURCE_FILE:0)
getSystem is a f
According to this page:
http://wikis.sun.com/display/HotSpotInternals/PerformanceTechniques
Sun HotSpot is able to recognize constants in local variables, and I
recall to have read somewhere that most if not all Math.* functions
are intrinsic, so it should theoretically be possible.
However, I d
On Thursday 01 January 2009 14:02, pmf wrote:
> On Jan 1, 10:19 pm, CuppoJava wrote:
> > Hi,
> > For some reason the Classname/staticField macro is not working
> > properly for me.
> >
> > graphics=> (AudioSystem/getSystem)
> > #
> >
> > graphics=> AudioSystem/getSystem
> > java.lang.Exception: N
Hi there,
I've been playing around with a few different approaches to writing
concurrent programs in clojure, and I was surprised that a trivial use
of pmap results in a RejectedExecutionException:
(pmap #(* % %) (range 0 10))
This exception tends to happen in java when there is a thread pool
e
On Thu, Jan 1, 2009 at 2:47 PM, Rock wrote:
>
> Given that there's nothing like letrec in Clojure, and that let acts
> like let* in CL, I gather that local recursive functions are possible
> whereas local mutually recursive ones are not. Is that correct? If so,
> will they ever be in the future?
On Thu, Jan 1, 2009 at 5:32 PM, Paul Mooser wrote:
>
> I've been playing around with a few different approaches to writing
> concurrent programs in clojure, and I was surprised that a trivial use
> of pmap results in a RejectedExecutionException:
>
> (pmap #(* % %) (range 0 10))
Works for me, SV
>From a quick glance at the sources, I would not expect the scenario I
described above to result in this. I'm going to see if I can wrangle a
debugger into working with clojure (JSwat doesn't seem to perform well
on my system, and I'm hoping I'll have better luck in Eclipse), and
then see why spec
Bingo - that fixed it. Sorry I didn't check that earlier.
On Jan 1, 3:22 pm, Chouser wrote:
> Works for me, SVN 1193
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send emai
On Thu, Jan 1, 2009 at 11:48 PM, Chouser wrote:
>
> On Thu, Jan 1, 2009 at 2:47 PM, Rock wrote:
>>
>> Given that there's nothing like letrec in Clojure, and that let acts
>> like let* in CL, I gather that local recursive functions are possible
>> whereas local mutually recursive ones are not. Is
On Jan 1, 2009, at 4:05 PM, Mark H. wrote:
Once I dismiss the exception, the repl itself works fine.
Thanks y'all!
I don't know how to fix it, but it appears to be related to the
synchronization of the notion of the current namespace between swank
and slime. This incantation works around
On Thu, Jan 1, 2009 at 6:40 PM, Christian Vest Hansen
wrote:
>
> On Thu, Jan 1, 2009 at 11:48 PM, Chouser wrote:
>>
>> On Thu, Jan 1, 2009 at 2:47 PM, Rock wrote:
>>>
>>> Given that there's nothing like letrec in Clojure, and that let acts
>>> like let* in CL, I gather that local recursive func
> I assume you meant "are not possible". I think someone previously
> posted a letrec macro using something he called a "Y* combinator". I
> don't know what that is, but he said it was slow.
http://groups.google.com/group/clojure/browse_thread/thread/3259f09e08be4cfd/21f0e19fdce15ae9?lnk=gst&q=
On Thu, Jan 1, 2009 at 1:05 PM, Mark H. wrote:
>
> On Jan 1, 5:55 am, "Remco van 't Veer" wrote:
>> I got repl to start with a small change to swank-clojure:
>>
>> http://github.com/remvee/swank-clojure/commit/ed89d6997bce3c5076e779a...
>
> I changed that one line to say
>
> (defslimefn create-
On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
Or is there some other "dynamic
documentation for a function" that you're referring to?
For me, it throws the exception when I type a space and SLIME tries to
look up the arguments for the current function. For example, in a
fresh SLIME r
I got the newest SVN version of Clojure and compiled it, and I
installed Emacs and slime and everything like I was instructed (:p).
The REPL and everything works fine, but when I use slimes "Compile
File" button, it simply replies "Compilation failed: 0 errors 0
warnings 0 notes" and I can't fig
On Jan 1, 5:44 pm, "Stephen C. Gilardi" wrote:
> On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
>
> > Or is there some other "dynamic
> > documentation for a function" that you're referring to?
>
> For me, it throws the exception when I type a space and SLIME tries to
> look up the argument
I've added shell-out to clojure-contrib, with an 'sh' function that
allows usage like:
user=> (use '[clojure.contrib.shell-out :only (sh)])
nil
user=> (print (sh "ls" "-l"))
total 1316
drwxrwxr-x 5 chouser chouser4096 2008-12-16 11:32 classes
drwxrwxr-x 3 chouser chouser4096 2008-12-02 11
Hi all,
I'm happy to announce an alpha release of clj-backtrace, a library for
processing backtraces generated by Clojure programs. The library works
by separating useful backtrace information from the noise generated by
the Clojure compilation process, and also provides functions for
pretty-prin
Let's say that I have a parser library--let's call it FnParse--that I
want to share with the world and let others use. If it requires
another library, say, clojure.contrib.test-is, is there a way for me
to indicate that that library is required? Or is the only thing I may
do is indicate it in the
I'm trying to write a simple macro that will do CL-style call tracing
for me. When I try to use it, however, I'm getting an
"ExceptionInInitializerError." I don't know what this actually means,
though I'm sure I'm just doing something very stupid. I was hoping
someone on this list could help po
On Thu, Jan 1, 2009 at 6:02 PM, Mark H. wrote:
>
> On Jan 1, 5:44 pm, "Stephen C. Gilardi" wrote:
>> On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
>>
>> > Or is there some other "dynamic
>> > documentation for a function" that you're referring to?
>>
>> For me, it throws the exception when
On Jan 1, 2009, at 9:31 PM, samppi wrote:
Let's say that I have a parser library--let's call it FnParse--that I
want to share with the world and let others use. If it requires
another library, say, clojure.contrib.test-is, is there a way for me
to indicate that that library is required? Or is t
On Jan 1, 2009, at 9:48 PM, Bill Clementson wrote:
Looks like the correct patch to basic.clj should be:
(defslimefn create-repl [target] '("user" user))
That works great for me. Thanks very much!
--Steve
smime.p7s
Description: S/MIME cryptographic signature
I want to get a seq of successive rests of the given seq:
user> (defn f [seq]
(if (empty? seq)
nil
(lazy-cons seq (f (rest seq)
#'user/f
user> (f '(1 2 3 4))
((1 2 3 4) (2 3 4) (3 4) (4))
user> (take 10 (map #(take 5 %) (f (iterate inc 1
((1 2 3 4 5) (2 3 4 5 6) (3 4 5 6 7) (4 5 6 7 8)
cool :)
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.c
On Jan 1, 6:48 pm, "Bill Clementson" wrote:
> Looks like the correct patch to basic.clj should be:
> (defslimefn create-repl [target] '("user" user))
That fixes everything -- thank you :-D
mfh
--~--~-~--~~~---~--~~
You received this message because you are subscr
Ah I see. Thanks for clearing that up for me. I didn't realize that
functions and fields are resolved differently by that macro.
Randall, that function is actually not part of the JDK, it's part of
JME, a third-party graphics package. But thank you for helping.
-Patrick
--~--~-~--~~
What do you think about adding these new reader macros:
!form => (complement form)
#!(...) => (fn [args] (complement (...)))
Two problems I see with these macros are the hassle to the reader with
names that include '!' (e.g. set!, swap!), and the possible confusion
of meaning with (not form) to
(This is sort of a follow-up to this thread from last July:
http://groups.google.com/group/clojure/browse_thread/thread/7f5cf3e78954b81d/aae7f082c51337c9?lnk=gst&q=proxy#aae7f082c51337c9.)
Recently, I've been building a version of java.io.Writer that knows
what the
current column is on the output
Oops, sorry about the wrapping!
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
clojure+uns
Hi, I was experimenting with clojure-contrib's sql features and found
that there wasn't any update-values function. I've written my own and
I'm sharing it here:
(defn update-values [table where column-names & values]
"Update columns of a table with values. columns-names is a vector of
column
51 matches
Mail list logo