Re: ANN edn-java

2012-09-23 Thread Ben Smith-Mannschott
On Sun, Sep 23, 2012 at 3:59 AM, Mikera mike.r.anderson...@gmail.com wrote:
 Looks cool - going to try it out in a couple of my projects, thanks!

 Question - assuming this is pretty lightweight and efficient, would it also
 make sense to use it from Clojure in circumstances where you just want edn
 and don't need the full Clojure reader?

I suppose it might, if you really need the performance. I've compared
the performance slurping in large (10+ MB) files containing a long
series of maps and found edn-java to be about twice as fast as
Clojure's LispReader. (I can only speculate as to why.)

On the other hand, using clojure.core/read is far more idiomatic when
calling from Clojure and doesn't require an additional dependency.

// Ben

-- 
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: ANN Ritz 0.5.0

2012-09-23 Thread Timothy Washington
I was following the instructions on the ritz-nrepl
pagehttps://github.com/pallet/ritz/tree/develop/nrepl. And
I get the error below, when executing the *M-x nrepl-ritz-jack-in*
command.

...
at clojure.lang.RestFn.invoke(RestFn.java:703)
at
ritz.nrepl.debug_eval$eval2289$loading__4505__auto2290.invoke(debug_eval.clj:1)
at ritz.nrepl.debug_eval$eval2289.invoke(debug_eval.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:3894)
at ritz.nrepl$eval5$loading__4505__auto6.invoke(nrepl.clj:1)
at ritz.nrepl$eval5.invoke(nrepl.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval1.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6454)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: ex-info in
this context
at clojure.lang.Util.runtimeException(Util.java:156)
at clojure.lang.Compiler.resolveIn(Compiler.java:6720)
at clojure.lang.Compiler.resolve(Compiler.java:6664)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6625)
at clojure.lang.Compiler.analyze(Compiler.java:6198)
... 171 more



You mention that this is meant to be used in tandem with nrepl.el (*
nrepl-jack-in*)? Because it looks like a parallel tool (*nrepl-ritz-jack-in*).
Could you run through a typical workflow of setting and using the *M-x
nrepl-ritz-break-on-exception* command? I just want to make sure that I'm
grokking how to use it.

And thanks for all your work on this. I'm excited to start using it.


Tim Washington
Interruptsoftware.ca
416.843.9060



On Fri, Sep 21, 2012 at 11:05 PM, adrians nman...@gmail.com wrote:

 Hi Hugo,

 I'm trying to get ritz-nrepl going with the latest lein2 and nrepl.el from
 Melpa. I think I've followed the instructions on the project page, yet I
 get this, when I nrepl-ritz-jack-in:

 error in process sentinel: Could not start nREPL server: Exception in thread 
 main java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine

   at java.net.URLClassLoader$1.run(Unknown Source)


   at java.net.URLClassLoader$1.run(Unknown Source)

   at java.security.AccessController.doPrivileged(Native Method)

   at java.net.URLClassLoader.findClass(Unknown Source)

   at 

Re: language shootout / the phonecode study

2012-09-23 Thread Jules
As far as I can see, Odersky also doesn't follow the hint, and hence does 
not pass the test cases provided with the original problem. The hint is not 
really a hint but rather a change to the problem. The original problem is 
elegant and essentially consists of inverting a clearly defined function 
that maps word+number sequences to phone numbers. That's why logic 
programming (and for comprehensions which is a poor man's logic 
programming) is so good at it. Unfortunately, implementing the problem plus 
hint pretty much forces you to use the exact same imperative algorithm as 
he did to generate his test cases. The people in the study also had to do 
the same, so if you want your code to be comparable with the results in the 
study that's what you have to do...

Jules

On Saturday, September 22, 2012 6:23:25 PM UTC+2, David Nolen wrote:

 On Sat, Sep 22, 2012 at 11:27 AM, Dennis Haupt d.ha...@gmail.comjavascript:
  wrote:

 here's my solution:
 https://gist.github.com/3766508

 the original (done in 2 hours) solution is commented out. i made some
 improvements and solved the whole thing in 39 lines (counting only the
 content of main). doing it in the minimal amount of lines was not my
 goal. i was trying to minimize the logic. shorter code was just a side
 effect.

 try to beat it :). let's see how that looks in clojure.


 Looks pretty convoluted ;)

 Here's Odersky's Scala version and mine that uses core.logic 
 http://gist.github.com/1107653.

 I'm headed to StrangeLoop so I don't have time to verify that the Scala or 
 my version fully satisfies the original problem description. But my guess 
 is that Odersky did really solve the original problem.

 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: language shootout / the phonecode study

2012-09-23 Thread Mark Engelberg
I agree that Odersky's version doesn't match the spec.  Hint or no hint, it
doesn't look like he even attempts to address the issue of inserting single
digits into the encoding.  He's solving a different, somewhat simpler
problem.

I don't agree that the hint changes the problem statement.  The original
spec is relatively clear about the conditions under which you are allowed
to insert a plain digit in the encoding.  I can see how someone might
interpret it differently, but it stresses that it's meant to be treated as
a local decision -- you can only insert a digit if no word from the
dictionary is a leftmost substring of the remaining letters.  The hint
simply clarifies what is already in the spec.

Has anyone tried running Nolen's core.logic version yet to see if it
works?  At first glance, it looks like it only finds combinations of
exactly two words that combine to encode the number, which isn't even the
version that Odersky did.

--Mark

-- 
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: language shootout / the phonecode study

2012-09-23 Thread Dennis Haupt
i did not need the hint to develop a correct solution. the hint just
clarifies what could have been misunderstood.

Am 23.09.2012 21:03, schrieb Mark Engelberg:
 I agree that Odersky's version doesn't match the spec.  Hint or no hint,
 it doesn't look like he even attempts to address the issue of inserting
 single digits into the encoding.  He's solving a different, somewhat
 simpler problem.
 
 I don't agree that the hint changes the problem statement.  The original
 spec is relatively clear about the conditions under which you are
 allowed to insert a plain digit in the encoding.  I can see how someone
 might interpret it differently, but it stresses that it's meant to be
 treated as a local decision -- you can only insert a digit if no word
 from the dictionary is a leftmost substring of the remaining letters. 
 The hint simply clarifies what is already in the spec.
 
 Has anyone tried running Nolen's core.logic version yet to see if it
 works?  At first glance, it looks like it only finds combinations of
 exactly two words that combine to encode the number, which isn't even
 the version that Odersky did.
 
 --Mark
 
 -- 
 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: Clojure Course on Coursera

2012-09-23 Thread Stefan Edlich
The community should make an own course and not wait till some god appears 
in coursera.
If someone could host an online learning environment (Google has something 
new?!)
we could split Clojure into 100 topics. Then we need 100 persons to produce 
each a 5-10 
min Video. I would coordinate the 100 topics and produce one video. 
We just need 99 other volunteers...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

clojurescript: how to use clojure.reflect/doc in the cljs-repl?

2012-09-23 Thread Frank Siebenlist
Trying to use the clojure.reflect/doc function in the cljs-repl, 
but I only errors 

---

ClojureScript:cljs.user (clojure.reflect/doc clojure.reflect/doc)
nil
Reflection query failed.
ClojureScript:cljs.user (clojure.reflect/doc clojure.reflect.doc)
nil
Reflection query failed.
ClojureScript:cljs.user (clojure.reflect/doc 'clojure.reflect.doc)
nil
Reflection query failed.
ClojureScript:cljs.user (clojure.reflect/doc 'doc)
nil
Reflection query failed.

---

Do I have to configure something on the server side maybe?
Any suggestions?

Thanks, FrankS.

-- 
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: *ns*, all-ns, ns-map, ns-publics, ns-* ?

2012-09-23 Thread Frank Siebenlist
Understand that there are no implementations (yet) of *ns*, all-ns, ns-map, 
ns-publics, ns-* for cljs, but was wondering how some of that associated info 
could be found at the repl or in your cljs-code…

Could I introspect the java object hierarchy to find some of that information?

Thanks, Frank.

-- 
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: language shootout / the phonecode study

2012-09-23 Thread Jules
The spec says if there is no word in the dictionary that can be used in 
the partial encoding starting at digit k+1 then a digit can be used. Some 
people interpreted that as no word from the dictionary can be used in a 
solution. Others interpreted that as no word from the dictionary can be 
used for a single word addition :)

Are there other challenges like this study?

On Sunday, September 23, 2012 9:40:35 PM UTC+2, HamsterofDeath wrote:

 i did not need the hint to develop a correct solution. the hint just 
 clarifies what could have been misunderstood. 

 Am 23.09.2012 21:03, schrieb Mark Engelberg: 
  I agree that Odersky's version doesn't match the spec.  Hint or no hint, 
  it doesn't look like he even attempts to address the issue of inserting 
  single digits into the encoding.  He's solving a different, somewhat 
  simpler problem. 
  
  I don't agree that the hint changes the problem statement.  The original 
  spec is relatively clear about the conditions under which you are 
  allowed to insert a plain digit in the encoding.  I can see how someone 
  might interpret it differently, but it stresses that it's meant to be 
  treated as a local decision -- you can only insert a digit if no word 
  from the dictionary is a leftmost substring of the remaining letters. 
  The hint simply clarifies what is already in the spec. 
  
  Has anyone tried running Nolen's core.logic version yet to see if it 
  works?  At first glance, it looks like it only finds combinations of 
  exactly two words that combine to encode the number, which isn't even 
  the version that Odersky did. 
  
  --Mark 
  
  -- 
  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

clojurescript: var names with - and _ are rendered to the same internal name (?)

2012-09-23 Thread Frank Siebenlist
The following cljs-repl session shows the issue:



ClojureScript:cljs.user (def my-var YES)
YES
ClojureScript:cljs.user my-var
YES
ClojureScript:cljs.user (def my_var NO)
NO
ClojureScript:cljs.user my_var
NO
ClojureScript:cljs.user my-var
NO
ClojureScript:cljs.user (set! my-var MAYBE)
MAYBE
ClojureScript:cljs.user my_var
MAYBE
ClojureScript:cljs.user



The official clojure spec allows both - and _ in the symbol names 
(http://clojure.org/reader), and the clojurescript docs don't mention anything 
about this as far as I could tell.

Not sure if this has been reported before - I searched JIRA and the mailing 
list, but couldn't find anything, but it's difficult to search for _…

Bug?
Mapping limitation?

-FrankS.

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