Domina: html in strings?

2012-01-22 Thread David Powell
Hi,

I'm just starting with clojurescript and domina.  I have some html in
a string, eg:

(def s "Hello")

Is it possible to run xpaths over this node?  (nodes s) seems to
convert it into some sort of dom object...

Is it possible to change the text of the h3 element?

Am I going about this wrong - should I be attaching my snippet to the
document, and then xpathing it there?

-- 
Dave

-- 
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


Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-22 Thread Michael Klishin
Hi,

I am trying to make it possible to use functions as Quartz jobs for my Clojure 
DSL on top of
Quartz [1]. For that, I need to implement a simple 1-method interface. Both 
gen-class and defrecord with additional methods work great but seem too
heavyweight in many cases so I am trying to add function support using 
core/proxy.

The interface I need to implement looks like this:

https://gist.github.com/63989c1a081737813f99

and my code is basically this:

https://gist.github.com/a83687aed4ea62c915f5

However, when Quartz tries to execute a new job instance, 
UnsupportedOperationException is raised
as if execute was not implemented.

Listing methods on the class obtained via (class (proxy …)) suggests that the 
method is there and its signature looks
correct:

#

Quartz job factory instantiates new jobs using reflection API (.newInstance w/o 
arguments), not sure if this
may matter in this case. What I may be doing wrong?

Out of curiosity I tried using reify instead and in that case, I get 
instantiation exception. Can it be that reify generates default constructor 
with visibility other than public?

Thanks.


1. https://github.com/michaelklishin/quartzite

MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
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: Must a page refresh fire an init event?

2012-01-22 Thread Alex Robbins
Not sure what you are planning to do with the data, but you shouldn't
trust data in cookies. It is trivial to edit the cookies in your
browser using something like FireCookie [1]   Cookies are fine for
storing form info, or something like that, but you wouldn't want to
store something like admin=true in the cookie.

Alex

[1] https://addons.mozilla.org/en-US/firefox/addon/firecookie/

On Sat, Jan 21, 2012 at 10:16 PM, Folcon  wrote:
> Thanks a lot Daniel, much appreciated!
>
> --
> 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

-- 
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: Must a page refresh fire an init event?

2012-01-22 Thread Folcon
Hi Alex,

No nothing like that, more like keeping track of where the user was so a 
page refresh doesn't kill their state.

I'm still working out how "one" does things, it took me a little while to 
get how to add new template pages as I can't really use the browser repl. 
(I'm waiting for lein integration). It will be a lot easier to understand 
how things work when I can use my emacs repl :)...

Regards,
Folcon

-- 
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: Pretty-print with metadata

2012-01-22 Thread Tom Faulhaber
Chris, nice use of custom dispatch! I can't claim all the credit for
this mechanism. I based my work on the old XP system that has been
used in Lisp since the eighties. Standing on the shoulders of giants,
as it were. :)

It's been on my list to respect *print-meta* in the regular pprint
dispatch, but I'd like to improve the overall performance of pprint
(which is still slower than I'd like for large data structures) first.

In the meantime, this is a good solution.

Tom

On Jan 20, 2:51 pm, Chris Perkins  wrote:
> Good catch!  I was about to add this to my personal toolkit of "generally
> useful random crap" (every programmer has one of those, right?).  I'll make
> sure to cover that edge-case.  Thanks.
>
> - Chris

-- 
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


Clojure for Cocoa

2012-01-22 Thread Axel Katerbau, Objectpark
Hi all,

I'm pondering the idea of having Clojure for "regular" Mac OS/iOS
programming with the Objective-C libraries like Cocoa and the like.

Having a Clojure variant that embraces the Objective-C runtime would
be the goal.

But what would be the best way of achieving this? Building a LLVM
frontend? Using Clojure-In-Clojure (how far is this by the way?),
crafting some core libraries in Objective-C?

What do you think would be the best approach?

- Axel

-- 
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: Clojure for Cocoa

2012-01-22 Thread David Nolen
On Sun, Jan 22, 2012 at 4:06 AM, Axel Katerbau, Objectpark <
akater...@googlemail.com> wrote:

> Hi all,
>
> I'm pondering the idea of having Clojure for "regular" Mac OS/iOS
> programming with the Objective-C libraries like Cocoa and the like.
>
> Having a Clojure variant that embraces the Objective-C runtime would
> be the goal.
>
> But what would be the best way of achieving this? Building a LLVM
> frontend? Using Clojure-In-Clojure (how far is this by the way?),
> crafting some core libraries in Objective-C?
>
> What do you think would be the best approach?
>
> - Axel
>

This would be cool. I think just comes down to how ambitious you are.

ClojureScript is effectively Clojure-in-Clojure. Given that we can target
JavaScript communicating with Objective-C is not that difficult, i.e.
JSCocoa.

Having a version of Clojure that integrates with OS X as well as Clojure
integrates with the JVM will be a much more ambitious task but it would be
really, really cool.

Projects that seem relevant, at least to me:

* F-Script
* JSCocoa
* Clozure CL
* MacRuby

David

-- 
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: Clojure for Cocoa

2012-01-22 Thread Konrad Hinsen
David Nolen writes:

 > Having a version of Clojure that integrates with OS X as well as Clojure
 > integrates with the JVM will be a much more ambitious task but it would be
 > really, really cool.

As this would imply integrating with the C/C++/Objective universe in
general, it would also be very useful outside of the OS X platform.
It just looks like a lot of work.

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 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


seesaw texteditor.clj classpath error

2012-01-22 Thread jayvandal
I get this error with classpath. I This is not leiningen  but should
be simple

c:/opt/jars contains seesaw-1.2.2.jar

Classpath = c:/opt/jars/*;
Program is by Daveray. I copied it and changed name(line 1) to
seeeditor.core

(ns seeeditor.core
  (:use seesaw.core
[clojure.java.io :only [file]])
  (:import [javax.swing JFileChooser JEditorPane JScrollPane
BorderFactory]
   java.awt.Font)
  (:gen-class))

I run this and line
java -jar c:/opt/jars/clojure.jar c:/aproject/seeeditor.clj
 and got this

C:\Aproject>java -jar c:/opt/jars/clojure.jar c:/aproject/
seeeditor.clj
Exception in thread "main" java.io.FileNotFoundException: Could not
locate seesa
w/core__init.class or seesaw/core.clj on classpath:  (seeeditor.clj:1)

-- 
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


ANN: Clojure/West conf and training early bird ends this Friday

2012-01-22 Thread Alex Miller
If you want to meet with other Clojure developers, check out Clojure/
West in San Jose, CA March 16-17th!  It is preceded by several days of
training (which may also be taken independently from the conference).
The Clojure/West conference and training early bird rates end *this
Friday* Jan 27th.

Conference
* Schedule: http://clojurewest.org/schedule
* Register: http://regonline.com/clojurewest2012 - $375 till Friday!
* Sponsor: http://clojurewest.org/sponsor-prospectus

Training - $200 off till Friday!
* Register: http://regonline.com/clojurewest2012training
* Intro to Clojure (3 days) - Stuart Sierra, Alan Dipert -
http://clojurewest.org/training-intro-to-clojure
* Cascalog (3 days) - Sam Ritchie - http://clojurewest.org/training-cascalog
* Clojure Web (2 days) - Chris Granger - 
http://clojurewest.org/training-clojure-web
* Pallet (2 days) - Hugo Duncan, Toni Batchelli - 
http://clojurewest.org/training-pallet

Hope you can make it!
- Alex Miller

-- 
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: seesaw texteditor.clj classpath error

2012-01-22 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 23. Januar 2012 05:24:29 UTC+1 schrieb jayvandal:
>
> I run this and line 
> java -jar c:/opt/jars/clojure.jar c:/aproject/seeeditor.clj 
>
>
You want "-cp 'c:/opt/jars/clojure.jar;c:/opt/jars/seesaw-1.2.2.jar'" 
instead of "-jar c:/opt/jars/clojure.jar".

Sincerely
Meikel

-- 
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

Can Simplicity Scale?

2012-01-22 Thread daly
Can Simplicity Scale? 
http://blog.regehr.org/archives/663

Sadly you'll note that the source code
https://github.com/damelang/gezira/tree/master/nl
does not even include comments.

The code is "obvious" that it clearly does not
need comments since the machine has no trouble
understanding it. I, however, find it rather 
opaque. I wish it were literate and that the
literate program explained the ideas. 

Look at the code. It is clearly "simple" (but
not in the sense Rich Hickey mentioned). DSLs
are great and I use them a lot but a domain
specific "language" presumes you speak the
"language". 

Tim Daly

-- 
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: seesaw texteditor.clj classpath error

2012-01-22 Thread jayvandal
How do you point to the clojure file , seeeditor.clj??

On Jan 22, 11:56 pm, "Meikel Brandmeyer (kotarak)" 
wrote:
> Hi,
>
> Am Montag, 23. Januar 2012 05:24:29 UTC+1 schrieb jayvandal:
>
> > I run this and line
> > java -jar c:/opt/jars/clojure.jar c:/aproject/seeeditor.clj
>
> You want "-cp 'c:/opt/jars/clojure.jar;c:/opt/jars/seesaw-1.2.2.jar'"
> instead of "-jar c:/opt/jars/clojure.jar".
>
> Sincerely
> Meikel

-- 
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: seesaw texteditor.clj classpath error

2012-01-22 Thread Meikel Brandmeyer (kotarak)
Hi,

I don't know. A random clojure file is not necessarily intended to be run 
as script. I don't know which source file you are talking about (at least I 
didn't find anything editor related in seesaw), so I can't say more.

However, your classpath setting was wrong. Maybe the command you are 
looking for is:

java -cp 'c:/opt/jars/clojure.jar;c:/opt/jars/seesaw-1.2.2.jar' 
clojure.main c:/aproject/seeeditor.clj.

Sincerely
Meikel

-- 
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