On 27.04.2009, at 00:33, David Chamberlin wrote:
I can get round this by not using a structure map for the metadata,
but since I'm going to be creating container loads of these structures
I understand that I need to be using struct-maps for efficiency.
Is there a reason why this should not
http://clojure.org/api#remove-ns ??
i never used it but it seems to do it ;-)
On 27 abr, 06:08, Mark Derricutt m...@talios.com wrote:
Is it possible to unload/remove a namespace at runtime at all?
Mark
...and then Buffy staked Edward. The End.
Phil,
It works for me. Are you trying to look up a built-in clojure function
or one from your own application? How did you install SLIME and
swank-clojure etc?
It doesn't work for either. When I try looking up a clojure-contrib
function, I get let*: Search failed:
Hi Konrad,
Am 27.04.2009 um 08:44 schrieb Konrad Hinsen:
As for efficiency, I doubt that struct maps make that much of a
difference, but I didn't do any timings.
AFAIU, struct-maps are not an optimisation for efficiency of the
key lookup, but for the storage space of the keys. So timings
fft1976 a écrit :
On Apr 26, 9:21 am, Stuart Sierra the.stuart.sie...@gmail.com wrote:
resolve will find the Var
that is named by the symbol.
Can there be Vars without names? Can I have a vector of Vars?
You can, see with-local-vars for example.
On 27.04.2009, at 09:42, Meikel Brandmeyer wrote:
AFAIU, struct-maps are not an optimisation for efficiency of the
key lookup, but for the storage space of the keys. So timings
should probably read memstats.
If memory is the issue, then creating a single instance of the
metadata map for
Well that was a simple answer ;-) That should help with using clojure in
OSGi, having a way to trigger an unload when a bundle dissapears should get
around the problem of coercing everything to use the same classloader. I
sense some more hacking in the near future :)
On Mon, Apr 27, 2009 at
Hey guys,
Just started looking at clojure-contrib's sql namespace, however, using the
following code:
(let [user_id (.toString (java.util.UUID/randomUUID))]
(sql/with-connection db (sql/insert-records
:users
{:user_id user_id})))
and clojure-contrib-1.0-20090421.092453-8.jar seems to
samppi a écrit :
I see. Does this mean that, if I expect to handle 32-bit characters,
then I need to consider changing my character-handling functions to
accept sequences of vectors instead?
Also, how does (seq \ud800\udc00) work? Does it split the character
into two 16-bit characters? In
On Apr 27, 2009, at 10:07 AM, samppi wrote:
I see. Does this mean that, if I expect to handle 32-bit characters,
then I need to consider changing my character-handling functions to
accept sequences of vectors instead?
The blog post touches on this and searching around on Google and
On Apr 27, 3:49 am, fft1976 fft1...@gmail.com wrote:
Can there be Vars without names? Can I have a vector of Vars?
Vars always have names, but you can create temporary Vars using with-
local-vars. If you want to create a vector of unnamed, mutable
objects, you probably want Refs or Atoms
Is there any way you could record the presentation and post it on your site?
On Mon, Apr 27, 2009 at 1:36 PM, slc sari.conn...@gmail.com wrote:
If you are interested in Google AppEngine and live in the Atlanta
area ...
Tuesday - Clojure
find-first in seq_utils returns the first item in a collection where
(pred item) returns logical true. I needed a function that returns the
result of (pred item) instead of item. This seems to do the trick.
Maybe this should be added to seq_utils.
(defn find-first-result [fn coll]
(first
Rich, refer to the patch described by Stephen Gilardi at
http://groups.google.com/group/clojure/msg/2b7dd55d9f766125 (which
makes it possible to run Clojure under z/OS).
Based on Steve and Laurent PETIT's comments in that thread, I gather
that the UTF-8 vs platform-default issue has been around
Meikel,
I'm having a heck of a time getting started with VimClojure and it's
probably all due to my lack of knowing vim. After a lot of poking, I
got the plugin to load and got syntax highlighting working. I also
have got some autocmd's in my .vimrc so that they're listed when I do
a :map. I got
Shouldn't this return nil ? :
1:4 user= (find-first-result false? [true])
false
Maybe this definition of find-first-result may fill the gap:
(defn find-first-result [pred coll]
(find-first identity (map pred coll)))
=
1:22 user= (find-first-result false? [true])
nil
1:23 user=
On Apr 27, 2009, at 9:57 AM, Stephen C. Gilardi wrote:
As a result of your report, I'm working on adding better error
reporting on BatchUpdateException and SQLException to
clojure.contrib.sql.
I've added this in SVN Revision 720 of clojure-contrib. Comments
welcome.
--Steve
find-first-result is already in core: some
Mark Volkmann a écrit :
find-first in seq_utils returns the first item in a collection where
(pred item) returns logical true. I needed a function that returns the
result of (pred item) instead of item. This seems to do the trick.
Maybe this should
The sequence page ( http://clojure.org/sequences ) reads :
(rest coll)
Returns a seq of the items after the first. Calls seq on its argument.
If there are no more items, returns nil.
It should state , ... returns ().
HTH,
--
Laurent
--~--~-~--~~~---~--~~
You
2009/4/27 Christophe Grand christo...@cgrand.net:
find-first-result is already in core: some
OH! yes :-$
Mark Volkmann a écrit :
find-first in seq_utils returns the first item in a collection where
(pred item) returns logical true. I needed a function that returns the
result of (pred
We will attempt to record the AppEngine Clojure talk.
If it turns out ok, it will be posted on youtube and I will link to it from
atlclj.org
On Mon, Apr 27, 2009 at 10:15 AM, Robert Campbell rrc...@gmail.com wrote:
Is there any way you could record the presentation and post it on your
site?
Hi Jim,
Am 27.04.2009 um 18:08 schrieb jim:
I'm having a heck of a time getting started with VimClojure and it's
probably all due to my lack of knowing vim. After a lot of poking, I
got the plugin to load and got syntax highlighting working. I also
have got some autocmd's in my .vimrc so that
Thanks for the response.
Here's specifically what's happening:
I have vim 7.2, according to the :version command in gvim
I start the nailgun server with:
java -cp /home/jim/clojure/clojure.jar:/home/jim/clojure/
clojure.contrib/clojure-contrib.jar:/home/jim/clojure/vimclojure.jar
There's a section on the wiki with almost the exact same title:
http://en.wikibooks.org/wiki/Clojure_Programming/Examples#Invoking_Java_method_through_method_name_as_a_String
If I'm understanding the question correctly that should do what you're
wanting to do.
-Rich
On Sun, Apr 26, 2009 at
I forgot to say that I have:
let clj_want_gorilla = 1
in my .vimrc
On Apr 27, 12:08 pm, Meikel Brandmeyer m...@kotka.de wrote:
Hi Jim,
Am 27.04.2009 um 18:08 schrieb jim:
I'm having a heck of a time getting started with VimClojure and it's
probably all due to my lack of knowing vim.
I forgot to say that I have:
let clj_want_gorilla = 1
let vimclojure#NailgunClient = /home/jim/clojure/ng
in my .vimrc file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group,
For anybody who's still following, I've updated accessors.clj with a new
behavior. I realized assoc-in and get-in are very powerful, they work with
all sorts of collections (not just maps, duh on my part), thus now
if anything in the list of accessor symbols is not actually a
clojure.lang.Symbol,
Yeah, I agree that it was pretty good. I like that you have a non-trivial
working application at the end of it. My one criticism is that it's too
hard to try to follow along and write the code as you go because there are
too many changes from each step to step that aren't discussed in the
I can agree with that, for the most part. But if you've been doing clojure
for a while, why cover basic syntax, basic map/reduce stuff, etc.? The time
could have been spent more usefully. It just failed to pick an audience and
stick with it, that's all.
On Mon, Apr 27, 2009 at 2:45 PM, Paul Barry
The table def was:
CREATE TABLE users (
user_id VARCHAR(255) NOT NULL,
msisdn VARCHAR(255),
date_created timestamp with time zone NOT NULL,
date_verified timestamp with time zone NOT NULL
);
I'll try to build it up as a test case tonight.
On Tue, Apr 28, 2009 at 1:57 AM, Stephen C. Gilardi
Hi,
I am working with a very long list and populating it to a map. What i
have is three pieces of data from the list;
-Row Number
-Heading info List
-Actual Info List
note: both the Heading Info List and Actual Info List have the same
number of elements as each heading name will have a
Hi,
Am 27.04.2009 um 19:56 schrieb jim:
I forgot to say that I have:
let clj_want_gorilla = 1
let vimclojure#NailgunClient = /home/jim/clojure/ng
in my .vimrc file.
That's clear. Otherwise you wouldn't have the mapping
in the :map output.
I'm a bit confused about the beep... There is no
The lack of error message stuck me as well.
The result of :messages simply lists Bram Molenaar as the messages
maintainer.
I also mapped \ab to a so that it would enter insert mode and that
worked fine. So I don't think it's a problem with the mapping. I'm
guessing the plugin isn't fully loaded
On Apr 27, 11:22 am, Christophe Grand christo...@cgrand.net wrote:
find-first-result is already in core: some
As an aside, I would have liked (some pred coll) to return the item
that makes the pred true and the current implementation of `some to be
renamed `any? so that we would have the
Can you post your code, always helpful :)
On Mon, Apr 27, 2009 at 4:07 PM, fitzpatrick...@googlemail.com
fitzpatrick...@googlemail.com wrote:
Hi,
I am working with a very long list and populating it to a map. What i
have is three pieces of data from the list;
-Row Number
-Heading info
Unless you provide some kind of isolated source code that reproduces
the problem, I don't think it is going to be easy to help you out.
But try adding (doall ..) to some your map calls and others.
Even better, look at this excellent explanation why this might be
happening by Cristophe Grand:
Hello all,
It seems to me that areduce can not be used with an anonymous array.
Consider:
(areduce (.. System getProperties values toArray) i r 0
(some_expression))
It seems to me that there is no way to get i'th element of the array
in (some_expression) other than let'-ing it first.
It would
Hi,
Here is the code. Each row of data is a string with @ between the
three types of data i mentioned.
-Row Number
-Heading info List
-Actual Info List
The Heading Info List is created by splitting on , as is the Actual
info list.
tks,
PJ
(import '(java.io InputStreamReader OutputStreamWriter))
I think in my attempt to fix the problem, I masked a symptom.
When I saw that I didn't have the key mappings, I added some autocmds
to my .vimrc. From reading the vim plugin, I believe those should have
been generated automatically when a *.clj file is loaded. Removing
those autocmds from the
Hi,
Am 27.04.2009 um 22:18 schrieb jim:
The lack of error message stuck me as well.
The result of :messages simply lists Bram Molenaar as the messages
maintainer.
I also mapped \ab to a so that it would enter insert mode and that
worked fine. So I don't think it's a problem with the mapping.
New patch with corrections posted to google code,
regards,
--
laurent
2009/4/27 Laurent PETIT laurent.pe...@gmail.com:
I've created issue 110 with the patch attached in clojure's google code
project.
Hi Rich, Howard,
I'll answer to both at the same time, trying to reconcile things a
I suspect I will be asking more questions, so in order not to start
another thread I will post below :)
Why
((comp - +) -3 -4) = 7
but
((comp Math/abs +) -3 -4) = Error?
java.lang.Exception: No such namespace: Math (NO_SOURCE_FILE:1)
[Thrown class clojure.lang.Compiler$CompilerException]
Hi,
Am 27.04.2009 um 22:50 schrieb jim:
Reading the vimclojure plugin, I see that it checks for the existence
of b:vimclojure_namespace before adding those mappings. When I do
a :echo b:vimclojure_namespace, I get an undefined variable error.
Please try the following from outside vim:
ng
Hi,
Am 27.04.2009 um 23:17 schrieb Boris Mizhen:
((comp #(Math/abs %) +) -3 -4) = 7
How can I pass a static java function to another function?
Here you already gave the answer to your question. Wrap it in
a Clojure fn/#().
A member function must be trickier because this must be supplied,
Is there something in core or contrib that supports creating a map
where gets on undefined keys return a specified default value? For
example, I'd like to create a hashmap where the default value for
missing keys is zero.
--
R. Mark Volkmann
Object Computing, Inc.
Hi Mark,
Am 27.04.2009 um 23:42 schrieb Mark Volkmann:
Is there something in core or contrib that supports creating a map
where gets on undefined keys return a specified default value? For
example, I'd like to create a hashmap where the default value for
missing keys is zero.
You can specify
Hi Meikel, thanks for the answer.
I wonder if someone could explain or point me to the explanation about
*why* a Java static fn can't be passed just like a closure fn?
After all the syntax to call them is the same :)
Thanks,
Boris
On Apr 27, 5:34 pm, Meikel Brandmeyer m...@kotka.de wrote:
no, the syntax is not the same.
user= (macroexpand-1 '(.foo bar))
(. bar foo)
On Mon, Apr 27, 2009 at 2:51 PM, Boris Mizhen bo...@boriska.com wrote:
Hi Meikel, thanks for the answer.
I wonder if someone could explain or point me to the explanation about
*why* a Java static fn can't be
Konrad,
Thanks for the guidance, this makes a lot of sense - I was planning to
provide a method for printing these objects in the future anyway.
A bit of background: I'm trying to put together a simple framework
that uses structures to represent business-domain objects read from a
database,
On Apr 27, 5:51 pm, Boris Mizhen bo...@boriska.com wrote:
I wonder if someone could explain or point me to the explanation about
*why* a Java static fn can't be passed just like a closure fn?
The only reason I can give you is that Java methods aren't first-class
objects, like Clojure fns.
The
I have a library called FnParse, and I'm wondering if I should rewrite
it using monads. (You can see FnParse's documentation at http://
wiki.github.com/joshua-choi/fnparse and its implementation at http://
github.com/joshua-choi/fnparse/blob/
How can I pass a static java function to another function?
There is also memfn:
(memfn name args)
Macro
Expands into code that creates a fn that expects to be passed an
object and any args and calls the named instance method on the object
passing the args. Use when you want to treat a Java
Monads are a great thing to learn because they can be used in so many
ways to make code simpler and more modular. But, they require an
investment of time to understand. You'll definitely be a better
programmer by trying to understand them. I'd say go for it, but
realize that it's going to be a
That was exactly what I was reading through the vimclojure.vim plugin
trying to find when I saw your post. It's a great thing to have when
trying to trouble shoot problems because you can isolate the server.
Anyway, I started over by wiping out my .vim and vimclojure-2.1.0
directories. Updated
Hey Antonio,
I'm getting a similar error. I wanted to call setuid from Clojure, so
I followed this link's example:
http://www2.sys-con.com/itsg/virtualcd/Java/archives/0510/Silverman/index.html
to build a java class and a shared library. I added the class to my
classpath and was able to import
Thanks to all who replied.
To summarize what I learned - Clojure has a special form (. ) to
*call* java functions, but does not have concept of a *value*
corresponding to a java function.
This makes Java functions a second class citizen :)
In addition special forms are expanded in the first
Hi Patrick,
Please provide some code.
fitzpatrick...@googlemail.com a écrit :
I iterate through the list and for each row look up each of the
heading names in the Heading Info List to get an index of where a
particular element should be in the Actual Info List and then i go and
get this
57 matches
Mail list logo