On Mon, Dec 1, 2008 at 9:23 AM, Andrew P. Lentvorski, Jr.
<[EMAIL PROTECTED]> wrote:
>
> I updated the gears demo port to use the new Java interop syntax. It
> runs, but it would be nice if somebody would give it a good looking at
> to make sure I didn't do anything truly stupid.
> http://clojure
I updated the gears demo port to use the new Java interop syntax. It
runs, but it would be nice if somebody would give it a good looking at
to make sure I didn't do anything truly stupid.
http://clojure.googlegroups.com/web/opengl-gears-newinterop.clj?gda=YfezkU0AAABoLitVpBTEcNIQc_NHg39SNGctvDJR-
Wonderful, thank you!
On Nov 30, 9:42 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
> As long as you have the clojure.contrib jar in your path you can do:
>
> (use 'clojure.contrib.seq-utils)
>
> (flatten [1 2 3 '(4 5 6)])
> => (1 2 3 4 5 6)
>
> On Sun, Nov 30, 2008 at 9:36 PM, samppi <[EMAIL PROT
As long as you have the clojure.contrib jar in your path you can do:
(use 'clojure.contrib.seq-utils)
(flatten [1 2 3 '(4 5 6)])
=> (1 2 3 4 5 6)
On Sun, Nov 30, 2008 at 9:36 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> For any given collection [3 2 [3 5 1] 1 [3 4 1] 0], how may I get [3 2
> 3 5 1
For any given collection [3 2 [3 5 1] 1 [3 4 1] 0], how may I get [3 2
3 5 1 1 3 4 1 0]?
Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojur
It was mentioned in the IRC channel on 30-Nov-2008 by arohner that
java.lang.Math/abs did not work for ratios and bignums. Here is a
simple patch to add an abs function into Clojure.
http://groups.google.com/group/clojure/web/abs.patch
--~--~-~--~~~---~--~~
You re
On Nov 30, 10:16 am, Paul Barry <[EMAIL PROTECTED]> wrote:
> I just watched Jim Weirich's talk from RubyConf. He does a good job
> of showing the basics of why concurrent programming is hard, and
> briefly talks about Erlang and Clojure at the end. I recommend it to
> anyone interested in Cloj
On Nov 30, 7:47 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 30, 2008 at 5:52 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Any other solutions that would avoid a helper function? Not just
> > for my particular case, but anytime that one is calling recur from a
> > catch clause
On Sun, Nov 30, 2008 at 8:26 PM, Joel L <[EMAIL PROTECTED]> wrote:
>
> Thanks! This is actually kinda close to a solution that I've just
> managed to come up with, though mine is somehow twice as long :).
> Correct me if I'm wrong, but this could eat up the stack when parsing
> a large document?
another issue would be that your function call would have to be on one line.
(the nested ones could have multiple lines, since they'd be in parens)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To p
Thanks! This is actually kinda close to a solution that I've just
managed to come up with, though mine is somehow twice as long :).
Correct me if I'm wrong, but this could eat up the stack when parsing
a large document? I'm totally fine with it for my current needs,
though I'm curious to see a so
On Sun, Nov 30, 2008 at 5:12 PM, Joel L <[EMAIL PROTECTED]> wrote:
>
> I've hit a wall trying to work with tree like data structures,
> specifically the xml-seq. I want to translate clojure.xml's xml
> representation into something close to compojure's html data
> structure.
>
> eg:
> {:tag :div
On Sun, Nov 30, 2008 at 5:52 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Any other solutions that would avoid a helper function? Not just
> for my particular case, but anytime that one is calling recur from a
> catch clause?
Generally, collect the information you need from the catch cla
On Nov 30, 2008, at 5:47 PM, Randall R Schulz wrote:
>
> On Sunday 30 November 2008 13:30, André Thieme wrote:
>> ...
>>
>> Although a standard reader macro for infix syntax would be a nice
>> thing to have in Clojure.
>> ...
>
> Am I the only person who thinks this is a dead-end proposal that
On Sun, Nov 30, 2008 at 3:54 PM, André Thieme
<[EMAIL PROTECTED]> wrote:
>
> On 30 Nov., 19:15, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
>
>> Related to this is the idea that maybe the REPL should automatically
>> wrap a line without parens with them. That way you could just enter
>> "quit" inst
On Sun, Nov 30, 2008 at 4:44 PM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> There aren't as many cases of this as I had thought.
> Here are the cases I found.
>
> cons takes an argument named "seq".
> do-seq and for take an argument named "seq-exprs".
> into-array takes an argument named "aseq".
On Nov 30, 3:51 pm, "Michael Wood" <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 30, 2008 at 9:29 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> >> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>
> >> > Even if you don't think y
On Sunday 30 November 2008 13:30, André Thieme wrote:
> ...
>
> Although a standard reader macro for infix syntax would be a nice
> thing to have in Clojure.
> ...
Am I the only person who thinks this is a dead-end proposal that should
be dropped because our BDFL will simply not consider it?
Ri
Thanks. I'll make the changes and reupload it for everybody.
As a side question: Is there anyway to make that error message
better? As a newbie, I'm pretty sure I never would have figured that
out.
--~--~-~--~~~---~--~~
You received this message because you are s
I've hit a wall trying to work with tree like data structures,
specifically the xml-seq. I want to translate clojure.xml's xml
representation into something close to compojure's html data
structure.
eg:
{:tag :div :attrs {:class "foo"}
:content
[{:tag :h1 :attrs nil :content ["Title"]}
On 30 Nov., 19:15, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> Related to this is the idea that maybe the REPL should automatically
> wrap a line without parens with them. That way you could just enter
> "quit" instead of "(quit)". That seems handy for many things. For
> example, why not enter
>
On Sun, Nov 30, 2008 at 1:33 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Sun, Nov 30, 2008 at 2:29 PM, Mark Volkmann
> <[EMAIL PROTECTED]> wrote:
>>
>> Many of the provided functions take arguments named "coll" or "seq".
>> Is the choice meant to indicate something significant about what can
>>
http://paste.lisp.org/display/71272
I try to get *ns* of where macro is expended
; It works with :
(defmacro m2 [p]
`(f2 p ~'*ns*))
(defmacro m1 [p]
`(f1 ~(m2 p)))
; But not with :
(defmacro m1 [p]
`(f1 (f2 p ~'*ns*)))
I get ns user (REPL), from where I call a test function.
I think
On 30 Nov., 20:09, Stuart Sierra <[EMAIL PROTECTED]> wrote:
> On Nov 28, 6:54 pm, Dmitri <[EMAIL PROTECTED]> wrote:
>
> > First of I'd like to say that I find Clojure to be an excellent
> > language, however I find the lack of infix operators makes reading
> > equations somewhat unnatural, eg:
>
>
Maybe (quit-clojure) instead of (quit)? This would save vanilla `quit'
just in case it's needed later/elsewhere.
Might also be nice to have (exit-clojure). Ditto saving vanilla `exit'
for other purposes
When first configuring Clojure on both linux box and windows from the
command line (e.g. pre-s
On 30 Nov., 12:49, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 30, 2008 at 12:11 AM, Jeff Bester <[EMAIL PROTECTED]> wrote:
>
> > ;; used for order of evaluation table and for valid infix operators
> > (def +precedence+
> > {'rem 5,
> > '* 4,
> > '/ 3,
> > '+ 2,
> >
On Sun, Nov 30, 2008 at 9:29 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
>> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>>
>> > Even if you don't think you'll run into the possibility of blowing
>> > your stack, it's still a
On Sun, Nov 30, 2008 at 7:28 AM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> If you're going to frequently get the latest from SVN, I suggest using
> a script like the following. It assumes you are in a directory that
> contains the subdirectories "clojure" and "clojure-contrib" that were
> initi
On Sunday 30 November 2008 09:50, Rich Hickey wrote:
> On Nov 30, 2008, at 12:14 PM, Randall R Schulz wrote:
> > ...
> >
> > Critiques welcome.
>
> I like reduce for these things. It will let you perform a
> transformation and assoc conditionally if needed:
>
> (defn ns-var-metas
>"Acquire a m
On Sun, Nov 30, 2008 at 2:29 PM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> Many of the provided functions take arguments named "coll" or "seq".
> Is the choice meant to indicate something significant about what can
> be passed? As far as I know, every collection can be treated as a
> sequence.
On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>
> > Even if you don't think you'll run into the possibility of blowing
> > your stack, it's still a good idea to use recur when doing tail call
> > recursion. The compiler will help you
Many of the provided functions take arguments named "coll" or "seq".
Is the choice meant to indicate something significant about what can
be passed? As far as I know, every collection can be treated as a
sequence. Maybe the opposite isn't true.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-
On Sun, Nov 30, 2008 at 1:20 PM, Stuart Sierra
<[EMAIL PROTECTED]> wrote:
>
> On Nov 30, 7:22 am, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
>> Is there a rule of thumb to apply when deciding whether to separate
>> multiple words in a function name with hyphens?
>> I can't detect a pattern in how
On Nov 30, 7:22 am, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> Is there a rule of thumb to apply when deciding whether to separate
> multiple words in a function name with hyphens?
> I can't detect a pattern in how this was decided for many provided functions.
> Here are some examples that use h
On Nov 28, 6:54 pm, Dmitri <[EMAIL PROTECTED]> wrote:
> First of I'd like to say that I find Clojure to be an excellent
> language, however I find the lack of infix operators makes reading
> equations somewhat unnatural, eg:
Hi, Dmitri,
Glad you like Clojure! There are Common Lisp packages like
It's very handy to be able to type in a symbol at the REPL and see its value.
On Sun, Nov 30, 2008 at 10:15 AM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> On Sun, Nov 30, 2008 at 10:35 AM, Paul Barry <[EMAIL PROTECTED]> wrote:
>>
>> It's a minor thing, but wouldn't it be a good idea to put (de
On Nov 30, 1:15 pm, "Mark Volkmann" <[EMAIL PROTECTED]> wrote:
> Related to this is the idea that maybe the REPL should automatically
> wrap a line without parens with them. That way you could just enter
> "quit" instead of "(quit)". That seems handy for many things. For
> example, why not enter
>
On Sun, Nov 30, 2008 at 1:15 PM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> println "my-var is" my-var
>
> instead of
>
> (println "my-var is" my-var)
>
> It's entirely possibly I'm overlooking some reason why this is a bad idea.
I'm generally in favor of ditching parens whenever possible. I d
On Nov 30, 2008, at 12:59 PM, Chouser wrote:
>
> ns-publics already calls 'the-ns' on its arg,
Right.
> and 'for' is handy for
> destructuring.
>
> (defn ns-var-metas [ns-name]
> (into {} (for [[n v] (ns-publics ns-name)] [n ^v])))
>
> Both 'into' and 'apply conj' allow you to specify nil ins
On Sun, Nov 30, 2008 at 10:35 AM, Paul Barry <[EMAIL PROTECTED]> wrote:
>
> It's a minor thing, but wouldn't it be a good idea to put (defn quit
> [] (System/exit 0)) in clojure core, just to make quitting out of the
> REPL more obvious? Ctrl-C and Ctrl-D work too, and are actually
> shorter to t
ns-publics already calls 'the-ns' on its arg, and 'for' is handy for
destructuring.
(defn ns-var-metas [ns-name]
(into {} (for [[n v] (ns-publics ns-name)] [n ^v])))
Both 'into' and 'apply conj' allow you to specify nil instead of a
pair if you wanted conditionally exclude a key.
--Chouser
-
On Nov 30, 2008, at 12:14 PM, Randall R Schulz wrote:
>
> On Sunday 30 November 2008 09:06, Randall R Schulz wrote:
>> Hi,
>>
>> This is my first Clojure how-to question. I tried to find an answer
>> on the Wiki and in the list archives, but to no avail.
>>
>> How do I build up a map one associa
On Sunday 30 November 2008 09:14, Chouser wrote:
> On Sun, Nov 30, 2008 at 12:06 PM, Randall R Schulz <[EMAIL PROTECTED]>
wrote:
> > This is my first Clojure how-to question. I tried to find an answer
> > on the Wiki and in the list archives, but to no avail.
> >
> > How do I build up a map one a
On Sunday 30 November 2008 09:06, Randall R Schulz wrote:
> Hi,
>
> This is my first Clojure how-to question. I tried to find an answer
> on the Wiki and in the list archives, but to no avail.
>
> How do I build up a map one association at a time? Clearly (map ...)
> won't do that, 'cause the outp
On Sun, Nov 30, 2008 at 12:06 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> This is my first Clojure how-to question. I tried to find an answer on
> the Wiki and in the list archives, but to no avail.
>
> How do I build up a map one association at a time? Clearly (map ...)
> won't do that, '
Hi,
This is my first Clojure how-to question. I tried to find an answer on
the Wiki and in the list archives, but to no avail.
How do I build up a map one association at a time? Clearly (map ...)
won't do that, 'cause the output has as many elements as the input. I
looked at (reduce ...) but
On Sunday 30 November 2008 08:37, Dmitri wrote:
> I agree that the consistency that the s-expressions provide is
> valuable, and hence it would be counter productive to allow different
> kinds of syntax. However, it makes sense to have an explicit way to
> do infix notation.
That seems self-contr
I agree that the consistency that the s-expressions provide is
valuable, and hence it would be counter productive to allow different
kinds of syntax. However, it makes sense to have an explicit way to do
infix notation. As Johan points out above, Haskell has a very elegant
way of infixing function
It's a minor thing, but wouldn't it be a good idea to put (defn quit
[] (System/exit 0)) in clojure core, just to make quitting out of the
REPL more obvious? Ctrl-C and Ctrl-D work too, and are actually
shorter to type, but having a quit function seems to be an idiomatic
way of getting out of the
On Nov 23, 7:39 pm, "Shawn Hoover" <[EMAIL PROTECTED]> wrote:
> Here's a first pass at a Windows installer for a Clojure environment in
> Emacs:http://clojure.bighugh.com/clojure-box-r1109-setup.exe.
There's a new version up with a few tweaks. The most helpful change
was a fix to allow swank to p
Hi,
Speaking of program analysis tools (I was, in another thread), has
anybody written anything along these lines for Clojure?
I appreciate the (doc) and (find-doc) built-ins and use them quite a
lot, but they don't help when it comes to analyzing existing Clojure
source code.
As a rank amate
If you're going to frequently get the latest from SVN, I suggest using
a script like the following. It assumes you are in a directory that
contains the subdirectories "clojure" and "clojure-contrib" that were
initially created by doing svn checkouts. This is for UNIX, Linux or
Mac. You should be a
On Sunday 30 November 2008 07:06, Daniel Renfer wrote:
> Since it's pretty much the topic, has anyone ever seen this:
>
> http://www.dwheeler.com/readable/
One thing I'll say is that I can't see myself _ever_ getting behind a
notation where white-space is significant. The so-called "semicolon
i
I just watched Jim Weirich's talk from RubyConf. He does a good job
of showing the basics of why concurrent programming is hard, and
briefly talks about Erlang and Clojure at the end. I recommend it to
anyone interested in Clojure:
http://rubyconf2008.confreaks.com/what-all-rubyist-should-know-
There was a breaking change to doto, you now need a dot before Java
method names, e.g.
(doto gl
(.glVertex3f ; etc.
Looks like you there are several dozen similar changes needed in that
file.
Cheers,
Stuart
>
> Has something changed in Clojure that has broken the OpenGL gears
>
Since it's pretty much the topic, has anyone ever seen this:
http://www.dwheeler.com/readable/
On Sun, Nov 30, 2008 at 10:03 AM, Dmitri <[EMAIL PROTECTED]> wrote:
>
> Thanks for the example, the macro is exactly the solution was looking
> for.
>
> On Nov 30, 1:11 am, Jeff Bester <[EMAIL PROTECTE
Thanks for the example, the macro is exactly the solution was looking
for.
On Nov 30, 1:11 am, Jeff Bester <[EMAIL PROTECTED]> wrote:
> On Nov 28, 11:11 pm, Dmitri <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the comments, the prefix notation may indeed be something
> > that one gets used to. I fi
One thing I'll mention is that most of the libraries and user code is
going to be written with post-AOT changes in mind. Contrib is
currently maintaining copies of the files in the old locations, but I
doubt support for pre-AOT will continue much past the next release
once everyone has switched.
Has something changed in Clojure that has broken the OpenGL gears
demo?
When I attempt to run it, I get:
$ ~/bin/clj opengl-gears.clj
Exception in thread "main" java.lang.Exception: Unable to resolve
symbol: glShadeModel in this context (opengl-gears.clj:27)
at clojure.lang.Compiler.analy
On Saturday 29 November 2008 22:11, Jeff Bester wrote:
> ...
>
> If you are translating formulas it might be worth investing the time
> to create a macro to convert from infix to prefix with precedence
> rules, as well as, creating new operators. I think Peter Norvig
> covers something akin to t
I feel really stupid - I'm pretty sure I just forgot to build.
Anyhow, the ant simulation works perfectly (ubuntu, clojure revision
1131). It's real cool. Sure is alot going on with just 200 or so
lines of codes.
On Nov 29, 12:51 pm, Blaine <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I'm having
On Saturday 29 November 2008 22:33, Tom Faulhaber wrote:
> Bill,
>
> Actually, the original Unix shell was written in this fashion by
> Steve Bourne at Bell Labs.
Wow. That takes me back. I remember seeing that code once (I was at an
educational institution that had a full source license for Bel
On Sun, Nov 30, 2008 at 4:34 AM, Kevin Downey <[EMAIL PROTECTED]> wrote:
> (reduce str [\a \b \c])
> (apply str [\a \b \c])
For the record, 'apply str' is significantly faster because 'str'
creates a StringBuilder when given 2 or more args, and uses that to
build up the string. Using 'reduce' ca
Is there a rule of thumb to apply when deciding whether to separate
multiple words in a function name with hyphens?
I can't detect a pattern in how this was decided for many provided functions.
Here are some examples that use hyphens: dotimes, gensyms, macroexpand
Here are some that don't: drop-la
Bill,
Actually, the original Unix shell was written in this fashion by Steve
Bourne at Bell Labs.
In those days, people thought the ability to do this sort of thing was
one of the advantages of the C preprocessor. It didn't take too long
for them to change their minds. :-)
At Harvard back in th
On Sun, Nov 30, 2008 at 12:11 AM, Jeff Bester <[EMAIL PROTECTED]> wrote:
snip
> ;; used for order of evaluation table and for valid infix operators
> (def +precedence+
> {'rem 5,
> '* 4,
> '/ 3,
> '+ 2,
> '- 1})
What's the significance of this map being named with a lead
>
> (defn construct-atom
> "translates a number n into an set of letters of size n"
> [construct length]
> (if (< (count construct) length)
> (recur (conj construct (char (+ (rand-int amino_acids) 65))) length)
> construct))
>
> recur will goto the nearest enclosing loop or fn.
>
>
Hi,
Am 30.11.2008 um 10:00 schrieb puzzler:
Is there a way to write concatvec in an O(1) way, taking advantage of
sharing?
I suspect that the "obvious way" to concatenate vectors, i.e., (into
[] (concat v1 v2)), would be O(n).
You may want to use the reduce with conj.
(reduce conj v1 v2)
Th
Hi,
Am 30.11.2008 um 04:47 schrieb Kyle Schaffrick:
Regarding Chimp, maybe you can try Gorilla:
http://groups.google.com/group/clojure/browse_thread/thread/c8b7bc3106c39791
I haven't used it personally yet.
My mistake, I actually did mean Gorilla and not Chimp.
Please note, that Gorilla is
2008/11/30 pmf <[EMAIL PROTECTED]>
>
> When using the -jar option, the CLASSPATH is ignored. See
> http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/java.html
>
Excellent! That fixed it. Invoking it with the jar in the classpath
rather than the explicit -jar parameter is the answer I needed
On 30 nov, 02:42, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> On Saturday 29 November 2008 11:01, ppierre wrote:
>
> > On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> > > On Nov 29, 2008, at 10:48 AM, ppierre wrote:
> > > > But I can't compile core.clj when I put get-locale
On Nov 30, 11:04 am, "Adrian Cuthbertson"
<[EMAIL PROTECTED]> wrote:
> Hmm, I tried your dirs and files off my dev directory and the same
> binding/compile form and it works fine or me - firstly on 1121, but then I
> checked out 1130 and also no problem. (I'm on jdk 1.5 on OSX). Sure you've
> crea
Hmm, I tried your dirs and files off my dev directory and the same
binding/compile form and it works fine or me - firstly on 1121, but then I
checked out 1130 and also no problem. (I'm on jdk 1.5 on OSX). Sure you've
created the classes dir?
Also you said you invoked using;
java -cp /home/gteale/s
On Nov 30, 10:00 am, puzzler <[EMAIL PROTECTED]> wrote:
> subvec is O(1) because it takes advantage of sharing. This is quite
> useful.
>
> Is there a way to write concatvec in an O(1) way, taking advantage of
> sharing?
> I suspect that the "obvious way" to concatenate vectors, i.e., (into
> []
(reduce str [\a \b \c])
(apply str [\a \b \c])
etc
On Sun, Nov 30, 2008 at 12:52 AM, puzzler <[EMAIL PROTECTED]> wrote:
>
> I would expect something like this to work:
> (String. (into-array [\a \b \c]))
> would yield "abc",
> but it gives me an error.
>
> It seems very natural to turn a string in
subvec is O(1) because it takes advantage of sharing. This is quite
useful.
Is there a way to write concatvec in an O(1) way, taking advantage of
sharing?
I suspect that the "obvious way" to concatenate vectors, i.e., (into
[] (concat v1 v2)), would be O(n).
--~--~-~--~~~
I would expect something like this to work:
(String. (into-array [\a \b \c]))
would yield "abc",
but it gives me an error.
It seems very natural to turn a string into a Clojure collection to do
various manipulations, but then how do you turn a collection of
characters back into a string?
--~--~--
77 matches
Mail list logo