Re: Clojurescript: unreachable values in associative arrays.

2011-09-04 Thread rdunklau
Thank you, it seems obvious now that you say it.

On Sep 4, 11:02 pm, Chris Granger ibdk...@gmail.com wrote:
 Try (aget (.attributes myelement) data-url)

 Cheers,
 Chris.

 On Sep 4, 8:52 am, rdunklau rdunk...@gmail.com wrote:







  Hello.

  I'm trying to use clojuresript in the browser, and I'm having trouble
  accessing object attributes with dashes in it.
  For example, I'd like to access the data-url attribute of a DOM
  element, but the compiler compiles (.data-url (.attributes myelement))
  to myelement.attributes.data_url.

  Is there a syntax translating to myelement.attributes['data-url'] ?

  Thanks !

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why I have chosen not to employ clojure

2010-03-23 Thread rdunklau
I think that he made a good point, despite his rantings.

As an experienced java developer, these are the steps I took while
setting my environment up and running.
- downloaded the jar, launched java -jar clojure.jar. I was able to
fiddle with the repl, but when it came to code something dependent
from external libraries (clojure-contrib, for example), I found myself
forging my classpath by hand. This is definitely something java
developers are not accustomed to anymore. Every java developer that i
know is using an IDE that manages the classpath for him.
- relying on lein to manage the deps for me. It is something specific
to learn, and I understand it may not be a correct solution. Moreover,
I found it difficult to do interactive development from the repl with
lein.
- tried vimclojure with nailgun. Besides the non-trivial task of
installing vimclojure, I was back to the manual classpath hell.

Now, i'm using maven with the clojure plugin, especially the
clojure:nailgun goal. It's by far the simplest solution I found. I
also tried CounterClockWise along the way, but was not convinced.

So, besides the JVM installation issues that I did not experienced,
since I'm used to have a JVM on every computer, there are still many
issues to set up a decent working environment.
A package containing clojure, maven and a wrapper around it designed
to create new projects easily may be way of making Clojure acceptable
for newbies coming from anywhere (java or whatever).

I'm now considering getting back to counterclockwise, especially
because I'm planning to write a tutorial covering all major aspects of
clojure, including the initial set up.
By the way, if someone has an idea about a sample application (simple,
but not trivial) which could lead the tutorial, and show different
aspects of the language, let me know !
I was thinking about a more complete and idiomatic version of Vincent
Foley's Fetching web comics tutorial, but something more
enterprisey seems more adequate.


--Ronan

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


clojure.contrib.sql : how not to use a transaction ?

2010-03-05 Thread rdunklau
Hello.

I'm trying to use clojure.contrib.sql to set up my database (on
postgresql)
However, i'm running into some problems : I did not find a way to
execute a (prepared) statement outside a transaction WITHOUT returning
the results.

What I tried so far:

(def mystatement CREATE DATABASE mydb WITH TEMPLATE = template0
ENCODING = 'UTF8' LC_COLLATE = 'fr_FR.utf8' LC_CTYPE = 'fr_FR.utf8';)

(do-commands mystatement)

-- PSQLException:
 Message: ERROR: CREATE DATABASE cannot run inside a transaction block


(with-query-results rs mystatement)

--org.postgresql.util.PSQLException: No results were returned by the
query.

So, is there any function which exposes the
PreparedStatement.executeUpdate() method directly ?

Thanks !

-- 
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 unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en