On 28 Mar 2011, at 22:06, Alan wrote:
(into-array String [])
(make-array String 0)
Thanks!
Konrad.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are
<>
It's okay. I couldn't get hired as a C programmer for NASA years ago,
and I had already written my own working C compiler! The idiot
interviewer opened some huge C library reference manual to some random
page, and asked me to recite whatever function he had the page opened
to from memory. Of
And I should have known about this before, but had not used it. It adds to
Leiningen the capability to search, and I'm not sure, but perhaps also add
dependencies that were found:
https://github.com/Licenser/lein-search
Andy
On Mar 28, 2011, at 9:52 PM, Mike Meyer wrote:
> On Mon, 28 Mar 201
On Mon, 28 Mar 2011 18:10:31 -0700
Andy Fingerhut wrote:
> Changing subject line for this one.
I almost did that myself.
> On Mar 28, 2011, at 5:38 PM, Mike Meyer wrote:
> >
> > Consider this a features request for cake/leiningen:
> > 1) A task to search clojars.
> > 2) A task take a name from
Nope. I moved the main code to ns hexadoku.core (generating package
hexadoku, class core) and did the deftype in hexadoku (generating package
hexadoku, class HexSolver). The error remains
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Var
hexadoku.core/search is unbound.
a
On Mon, 28 Mar 2011 20:50:05 -0400
James Reeves wrote:
> > Ah, but as in Java, the "big official libraries" such as java itself
> > starts with i.e. java.swing. But if I was to publish a utilities
> > library for swing, i would call it no.terjedahl.java.swing, so that it
> > could be used by me
On Monday, March 28, 2011, Lee Spector
> I do now have clojure syntax highlighting which I may or may not have had
> before (I don't recall noticing that before, but maybe it was there).
>
> -Lee
Clojure Shell is just for snippets. The Commando bit is for running
your script with a properly set
I started out playing with Clojure in the Intellij plug-in La Clojure
back about 6 months ago. It worked quite well, but I started
experimenting with lein and emacs and found it to be more light-
weight, enjoyable, and productive for me. And yes, I learned emacs
specifically to use it with Clojur
Sorry, Lee. Not you. You're posts have been sincere.
On Mar 28, 4:22 pm, Lee Spector wrote:
> On Mar 28, 2011, at 9:07 AM, Jon Seltzer wrote:
>
>
>
> > Frankly, I'm a little annoyed by people who want to blame everyone
> > else if something new is not immediately obvious to them.
>
> I don't kn
Changing subject line for this one.
On Mar 28, 2011, at 5:38 PM, Mike Meyer wrote:
>
> Consider this a features request for cake/leiningen:
> 1) A task to search clojars.
> 2) A task take a name from #1 and add the appropriate data to project.clj.
> 3) Extend the "deps" task to install libraries
Colin,
PersistenQueue doesn't have direct Reader support. However:
user> (def source-queue (ref clojure.lang.PersistentQueue/EMPTY))
#'user/source-queue
user> (for [x (load-sources 1 2 3)]
x)
(1 2 3)
with
(defn load-sources [& sources]
(dosync
(alter source-q
Hi Ben,
it seems like this has been broken in Clojure 1.2:
http://groups.google.com/group/clojure/browse_thread/thread/d7141efd4958a7e5/4d847865a9d5fb8b?lnk=gst&q=memoize+fib#4d847865a9d5fb8b
One solution is
(def f (memoize fn [n]...
will do what you want.
Cheers
Andreas
On 29/03/2011, at 10:47
On 28 March 2011 03:01, Terje Dahl wrote:
> So, would you say that namespaces are in fact a lot like Python
> packages - one pr file - and with the same flexibility of Python's
> import-statements:
Basically, yes. It's possible to put different namespaces in the same
file, but then the `require`
Sorry perhaps I should have said my queue is a ref'ed PersistentQueue
and so concat doesnt work as it works it returns a LazySeq.
On Mar 29, 12:16 pm, Andreas Kostler
wrote:
> Hi Colin,
> Can you be a bit more specific? The code you posted actually works without
> vec...
>
> On 29/03/2011, at 6:
I was playing with "memoize" when I ran into some puzzling behavior. A test
case:
(defn f [n]
(println "f called with" n)
(if (zero? n)
0
(min (f (dec n))
(f (dec n)
(def f (memoize f))
*The usage of "def" to rebind a function to its memoized version is taken
from Pro
On Mon, 28 Mar 2011 08:46:20 -0700 (PDT)
ultranewb wrote:
> On Mar 28, 1:15 pm, Mike Meyer wrote:
> > Question: how did you find the library you were going to use?
>
> By looking at the documentation for the system. I guess I was mostly
> referring to libraries which come with the system. I th
On Mon, Mar 28, 2011 at 8:46 AM, Mark Meyer wrote:
> Hi.
> I'm having problems calling clojure code from Java. Basically I deftype'd
> (deftype HexSolver []
> Solver
> (solve [this grid] (search (process-grid grid
> and somewhere near the top of that file file
> (defn search [foo] ...)
> t
Thanks for the comment, Larry. I have used Aquamacs before. It is my plan to
support it as well.
-Kasim
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members ar
On Mar 28, 2011, at 9:07 AM, Jon Seltzer wrote:
>
> Frankly, I'm a little annoyed by people who want to blame everyone
> else if something new is not immediately obvious to them.
I don't know if you intend this to apply to me but for the record I'm not
trying to blame anyone for anything, just
Hi Colin,
Can you be a bit more specific? The code you posted actually works without
vec...
On 29/03/2011, at 6:52 AM, colint wrote:
> Hi, is there a function to add the contents of seq to a collection
> without using vec and into combo?
>
> (defn load-sources [&sources]
> (dosync
>(alter
"concat" should do the trick:
(defn load-sources [& sources]
(dosync
(alter source-queue concat sources)))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new
On Mar 28, 2011, at 5:08 PM, David Nolen wrote:
>
> http://dev.clojure.org/display/doc/Getting+Started+with+JEdit
>
> Hope that helps.
Thanks. That taught me some things -- e.g. I had guessed the wrong location for
the mode file, and I hadn't guessed about editing that catalog file at all, an
Hi, is there a function to add the contents of seq to a collection
without using vec and into combo?
(defn load-sources [&sources]
(dosync
(alter source-queue into (vec (sources)
cheers
Colin
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
into-array can do that for you:
user=> (doc into-array)
-
clojure.core/into-array
([aseq] [type aseq])
Returns an array with components set to the values in aseq. The
array's
component type is type if provided, or the type of the first value
in
aseq if present, or Obj
While I agree that clear steps should be provided to assist newcomers,
I don't have sympathy for newcomers more interested in bashing other
languages and people than in actually learning something.
I started learning clojure over a year ago and I don't recall any
issues getting started. I fired u
Hi.
I'm having problems calling clojure code from Java. Basically I deftype'd
(deftype HexSolver []
Solver
(solve [this grid] (search (process-grid grid
and somewhere near the top of that file file
(defn search [foo] ...)
the very top places this in the namepsace (:ns hexadoku (:gen-cla
Congrats and thanks,
I've been hacking Clojure on GAE for a while now and appengine-magic makes
it incredibly easy (I'd say even easier than java/python deployments).
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email
On Mar 26, 12:35 am, James Reeves wrote:
> On 25 March 2011 01:05, Terje Dahl wrote:
>
> > In Java, the language forces you to have more or less one class pr
> > class-file, and you are encouraged to group class-files in packages.
> > So, is it as simple as saying that that namespaces are analo
On Mar 28, 2011, at 4:48 PM, daly wrote:
> If you're going to really be a lisper and use Clojure for more
> than a "Java scripting language" then you might want to invest
> effort in using emacs. You don't even need slime. Just use a
> *shell* buffer. Lisp and emacs are made for each other and yo
On Mon, Mar 28, 2011 at 1:48 PM, daly wrote:
> Maven and Leiningen are really just "JCL reborn". About the
> only advance is that you don't have to specify the cylinders.
Oh you're bringing back terrible memories from my youth! JCL... I
thought once I'd left the insurance industry I'd never have
Hi,
please let me humbly add my 2ct to this discussion...
If you want to learn something new, you'll just have to jump through some
hoops. As soon as you do a little more than the basics you'll have to learn
the specific way to do it.
Somewhere in this thread it says, that in some language yo
On Mon, Mar 28, 2011 at 5:16 PM, Armando Blancas
wrote:
>> IntelliJ w/ La Clojure -
>> Could get a REPL, couldn't figure out how to do anything else. In
>> particular, I followed some specific instructions from somewhere
>> (can't remember where) for how to set up a project, edit a source file
>>
> IntelliJ w/ La Clojure -
> Could get a REPL, couldn't figure out how to do anything else. In
> particular, I followed some specific instructions from somewhere
> (can't remember where) for how to set up a project, edit a source file
> (hello world or whatever), and "run" that source file. All I
On Mon, Mar 28, 2011 at 4:52 PM, Lee Spector wrote:
>
> On Mar 28, 2011, at 4:37 PM, David Nolen wrote:
> >
> > Using that clojure.xml, auto-indent works just fine for me.
>
> Hmmm. Not for me. I guess this is another instance of the issue that the OP
> raised. Not sure what to try next to make i
On Mar 28, 2011, at 4:37 PM, David Nolen wrote:
>
> Using that clojure.xml, auto-indent works just fine for me.
Hmmm. Not for me. I guess this is another instance of the issue that the OP
raised. Not sure what to try next to make it work. FWIW one reason I think
auto-indentation is critical fo
On Mar 28, 11:18 am, Saul Hazledine wrote:
> On Mar 27, 12:04 am, Joost wrote:
>
> > I'm currently working on a library to provide a consistent and
> > extensible method for generating form fields, based on hiccup.
>
> I think this is a cool thing to do. One thought I had was that your
> approach
On Mon, 2011-03-28 at 13:01 -0700, Sean Corfield wrote:
> On Sun, Mar 27, 2011 at 11:31 PM, Mark Engelberg
> wrote:
> > (require (planet dherman/memoize:3:1))
> >
> > If the library's not already on the system, when you run the program,
> > Racket automatically downloads it for you and puts it in
Hi,
Am 28.03.2011 um 22:35 schrieb Meikel Brandmeyer:
>> PS why is there a ' before ^:key? It doesn't seem to me like it does
>> anything.
>
> It quotes the key symbol. Without it you get a similar error to the one you
> fixed with the ' in front of the ~attrs.
Ah. In fact you don't, because k
On Mon, Mar 28, 2011 at 3:31 PM, Lee Spector wrote:
> I do consider this critical, especially for newcomers. I already had the
> Clojure edit mode that could be installed from the Plugins menu, and my
> buffers say "clojure" at the bottom so I assume it is working. (And I can
> also execute Cloju
Hi all!
I'm using Clojure to generate java source (enums, specifically) and am
looking for ideas.
Currently my generator consists of a collection of function which call
each other tree-recursion-like.
Input:
Each function takes a map of input. Much of this is constant for any
one run of the gene
Hi,
Am 28.03.2011 um 22:29 schrieb Alan:
> If you need it quoted in the "def" context:
>
> (defmacro def-entity-and-attrs [entity-name key attrs-name attrs]
> `(do (def ~attrs-name '~attrs)
>(ds/defentity ~entity-name ~(vec (concat ['^:key key]
> attrs)
>
> Note the ' before attrs
> Clojure 1.3.0-alpha* uses its own = function for map lookups specifically to
> avoid this problem. The = function is true for numbers of different types
> but the same value. Note that Java code dealing with Clojure maps using the
> java.util.Map interface will still get the standard Java beha
If you need it quoted in the "def" context:
(defmacro def-entity-and-attrs [entity-name key attrs-name attrs]
`(do (def ~attrs-name '~attrs)
(ds/defentity ~entity-name ~(vec (concat ['^:key key]
attrs)
Note the ' before attrs.
PS why is there a ' before ^:key? It doesn't seem to m
Hi!
Defining an entity with appengine-magic is straightforward:
(ns tlog.models
(:require [appengine-magic.services.datastore :as ds]))
(ds/defentity Article [^:key slug, title, body, created-t, updated-t])
But there are several places (other files), where that list sans the
first
(into-array String [])
(make-array String 0)
On Mar 28, 12:58 pm, Konrad Hinsen wrote:
> For interfacing with some Java code I need to create an empty string
> array in Clojure. Is that possible somehow? The only way I know to
> create a string array is
>
> (into-array ["a" "b"])
>
>
On Sun, Mar 27, 2011 at 11:31 PM, Mark Engelberg
wrote:
> (require (planet dherman/memoize:3:1))
>
> If the library's not already on the system, when you run the program,
> Racket automatically downloads it for you and puts it in the right
> place (and even installs the documentation to the built-
For interfacing with some Java code I need to create an empty string
array in Clojure. Is that possible somehow? The only way I know to
create a string array is
(into-array ["a" "b"])
but
(into-array [])
creates of course an object array.
Konrad.
--
You received this mess
On Mar 28, 2011, at 3:02 PM, David Nolen wrote:
>
> Auto-indenting is achieved via the JEdit Clojure mode. You just need to drop
> it into your JEdit modes folder (platform dependent location).
> https://github.com/djspiewak/jedit-modes/blob/master/clojure.xml. I don't
> consider it critical f
On Mon, Mar 28, 2011 at 2:53 PM, Lee Spector wrote:
>
> On Mar 28, 2011, at 1:48 PM, David Nolen wrote:
> > 1) Install JEdit for your platform, start JEdit
> > 2) Install Clojure and Clojure Shell plugins via Plugins menu
> > 3) Start the Clojure Shell from the Plugins menu.
> > 4) Write some Clo
> Either way, I said that I would download and try this Eclipse thing in
> the next few days, and I will. I don't have high hopes for it,
> because I've already "been there, done that" with these other big,
> glamorous IDEs, but I'll do my due diligence and give it a shot. If
> I'm a betting in V
On Mar 28, 2011, at 2:27 PM, Larry Travis wrote:
>
> When you work 'on a "Just Works" emacs setup' for Mac Os X consider whether
> you can create such a setup for the Aquamacs version of emacs that many of us
> Mac Os X users prefer (because it gives us the power and versatility of emacs
> wit
On Mar 28, 2011, at 1:48 PM, David Nolen wrote:
> 1) Install JEdit for your platform, start JEdit
> 2) Install Clojure and Clojure Shell plugins via Plugins menu
> 3) Start the Clojure Shell from the Plugins menu.
> 4) Write some Clojure source in a file, save it.
> 5) Send file to Clojure Shell
On Mon, Mar 28, 2011 at 2:27 PM, Larry Travis wrote:
> Kasim:
> I just discovered ClojureW, and it looks promising. I will report my
> reaction after I get time to thoroughly test it for the kinds of things I am
> doing.
>
> In the meantime, a request:
>
> When you work 'on a "Just Works" emacs se
Kasim:
I just discovered ClojureW, and it looks promising. I will report my
reaction after I get time to thoroughly test it for the kinds of things
I am doing.
In the meantime, a request:
When you work 'on a "Just Works" emacs setup' for Mac Os X consider
whether you can create such a setup
On Mar 28, 11:19 pm, Luc Prefontaine
wrote:
> The simple answer (your # 1) was already provided by Shantanu.
> Install Eclipse and CCW and you can start simple Clojure projects.
> No immediate dependency issues until you need something from Clojar.
Oh, there have been lots of "simple answers." T
On Mar 28, 11:39 pm, Lee Spector wrote:
> There's some ambiguity here about what kind of libraries we're talking about
> and where they come from.
> I think the poster is asking for a totally transparent way to do the stuff at
> the simple end of the spectrum (e.g. for built-in stuff
Yes, t
On Mon, Mar 28, 2011 at 12:39 PM, Lee Spector wrote:
>
> On Mar 28, 2011, at 12:19 PM, Luc Prefontaine wrote:
> > "But with any other language I've ever used, at most I include a
> > library I need in a directive at the top, or I include my own code in
> > a similar directive. For instance, with
On Mar 28, 2011, at 12:19 PM, Luc Prefontaine wrote:
> "But with any other language I've ever used, at most I include a
> library I need in a directive at the top, or I include my own code in
> a similar directive. For instance, with Erlang you just say
> "module(whatever)" at the top. I mean, t
"But with any other language I've ever used, at most I include a
library I need in a directive at the top, or I include my own code in
a similar directive. For instance, with Erlang you just say
"module(whatever)" at the top. I mean, that's ALL you do. "
This is what the poster expects. So much
On Mar 28, 12:46 pm, Kasim wrote:
> Hi,
>
> I am the guy who did ClojureW. I just updated the instruction to get a REPL
> with Jline. Thank you for reporting. I am also working on a "Just Works"
> emacs setup for all platforms and would be happy to hear your opinion. I
> really want to make it as
On Mar 28, 9:18 am, Ken Wesson wrote:
> On the other hand, there's a definite contingent that do hold
> newbs in low esteem and are deliberately rude to them, regarding them
> as low-status individuals on the techno totem pole. Why does this type
> bother to reply to newbie questions at all?
(Al
On Mon, Mar 28, 2011 at 8:51 AM, Lee Spector wrote:
>
> On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote:
>
>> Given the huge number of libraries/projects available these days
>> and the diverse profile of library maintainers, a totally
>> automated/transparent
>> dependency manager is not for
On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote:
> Given the huge number of libraries/projects available these days
> and the diverse profile of library maintainers, a totally
> automated/transparent
> dependency manager is not for today. It would require a crystal ball to cope
> with a numbe
So I have come up with a solution to my desire to move to defprotocol/
type in spite of my requirement for gen-class' init/post-init
methods :
(def protocol Resource
(open [this])
(close [this])
...
)
(deftype ResourceImpl [resource]
Resource
(open [this]...)
(close [this] (.close resource).
> Incorrect.
Thx, for clearing it up.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscri
Incorrect. This behaviour is due to the reader eagerly giving preference to
numbers; symbols can contain any characters, and are unrelated to the JVM:
=> '1st
#
=> (symbol "1st")
1st
=> (symbol "foo bar")
foo bar
Of course, such symbols cannot be readably printed, which is a separate issue.
S
Yes, I think thats a naming restriction by the JVM.
On Mar 28, 11:57 am, Fred Concklin wrote:
> in common lisp:> (setf x '((1st element) 2 (element 3) ((4)) 5))
>
> ((1ST ELEMENT) 2 (ELEMENT 3) ((4)) 5)
>
> in clojure:
> user> (def x '((1st element) 2 (element 3) ((4)) 5))
> java.lang.NumberForma
in common lisp:
> (setf x '((1st element) 2 (element 3) ((4)) 5))
((1ST ELEMENT) 2 (ELEMENT 3) ((4)) 5)
in clojure:
user> (def x '((1st element) 2 (element 3) ((4)) 5))
java.lang.NumberFormatException: Invalid number: 1st
[Thrown class clojure.lang.LispReader$ReaderException]
Looking into it
u
On Mar 27, 12:04 am, Joost wrote:
> I'm currently working on a library to provide a consistent and
> extensible method for generating form fields, based on hiccup.
>
I think this is a cool thing to do. One thought I had was that your
approach looks very general - could it be used for all types of
Given the huge number of libraries/projects available these days
and the diverse profile of library maintainers, a totally automated/transparent
dependency manager is not for today. It would require a crystal ball to cope
with a number of situations.
That "garbage" has to be dealt with in day to d
Amazing work. In my previous tests i did all the dirty work by hand to
learn the guts of clojure way to use gae but i want to start a
personal project a little bit more serious and i am going to use your
lib. I hope i'll can help with some feedback.
Congrats and thanks!
--
You received this mess
71 matches
Mail list logo