Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-23 Thread Denis Labaye
at which point?

$ lein deps
$ lein repl
user= (use 'clj-ns-browser.sdoc)
user= (sdoc)



On Thu, Aug 23, 2012 at 4:48 AM, blackblock mathn...@gmail.com wrote:

 I get this with Lein2 with lein repl:

 IllegalStateException escape-html already refers to:
 #'hiccup.core/escape-html in namespace: hiccup.page
 clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)


 On Thursday, August 23, 2012 7:33:44 AM UTC+10, FrankS wrote:

 Check out clj-ns-browser 
 (https://github.com/franks42/**clj-ns-browserhttps://github.com/franks42/clj-ns-browser).


 When a var is defined, you can look at it's value, which is presented
 with pprint, which means that most data structures are nicely displayed.

 When the value is a list/tree-like data structure, you can bring up
 Rich's original tree browser with the click of a button to look at the
 values. (that widget should really be rewritten as it's look and feel good
 be improved… but it works!)

 Furthermore, there is a menu button that turns on an auto-refresh for the
 var's displayed value such that you can follow the var's value near
 real-time.

 This may help with your requirements...

 Enjoy, Frank.


 On Aug 22, 2012, at 1:58 PM, Denis Labaye denis@gmail.com wrote:

  Hi everyone,
 
  The clojure.inspector functions are ... mmm ... a bit rough on the
 edge =)
 
  Is there any lib that provide better support for exploring Clojure
 data-structures?
 
  I am surprised I didn't found anything on Google, GitHub, ...
  Data-structures are at the core of Clojure, so being able to view /
 explore them seems a basic need to me.
 
  For example:
 
  ;; this works fine
  (clojure.inspector/inspect-**tree (range 10))
 
  ;; this breaks
  (clojure.inspector/inspect-**tree (range))
 
  It seems to me that it would be trivial™ to implement a viewer that
 would be able to display (possibly infinite) lazy nested data structures.
 
  Any ideas?
 
  Cheers,
 
  Denis
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clo...@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+u...@**googlegroups.com
  For more options, visit this group at
  http://groups.google.com/**group/clojure?hl=enhttp://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


-- 
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: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-23 Thread Denis Labaye
On Thu, Aug 23, 2012 at 8:39 AM, Denis Labaye denis.lab...@gmail.comwrote:

 at which point?

 $ lein deps
 $ lein repl
 user= (use 'clj-ns-browser.sdoc)
 user= (sdoc)



 On Thu, Aug 23, 2012 at 4:48 AM, blackblock mathn...@gmail.com wrote:

 I get this with Lein2 with lein repl:

 IllegalStateException escape-html already refers to:
 #'hiccup.core/escape-html in namespace: hiccup.page
 clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)


By the way try it with a brand new project:

lein new clj-ns-browser-test

add the deps in project.clj: :profiles {:dev {:dependencies
[[clj-ns-browser 1.2.0]]}}

should work

it's probably because you try to use it with an existing project and
there's a var collision (you shouldn't use :use without filters, it's
only convenient for quick testing)

use uses refer , and as stated in the doc string:

(doc use)
Like 'require, but *also refers to each lib's* namespace using
clojure.core/refer

(doc refer)
For each public interned var in the namespace named by the symbol,
adds a mapping from the name of the var to the var to the current
namespace. *Throws an exception if name is already mapped to**
**something else in the current namespace*. Filters can be used to
select a subset, via inclusion or exclusion, or to provide a mapping
to a symbol different from the var's name, in order to prevent
clashes. Use :use in the ns macro in preference to calling this directly.

See: http://clojuredocs.org/clojure_core/clojure.core/refer

Clojure namespaces are nasty =)

Denis



 On Thursday, August 23, 2012 7:33:44 AM UTC+10, FrankS wrote:

 Check out clj-ns-browser 
 (https://github.com/franks42/**clj-ns-browserhttps://github.com/franks42/clj-ns-browser).


 When a var is defined, you can look at it's value, which is presented
 with pprint, which means that most data structures are nicely displayed.

 When the value is a list/tree-like data structure, you can bring up
 Rich's original tree browser with the click of a button to look at the
 values. (that widget should really be rewritten as it's look and feel good
 be improved… but it works!)

 Furthermore, there is a menu button that turns on an auto-refresh for
 the var's displayed value such that you can follow the var's value near
 real-time.

 This may help with your requirements...

 Enjoy, Frank.


 On Aug 22, 2012, at 1:58 PM, Denis Labaye denis@gmail.com wrote:

  Hi everyone,
 
  The clojure.inspector functions are ... mmm ... a bit rough on the
 edge =)
 
  Is there any lib that provide better support for exploring Clojure
 data-structures?
 
  I am surprised I didn't found anything on Google, GitHub, ...
  Data-structures are at the core of Clojure, so being able to view /
 explore them seems a basic need to me.
 
  For example:
 
  ;; this works fine
  (clojure.inspector/inspect-**tree (range 10))
 
  ;; this breaks
  (clojure.inspector/inspect-**tree (range))
 
  It seems to me that it would be trivial™ to implement a viewer that
 would be able to display (possibly infinite) lazy nested data structures.
 
  Any ideas?
 
  Cheers,
 
  Denis
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clo...@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+u...@**googlegroups.com
  For more options, visit this group at
  http://groups.google.com/**group/clojure?hl=enhttp://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




-- 
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: real-world usage of reducers?

2012-08-23 Thread nicolas.o...@gmail.com
If it is so slow, that's maybe because the branching factor is very high.
Could you have an atom incremented in your evaluation function, or in
next level, to check how many boards are generated for level 2 or 3?
(At least this could give an approximate time for computing each board.
(83 - 8) / num board computed. To check it is in line with what you
mesured of core.logic.)

And why do you need an atom in the move function?
(When is it changed?)

Lastly, if you just need core.logic to compute valid moves from the
logical rules of chess and do not check they actually
apply here, you could precompute that into a big table, which might or
not be faster.

-- 
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: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();

On 23/08/12 09:35, nicolas.o...@gmail.com wrote:

If it is so slow, that's maybe because the branching factor is very high.
Could you have an atom incremented in your evaluation function, or in
next level, to check how many boards are generated for level 2 or 3?
(At least this could give an approximate time for computing each board.
(83 - 8) / num board computed. To check it is in line with what you
mesured of core.logic.)

 hmm...good idea! I'll try that


And why do you need an atom in the move function?
(When is it changed?)


Apart from the 'try-move' fn that is part of the Move protocol I also 
have an 'execute!' fn that simply calls 'try-move' and resets the board 
atom with the result of 'try-move' (a new board). This is not called at 
all in searching - only when I've got my gui up and actually playing on 
screen...

Lastly, if you just need core.logic to compute valid moves from the
logical rules of chess and do not check they actually
apply here, you could precompute that into a big table, which might or
not be faster.


hmmm i'd never thought of that! I would need a table with roughly 64 
rows (the board) x 6 columns (the pieces)...I will try that as well!


thanks Nicolas

Jim

--
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: dumping maps out to XML

2012-08-23 Thread semperos
The following is a 
start: http://clojuredocs.org/clojure_core/clojure.xml/emit-element

The :tag, :attrs, :content trio is a common pattern in Clojure libraries 
that deal with XML.

-Daniel

On Wednesday, August 22, 2012 9:40:28 PM UTC-4, larry google groups wrote:

 Forgive me if this has been asked before. I am a beginner. I have a data 
 structure that is composed of maps nested inside of a map. What is the 
 easiest way to dump this out as XML? 

-- 
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: dumping maps out to XML

2012-08-23 Thread Denis Labaye
On Thu, Aug 23, 2012 at 3:40 AM, larry google groups 
lawrencecloj...@gmail.com wrote:

 Forgive me if this has been asked before. I am a beginner. I have a data
 structure that is composed of maps nested inside of a map. What is the
 easiest way to dump this out as XML?


Why do you want to do that?

Because if all you want to do is persist data to read it back later you
could just do :


(def m {:person {:firstname john
 :lastname  doe}})

;; persist on disk
(spit /home/d/m.clj m)

;; read back later
(read-string (slurp /home/d/m.clj))



  --
 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: Parser combinators in parsatron

2012-08-23 Thread Alexsandro Soares
Ok. Thanks for the answer.

Is there any way to get the line and column?

For example, in this parser

(defparser ident []
   ( (letter) (many (either (letter) (digit)

I want the token and the initial line and column. How can I change this
code?

Cheers,
Alex

-- 
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: Parser combinators in parsatron

2012-08-23 Thread Nate Young
On Thu, Aug 23, 2012 at 9:24 AM, Alexsandro Soares
prof.asoa...@gmail.com wrote:
 Ok. Thanks for the answer.

 Is there any way to get the line and column?
The Parsatron doesn't have any builtin facilities for extracting line
numbers from tokens, you'd have to keep track of the number of newline
characters your parser has seen through some manually-implemented
manner.

Nate

-- 
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: Deprecation of Swank Clojure, long live nrepl.el

2012-08-23 Thread Warren Lynn

Does anyone know how to let lein2 to use the latest nrepl server (beta9 for 
now). It seems right now (preview8) it is using beta8. I am eager to find 
out if beta9 fixed the ac-nrepl exception on namespace completion 
(according to ac-nrepl issue tracking, that is caused by the server). Thank 
you.

-- 
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: Deprecation of Swank Clojure, long live nrepl.el

2012-08-23 Thread Chas Emerick
Just adding [org.clojure/tools.nrepl 0.2.0-beta9] to your project 
dependencies should do it.

Can you point me to this ac-nrepl issue that may be server-related?

- Chas

On Aug 23, 2012, at 10:59 AM, Warren Lynn wrote:

 
 Does anyone know how to let lein2 to use the latest nrepl server (beta9 for 
 now). It seems right now (preview8) it is using beta8. I am eager to find out 
 if beta9 fixed the ac-nrepl exception on namespace completion (according to 
 ac-nrepl issue tracking, that is caused by the server). Thank you.
 
 -- 
 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: What is the meaning of :while in a for ?

2012-08-23 Thread Andy Fingerhut
I've added some examples of :when and :while, including those given by Herwig 
and Tassilo in this thread, at ClojureDocs:

http://clojuredocs.org/clojure_core/clojure.core/for

Note: Anyone with a free account can add/edit examples on that site.

Andy

On Aug 21, 2012, at 8:34 AM, nicolas.o...@gmail.com wrote:

 I understand now.
 The documentation could be clearer on that.
 Your triangular example is very clear.

-- 
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: What is the meaning of :while in a for ?

2012-08-23 Thread Ambrose Bonnaire-Sergeant
Thanks Andy, that's awesome.

On Thu, Aug 23, 2012 at 11:22 PM, Andy Fingerhut
andy.finger...@gmail.comwrote:

 I've added some examples of :when and :while, including those given by
 Herwig and Tassilo in this thread, at ClojureDocs:

 http://clojuredocs.org/clojure_core/clojure.core/for

 Note: Anyone with a free account can add/edit examples on that site.

 Andy

 On Aug 21, 2012, at 8:34 AM, nicolas.o...@gmail.com wrote:

  I understand now.
  The documentation could be clearer on that.
  Your triangular example is very clear.

 --
 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: What is the meaning of :while in a for ?

2012-08-23 Thread nicolas.o...@gmail.com
That's amazing.
Thanks.

On Thu, Aug 23, 2012 at 4:22 PM, Andy Fingerhut
andy.finger...@gmail.com wrote:
 I've added some examples of :when and :while, including those given by Herwig 
 and Tassilo in this thread, at ClojureDocs:

 http://clojuredocs.org/clojure_core/clojure.core/for

 Note: Anyone with a free account can add/edit examples on that site.

 Andy

 On Aug 21, 2012, at 8:34 AM, nicolas.o...@gmail.com wrote:

 I understand now.
 The documentation could be clearer on that.
 Your triangular example is very clear.

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



-- 
Sent from an IBM Model M, 15 August 1989.

-- 
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: Deprecation of Swank Clojure, long live nrepl.el

2012-08-23 Thread Tim King
On Thu, Aug 23, 2012 at 8:19 AM, Chas Emerick c...@cemerick.com wrote:

 Just adding [org.clojure/tools.nrepl 0.2.0-beta9] to your project
 dependencies should do it.

 Can you point me to this ac-nrepl issue that may be server-related?

 - Chas

 I don't think it is nREPL server related.  It has to do with with
clojure.complete and lein repl.

https://github.com/kingtim/nrepl.el/issues/63

-Tim

-- 
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: Parser combinators in parsatron

2012-08-23 Thread Alexsandro Soares
Hi Nate,

Can you provide the code for this?

Thanks,
Alex

2012/8/23 Nate Young youn...@gmail.com

 On Thu, Aug 23, 2012 at 9:24 AM, Alexsandro Soares
 prof.asoa...@gmail.com wrote:
  Ok. Thanks for the answer.
 
  Is there any way to get the line and column?
 The Parsatron doesn't have any builtin facilities for extracting line
 numbers from tokens, you'd have to keep track of the number of newline
 characters your parser has seen through some manually-implemented
 manner.

 Nate



-- 
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: Rich's The Value of Values and REST

2012-08-23 Thread vemv
There are few -if any- concepts attached to REST; it is just a low-level, 
ideologically-neutral technique. There is more than one way to do it, 
hence you really can't talk 'against' it any more than you can talk against 
hashmaps, for instance.

That said, getting RESTful design right is pretty hard, state-wise. 
Sofisticated usages will require substantially uglier URIs than the fancy 
examples that get promoted, and compromise the architecture of the provider 
system. Think iterators, promises, etc.

-- 
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: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();

Well I've got some results!!!

Firstly and more importantly, it was a great idea to put all the logical 
moves of the pieces on a table (2 level nested map). There is absolutely 
no need to recalculate them every time! nice catch Nicolas... the 
profiler now shows some 9000 less objects and sampling the memory shows 
byte[][] and char[] dominating (instead of core.logic.Substitutions and 
clojure.lang.RT.nth)...this should have been done from day 1!


As you suggested I defined an atom in order to check how many boards are 
being generated by the real 'generate' fn. Here are the results (using 
(rand-int 10) to score the leaves):


level 2:
--dummy: 27,000 leaves (0.5 sec)
--real:  8,000  leaves (19 sec)

level 3:
--dummy: 810,000 leaves (8 sec) (30 times more)
--real: 160,000 leaves  (327 sec)  (100 times more)

This tells us 2 things...

1) generating real boards is going to be at least 20 times more 
expensive than just repeating the same one!
2) using real generation of boards, we can see that level 3 has 20 times 
more leaves than level 2, which is NOT intuitive at first glance! level 
3 should have just over  20 times more leaves because some nodes will 
have 21 children...careful debugging however shows that this is 
compensated by some nodes having 19 children...at least for such small 
depth this is what seems to be happening...the 'next-level' fn has been 
thoroughly tested and does return the correct successors so I don't know 
what else to think...


performance is a bit horrible even though the fn that does the 
difference (next-level) is only called 2, 3 or 4 times (one for each 
level)...calling it on its own, on a real board full with pieces, 
returns in less than 35 ms while the dummy equivalent (repeat ... ... ) 
returns instantly (less than 1ms). But both these fns should only be 
called n times (where n is the depth)...this is weird stuff indeed...


Jim


On 23/08/12 12:43, Jim - FooBar(); wrote:

On 23/08/12 09:35, nicolas.o...@gmail.com wrote:
If it is so slow, that's maybe because the branching factor is very 
high.

Could you have an atom incremented in your evaluation function, or in
next level, to check how many boards are generated for level 2 or 3?
(At least this could give an approximate time for computing each board.
(83 - 8) / num board computed. To check it is in line with what you
mesured of core.logic.)

 hmm...good idea! I'll try that


And why do you need an atom in the move function?
(When is it changed?)


Apart from the 'try-move' fn that is part of the Move protocol I also 
have an 'execute!' fn that simply calls 'try-move' and resets the 
board atom with the result of 'try-move' (a new board). This is not 
called at all in searching - only when I've got my gui up and actually 
playing on screen...

Lastly, if you just need core.logic to compute valid moves from the
logical rules of chess and do not check they actually
apply here, you could precompute that into a big table, which might or
not be faster.


hmmm i'd never thought of that! I would need a table with roughly 64 
rows (the board) x 6 columns (the pieces)...I will try that as well!


thanks Nicolas

Jim


--
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: Deprecation of Swank Clojure, long live nrepl.el

2012-08-23 Thread Warren Lynn

I don't think it is nREPL server related.  It has to do with with 
clojure.complete and lein repl. 


 https://github.com/kingtim/nrepl.el/issues/63

 -Tim


Thanks. I did not understand it correctly. I will wait for lein to be 
updated.


 

-- 
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: real-world usage of reducers?

2012-08-23 Thread Jim - FooBar();

On 23/08/12 20:23, Jim - FooBar(); wrote:

But both these fns should only be called n times (where n is the depth).


now this is completely wrong!!! next-level should be called on every 
single node!!! 8421 times for level 2...


Jim

--
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: dumping maps out to XML

2012-08-23 Thread larry google groups


(def m {:person {:firstname john :lastname  doe}})
(spit /home/d/m.clj m)
(read-string (slurp /home/d/m.clj))


at repl:

{:person {:firstname john, :lastname doe}}

Good lord! How long has this been going on?



On Thursday, August 23, 2012 9:39:43 AM UTC-4, Denis Labaye wrote:



 On Thu, Aug 23, 2012 at 3:40 AM, larry google groups 
 lawrenc...@gmail.comjavascript:
  wrote:

 Forgive me if this has been asked before. I am a beginner. I have a data 
 structure that is composed of maps nested inside of a map. What is the 
 easiest way to dump this out as XML? 


 Why do you want to do that?

 Because if all you want to do is persist data to read it back later you 
 could just do : 


 (def m {:person {:firstname john
  :lastname  doe}})

 ;; persist on disk
 (spit /home/d/m.clj m)

 ;; read back later
 (read-string (slurp /home/d/m.clj))

  

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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: dumping maps out to XML

2012-08-23 Thread larry google groups
semperos, thanks. I might for now stick with Denis's suggestion, as it is 
simple, but the clojure docs you point out will be useful when I get more 
ambitious.

On Thursday, August 23, 2012 8:21:09 AM UTC-4, semperos wrote:

 The following is a start: 
 http://clojuredocs.org/clojure_core/clojure.xml/emit-element

 The :tag, :attrs, :content trio is a common pattern in Clojure libraries 
 that deal with XML.

 -Daniel

 On Wednesday, August 22, 2012 9:40:28 PM UTC-4, larry google groups wrote:

 Forgive me if this has been asked before. I am a beginner. I have a data 
 structure that is composed of maps nested inside of a map. What is the 
 easiest way to dump this out as XML? 



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

Clojurescript, is it ready yet?

2012-08-23 Thread Blake Miller
This is somewhat related, though it's not exactly what the OP asked about.

This compiles with GWT:
https://github.com/blak3mill3r/percolator/blob/master/play/src/com/whatsys/test.clj

Also I wanted to point out that you could export a public interface
with the GWT compiler and call it with clojurescript. I'm not sure if
I understand your needs exactly ... not sure if that would help.

I'm picturing writing a bunch of UI components in GWT, describing the
UiBinder xml file as clojure forms, generating the actual xml with
clojure at compile time, and if you wanted to you could also have that
data structure available to your clojurescript client.

Cheers!

-- 
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: Gwt-Clojure - lightweight browser implementation

2012-08-23 Thread Blake Miller
I realize this is an old thread ... and the blog link about the gwt-clojure 
project is dead.

I just wanted to mention that I'm working on something similar, with a 
somewhat different approach:

This one is a java metaprogramming toolkit written in clojure. It turns 
clojure forms into java source code which can be compiled with the GWT 
compiler.

It's not production-ready by any means, it is very experimental, but I'd be 
glad to have any feedback on the general concepts or the clojure code (this 
is my first clojure project, I'm probably missing a lot of good uses of the 
sequence libraries and such)

https://github.com/blak3mill3r/percolator/blob/master/play/src/com/whatsys/test.clj

On Thursday, June 17, 2010 7:08:20 AM UTC-7, lpetit wrote:

 Hi,

 Seems real interesting  !

 What I was not able to understand by reading your blog post, is which
 subset of clojure you ported to the client side ?

 Is it just a declarative API for the widgets part, or will it be
 possible, as with GWT java client side code, to embed logic,etc ?

 will it be possible to use atoms for managing state mutation, wiring
 fns as asynchronous callback functions , etc. ?


 2010/6/17 pfisk peter...@gmail.com javascript::
  I will release an open source version of Gwt-Clojure next week.
 
  My approach to building web applications is based on frame
  technology which has been used commercially in mainframe code
  generation for nearly 30 years. You build a library of data structures
  (frames) that describe an application and then send it to a code
  generator to write the application. I have used Clojure to build my
  frame engine. Gwt-Clojure was developed to make scripting easier on
  the client side. In summary, my approach is to build web apps 100% in
  Lisp.
 
 
  On Jun 16, 6:50 pm, Rick Moynihan rick.moyni...@gmail.com wrote:
  Neat!
 
  I'm currently writting a webapp with GWT for the browser client, and
  clojure on the server... What is your approach to doing this, and is
  the code available anywhere yet?
 
  R.
 
  On 15 June 2010 19:48, pfisk peter.f...@gmail.com wrote:
 
 
 
   Gwt-Clojure is a subset of the Clojure language which was developed
   for scripting GWT (Google Windows Toolkit) widgets in the browser
   environment. It is designed to be able to share code with Clojure
   running on the server.
 
   The current deployment size is about 145kb of Javascript - including
   the interpreter and several GWT widget classes.
 
   Test environment:http://wisperweb.appspot.com/
 
   Gwt-Clojure blog post:
 http://framegen.wordpress.com/2010/06/15/gwt-clojure/
 
   --
   You received this message because you are subscribed to the Google
   Groups Clojure group.
   To post to this group, send email to clo...@googlegroups.comjavascript:
   Note that posts from new members are moderated - please be patient 
 with your first post.
   To unsubscribe from this group, send email to
   clojure+u...@googlegroups.com javascript:
   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 clo...@googlegroups.comjavascript:
  Note that posts from new members are moderated - please be patient with 
 your first post.
  To unsubscribe from this group, send email to
  clojure+u...@googlegroups.com javascript:
  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

Dart

2012-08-23 Thread Jacob Goodson
Anyone thinking of targeting dart with clojure?

-- 
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: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-23 Thread Stuart Sierra
Somewhat-related, I started working on a graphical pretty-printer library 
for ClojureScript:
https://github.com/stuartsierra/cljs-formatter

Here's a screenshot:
https://github.com/stuartsierra/cljs-formatter/blob/master/screenshot-1.png

-S

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

2012-08-23 Thread David Nolen
On Wed, Aug 22, 2012 at 1:09 PM, Jacob Goodson
submissionfight...@gmx.com wrote:
 Anyone thinking of targeting dart with clojure?

I haven't heard of anything. Would be an interesting target but
perhaps a bit much if you're actually trying to reach JS clients.

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: dumping maps out to XML

2012-08-23 Thread Jim - FooBar();
make sure to bind *read-eval* to false when reading arbitrary code from 
files...


(defn read-back
Read the file f back on memory. Careful not to eval anything dangerous 
(#=).

[f]
(binding [*read-eval* false]
(read-string (slurp f

Jim


On 23/08/12 21:32, larry google groups wrote:

(def m {:person {:firstname john:lastnamedoe}})
(spit /home/d/m.clj m)
(read-string (slurp /home/d/m.clj))

at repl:

{:person {:firstname john, :lastname doe}}

Good lord! How long has this been going on?



On Thursday, August 23, 2012 9:39:43 AM UTC-4, Denis Labaye wrote:



On Thu, Aug 23, 2012 at 3:40 AM, larry google groups
lawrenc...@gmail.com javascript: wrote:

Forgive me if this has been asked before. I am a beginner. I
have a data structure that is composed of maps nested inside
of a map. What is the easiest way to dump this out as XML? 



Why do you want to do that?

Because if all you want to do is persist data to read it back
later you could just do :

(def m {:person {:firstname john

:lastname doe}})

;; persist on disk
(spit /home/d/m.clj m)

;; read back later
(read-string (slurp /home/d/m.clj))

-- 
You received this message because you are subscribed to the Google

Groups Clojure group.
To post to this group, send email to clo...@googlegroups.com
javascript:
Note that posts from new members are moderated - please be
patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com javascript:
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
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 


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

The Value of Values

2012-08-23 Thread Michael Jaaka
I'm just after watching the Rich's keynote - the value of values.
Man this is outstanding!
If i only knew that before, my newest information system would be much easier 
to debug,
state of entites were easier to reason and additionally I would had history, 
even by using current RDBM. You have pointed me the reason why writting 
information system was so hard by using previous concepts. I hope to have 
another possibility to write some new system but with use of that paradigm.
Thanks Rich, every time I watch some of your new keynote, I learn something 
valueable, even revolutionally.
Now I see the value of datomic, nevertheless the technique successfully can 
still be used with current DBs, so again good job for sharnig your poin of view.
Your keynote was dramaticlly enlightening, like learning new concepts in 
programming, but on architectual level

btw. your clojure have learnt me how to write better software, in immutable and 
higher order way, even by using so old and primitive langugage like java (oder
teammates and policy of my company dosen't allow to use not a mainstream 
languges, also there are some technloges wich require me to use java, like 
Gwt). More over thanks to the mental shift from imperative to functional, I 
feel constantly hungry for more knowledge about programming, because i know 
that universe is much larger than i thought (have alredy studied erlang, 
prolog, ocaml, f#, lisp, scala) 

Big thanks again and waiting for new keynotes!
Now its my time to start arrange business data like they were facts :-) Bye!

-- 
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: Rich's The Value of Values and REST

2012-08-23 Thread Stuart Halloway
 Rich was promoting functional programming. I can see functional programming 
 has its benefits, but you will need mutable states eventually somewhere to do 
 useful things. Functional programming just tell you to constraint yourself 
 when using mutable states. It's not like mutable states are to be avoided by 
 all means. I mean, do you want to get a copy of Google's internal state so 
 you can send it back to Google next time along with your search string, and 
 hence make Google search functional? That is neither practical nor desirable.

It is practical, and desirable, to make a complete (albeit lazily realized) 
value of e.g. entire databases available to any process in a system.  

Stu




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