Re: Clojurescript :advanced compilation extern only partly working.

2015-01-30 Thread Crispin Wellington
That worked really well. So I have added a warning that prints when an 
extern resource file can't be found. It's a very small, one line, change. 
In doing this I noticed it prints two paths that can't be found. The file I 
specified in my :externs that isn't there, and another path 
"closure-js/externs". Further digging revealed this is being added to the 
externs by lein-cljsbuild. lein-cljsbuild release notes say:

"Automatically add `closure-js/libs` to `:libs` and `closure-js/externs` to 
`:externs`.  This means that libraries can put their libs and externs in 
`resources/closure-js/libs/` and 
`resources/closure-js/externs/`, respectively, and 
lein-cljsbuild will automatically pick them up."

So if it prints a warning, it's going to print the warning on almost any 
lein-cljsbuild jobs. I could make it ignore "closure-js/libs", but then 
I've pulled a bit of cljsbuild implementation detail into clojurescript 
itself.

I've made a pull request: 
https://github.com/clojure/clojurescript/pull/44 , but are people ok with 
it always printing a warning? Is there any other solution?

Regards

Crispin



On Friday, January 30, 2015 at 5:11:06 PM UTC+8, Thomas Heller wrote:
>
> For the missing data.json, you probably need to run "./script/bootstrap".
>
> I tend to just run "lein install" but the version which gets installed is 
> [org.clojure/clojurescript "0.0-SNAPSHOT"] so you have to adjust the 
> version in your project as well. Or edit the clojurescript/project.clj to 
> set a specific version.
>
> Alternatively you can run "./script/build" which generates a proper 
> version off the number of git commits but that script touches some files so 
> extra take must be taken those changes don't end up in any git commit later.
>
>
> On Friday, January 30, 2015 at 2:16:42 AM UTC+1, Crispin Wellington wrote:
>>
>> I got to the bottom of it. It's almost embarrassing to say. But the path 
>> to the w3c_audio.js extern file was wrong. Unfortunately, lein doesn't give 
>> any sort of warning or error if any of the externs files don't exist. I'm 
>> not sure if it's a cljsbuild issue, or a clojurescript issue, or a google 
>> closure compiler issue.
>>
>> So I am thinking I'll give adding this warning (or error?) to 
>> clojurescript a go. I notice in clojurescript source that closure.clj deals 
>> with running the closure compiler. I can see exactly where I want to add 
>> the warning (or tweak the calling of google closure compiler). I could do 
>> this, but I'm having trouble now running a locally built clojurescript. 
>>
>> I've checked it out. Added some debug. Then I build a jar with 'lein 
>> jar'. I upload it to a local maven repository. I add that repository to my 
>> project-with-the-missing-extern's project.clj. I lein deps. It grabs the 
>> new jar. I lein cljsbuild, and the build begins, but then the build 
>> explodes with:
>>
>> Exception in thread "main" java.io.FileNotFoundException: Could not 
>> locate clojure/data/json__init.class or clojure/data/json.clj on classpath: 
>> , compiling:(cljs/source_map.clj:1:1)
>> ...
>> Caused by: java.io.FileNotFoundException: Could not locate 
>> clojure/data/json__init.class or clojure/data/json.clj on classpath: 
>>
>> So this is now off the original topic, but how do you work on 
>> clojurescript itself? What step am I missing thats leading to the missing 
>> clojre/data/json.clj class on the classpath? What's the best workflow for 
>> hacking clojurescript itself?
>>
>> Regards
>>
>> Crispin
>>
>> On Wednesday, January 28, 2015 at 11:29:25 PM UTC+8, David Nolen wrote:
>>>
>>> Run a `lein deps :tree` to compare the version of the Google Closure 
>>> Compiler you are getting.
>>>
>>> David
>>>
>>> On Wed, Jan 28, 2015 at 9:58 AM, Crispin Wellington <
>>> retrogr...@gmail.com> wrote:
>>>
 OK something very strange is going on. I tried the let block, and it 
 was the same in my project. 

 So I created a new minimal project, lein new mies test-sound, and made 
 a minimal test: https://github.com/retrogradeorbit/test-sound

 And here it works!

 Go back to my old project, and it doesn't.

 So now I have to go and gradually work through the project differences 
 to see what's causing this. If I find anything, I'll post it.

 Thanks for your help

 Crispin

 On Wednesday, January 28, 2015 at 10:06:52 PM UTC+8, David Nolen wrote:
>
> I mentioned trying this in a `let` binding instead. What happens when 
> you try that?
>
> David
>
> On Wed, Jan 28, 2015 at 9:04 AM, Crispin Wellington <
> retrogr...@gmail.com> wrote:
>
>> No, that's not it. So I tried:
>>
>> (def audio-context (js/AudioContext.))
>> (.decodeAudioData audio-context (js/ArrayBuffer. 256) #(println "ok" 
>> %) #(println "error" %))
>>
>> and it compiled to:
>>
>> ;var zv = new AudioContext;
>> zv.Rd(new ArrayBuffer(256), function(a) {
>>   return fo.c(mh

Re: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-30 Thread David Nolen
I would prefer just Figwheel. Relying only on Figwheel also means you could
probably go out with an updated tutorial much sooner.

Thanks,
David

On Fri, Jan 30, 2015 at 4:10 PM, Sebastian Bensusan 
wrote:

> Hi David and Dan,
>
> I edited Om's Basic Tutorial (
> https://github.com/swannodette/om/wiki/Basic-Tutorial) to be used with
> Chestnut. Most of the work (not much!) was changing "evaluate in
> LightTable" to "save in your text editor". I don't know what the procedure
> is for updating a Wiki and having this conversation, *should I open an
> issue on Om?* I have it as a standalone repo in case someones wants to
> propose a change or make a pull request:
>
> https://github.com/bensu/basic-om-tut
>
> Two issues:
>
> 1. Chestnut 0.6.0 (current stable version) uses Om 0.7.3 and I needed to
> deref a cursor inside a go loop in order for things to work. See
> https://github.com/swannodette/om/issues/315 and
> https://github.com/swannodette/om/commit/92a3e0cf698769fb59bb3744faddaea40b37412d.
> Om version is bumped to 0.8.3 beta in v0.7.0-SNAPSHOT-20141226
>
> 2. Chestnut's 0.6.0 doesn't reload the index.html (not on save, not on
> refresh). The whole process needs to be restarted. See:
> https://github.com/plexus/chestnut/issues/84 This was addressed
> in v0.7.0-SNAPSHOT-20141207.
>
> *I would wait until Chestnut 0.7.0 *stable is published in Clojars before
> adding this tutorial to the Om Wiki. Otherwise, if you feel the extra
> dependency on Chestnut is also too much, I'll fork mies-om and add Figwheel
> there for the tutorial.
>
> After revising this work, I'll move on to the next tutorial.
>
> Best
>
> Sebastian Bensusan
>
>
>
> On Tuesday, January 27, 2015 at 5:25:09 PM UTC+1, David Nolen wrote:
>>
>> I think expecting every last thing to work especially from third parties
>> who may be wisely lagging behind is unlikely at least for the near future.
>>
>> I haven't kept up with Light Table and what issues it may have. Now is
>> probably a good time to remove the Light Table centric nature of the Om
>> tutorials and switch to a Figwheel based thing that doesn't require
>> anything more than your text editor of choice.
>>
>> The wiki has always been community editable and I would love to see
>> people push it forward especially with stuff like this. I will have less
>> time for such things as I focus more on Om core and ClojureScript
>> enhancements.
>>
>> David
>>
>> On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen  wrote:
>>
>>> Just testing clojurescript out so many possible pitfalls on my side here.
>>>
>>> Does the new javascript externals stuff break lighttables live external
>>> browser functionality?
>>>
>>> Following the basic intro tutorial I cannot get live updates to work.
>>> The mies-om om-tut is based on 0.8.4 , and it cannot reference
>>> com.facebook.react, while 0.8.6 cannot find cljsjs.react.
>>>
>>> It compiles nicely with lein, but I can't seem to get the lighttable
>>> live REPL stuff to work.
>>>
>>> Olav
>>>
>>> On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
>>> > The only significant change is that Om now relies on the cljsjs.react
>>> artifact instead of the one I maintained myself. cljsjs.react has the
>>> benefit that usage of React with addons instead of plain React may be
>>> configured via Maven in your pom.xml or your project.clj. It's exciting to
>>> see that we are already reaping the benefits of :foreign-libs and Maven
>>> over existing JavaScript solutions for managing dependencies.
>>> >
>>> >
>>> > This release also includes a fix for a very subtle set-state! bug
>>> discovered by Brenton Ashworth.
>>> >
>>> >
>>> >
>>> > Feedback welcome!
>>> >
>>> >
>>> > https://github.com/swannodette/om
>>> >
>>> >
>>> >
>>> > David
>>>
>>> --
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "ClojureScript" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojurescrip...@googlegroups.com.
>>> To post to this group, send email to clojur...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/clojurescript.
>>>
>>
>>  --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message becaus

Re: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-30 Thread Sebastian Bensusan
Hi David and Dan,

I edited Om's Basic Tutorial 
(https://github.com/swannodette/om/wiki/Basic-Tutorial) to be used with 
Chestnut. Most of the work (not much!) was changing "evaluate in 
LightTable" to "save in your text editor". I don't know what the procedure 
is for updating a Wiki and having this conversation, *should I open an 
issue on Om?* I have it as a standalone repo in case someones wants to 
propose a change or make a pull request:

https://github.com/bensu/basic-om-tut

Two issues:

1. Chestnut 0.6.0 (current stable version) uses Om 0.7.3 and I needed to 
deref a cursor inside a go loop in order for things to work. See 
https://github.com/swannodette/om/issues/315 and 
https://github.com/swannodette/om/commit/92a3e0cf698769fb59bb3744faddaea40b37412d.
 
Om version is bumped to 0.8.3 beta in v0.7.0-SNAPSHOT-20141226

2. Chestnut's 0.6.0 doesn't reload the index.html (not on save, not on 
refresh). The whole process needs to be restarted. See: 
https://github.com/plexus/chestnut/issues/84 This was addressed 
in v0.7.0-SNAPSHOT-20141207.

*I would wait until Chestnut 0.7.0 *stable is published in Clojars before 
adding this tutorial to the Om Wiki. Otherwise, if you feel the extra 
dependency on Chestnut is also too much, I'll fork mies-om and add Figwheel 
there for the tutorial.

After revising this work, I'll move on to the next tutorial.

Best

Sebastian Bensusan



On Tuesday, January 27, 2015 at 5:25:09 PM UTC+1, David Nolen wrote:
>
> I think expecting every last thing to work especially from third parties 
> who may be wisely lagging behind is unlikely at least for the near future.
>
> I haven't kept up with Light Table and what issues it may have. Now is 
> probably a good time to remove the Light Table centric nature of the Om 
> tutorials and switch to a Figwheel based thing that doesn't require 
> anything more than your text editor of choice.
>
> The wiki has always been community editable and I would love to see people 
> push it forward especially with stuff like this. I will have less time for 
> such things as I focus more on Om core and ClojureScript enhancements.
>
> David
>
> On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen  > wrote:
>
>> Just testing clojurescript out so many possible pitfalls on my side here.
>>
>> Does the new javascript externals stuff break lighttables live external 
>> browser functionality?
>>
>> Following the basic intro tutorial I cannot get live updates to work. The 
>> mies-om om-tut is based on 0.8.4 , and it cannot reference 
>> com.facebook.react, while 0.8.6 cannot find cljsjs.react.
>>
>> It compiles nicely with lein, but I can't seem to get the lighttable live 
>> REPL stuff to work.
>>
>> Olav
>>
>> On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
>> > The only significant change is that Om now relies on the cljsjs.react 
>> artifact instead of the one I maintained myself. cljsjs.react has the 
>> benefit that usage of React with addons instead of plain React may be 
>> configured via Maven in your pom.xml or your project.clj. It's exciting to 
>> see that we are already reaping the benefits of :foreign-libs and Maven 
>> over existing JavaScript solutions for managing dependencies.
>> >
>> >
>> > This release also includes a fix for a very subtle set-state! bug 
>> discovered by Brenton Ashworth.
>> >
>> >
>> >
>> > Feedback welcome!
>> >
>> >
>> > https://github.com/swannodette/om
>> >
>> >
>> >
>> > David
>>
>> --
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojurescrip...@googlegroups.com .
>> To post to this group, send email to clojur...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/clojurescript.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: call superclass constructor in clojure class generation with defrecord

2015-01-30 Thread Michael Blume
(defn my-window []
  (proxy [Window] []))

should do the trick

Proxy takes a vector of implemented interfaces and at most one superclass
(in your case, Window), and then a second vector of arguments to pass to
the superclass constructor (in your case, an empty vector) and then a
series of methods implemented/overridden on the parent class/interfaces --
in your case there's none of those.

My understanding is that proxy is not quite as performant as
reify/defrecord, but it's the only game in town if you actually want to
subclass something.

Hope this helps =)

On Fri Jan 30 2015 at 3:05:11 PM coco 
wrote:

> Hi everybody, I need implement this java code in clojure
>
>  public class MyWindow extends Window
>  {
> public MyWindow()
>  {
>   super("My Window!");
>  }
> }
>
> MyWindow myWindow = new MyWindow();
>
>
> unfortunately the clojure documentation for generate classes is not so
> complete or straightforward for my understand...must I use gen-class or can
> I use defrecord for this task?...how can I call super class
> constructors??...
>
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


call superclass constructor in clojure class generation with defrecord

2015-01-30 Thread coco
Hi everybody, I need implement this java code in clojure

 public class MyWindow extends Window
 {
public MyWindow()
 {
  super("My Window!");
 }
}

MyWindow myWindow = new MyWindow();


unfortunately the clojure documentation for generate classes is not so 
complete or straightforward for my understand...must I use gen-class or can 
I use defrecord for this task?...how can I call super class 
constructors??...

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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-30 Thread Jason Wolfe

On Friday, January 30, 2015 at 7:27:12 AM UTC-8, Marshall 
Bockrath-Vandegrift wrote:
>
> Not a solution to your immediate problem, but if this is for 
> new development (not an existing mass of clojure-hadoop code), I'd suggest 
> looking at Parkour instead.  As the main Parkour developer I'm obviously 
> biased, but Parkour exists in part because the compilation model used by 
> clojure-hadoop in order to meet Hadoop's expectations is very much at odds 
> with typical Clojure development. In particular, Parkour does not require 
> AOT compilation.
>
> https://github.com/damballa/parkour
>

Thanks for the recommendation.  For now we're looking for a simple 
low-level interface to MR, but we're also keeping an eye on parkour and 
pigpen for more complex tasks down the road.  Can you explain why I might 
prefer parkour to pigpen or vice-versa? 

 

>
>
> On Thursday, January 29, 2015 at 2:39:54 AM UTC-5, Jason Wolfe wrote:
>>
>> First off, I apologize in advance for not having a reduced test case, and 
>> express my sincere gratitude in advance for any assistance.  I've been 
>> tearing my hair out for a day or so and not making headway, and figured 
>> someone here might recognize some keywords and have a pointer in the right 
>> direction. (I'm admittedly pretty green when it comes to class loading, and 
>> have largely exhausted my google fu).  
>>
>> *Problem: *
>>
>> I'm submitting a hadoop job using clojure-hadoop.  All is well with a 
>> simple job, but once I require something that transitively depends on 
>> Schema, I end up with: 
>>
>> clojure.lang.Compiler$CompilerException: 
>> java.lang.IllegalArgumentException: No implementation of method: :walker of 
>> protocol: #'schema.core/Schema found for class: clojure.core$long, 
>> compiling:(crane/config.clj:33:4)
>>
>> It works fine when run in-process with hadoop-mapreduce-client-jobclient, 
>> but not with bin/hadoop -jar.  This stunk of a classloader issue, and after 
>> digging in it seems that there are multiple versions of clojure.core$long 
>> floating around.  The version on which the protocol is extended is not the 
>> same class for the fn that the symbol 'long resolves to in client code.
>>
>> *Context: *
>>
>> clojure-hadoop is AOT-compiled, and after being loaded by hadoop it 
>> dynamically loads the target namespace (not AOT-compiled, nor any other of 
>> the code in question) using 
>> https://github.com/alexott/clojure-hadoop/blob/master/src/clojure_hadoop/load.clj#L3
>>
>> From here, schema is transitively required, and then client namespaces 
>> attempt to use the Schema protocol to generate validators, and when the 
>> schema 'long is used (which resolves to the fn with class 
>> clojure.core$long), it fails to find the appropriate method.  
>>
>> After repeated head-bashing, I've determined that there are (at least 
>> two) versions of the clojure.core$long class floating around -- the one 
>> used to extend the protocol, which stems from a DynamicClassLoader, and the 
>> one that 'long resolves to in client code, which stems from a 
>> URLClassLoader.  The URLClassLoader is the loader of the current thread and 
>> Compiler, but not @(clojure.lang.Compiler/LOADER).
>>
>> *Attempts:*
>>
>> I've tried wrapping the clojure-hadoop loading code with 
>> .setContextClassLoader on some obvious candidates and binding 
>> *use-context-classloader* around the code doing the loading, with no avail. 
>>  I've tried changing the schema code to reference the class in different 
>> ways (class (resolve 'long)), (class 'long), etc and that hasn't made a 
>> difference.  I've checked and the clojure-hadoop jar doesn't contain any 
>> .class files for clojure, schema, or other offending code.  
>>
>> *Plea:*
>>
>> I suspect there's something obvious I'm missing.  (In retrospect it seems 
>> like the design of Schema may be suboptimal in light of this, but if 
>> possible I'd like to figure out a workaround without changing that 
>> substantially). Thanks in advance for your help -- any and all pointers are 
>> welcome.  
>>
>> -Jason
>>
>>
>>
>>  
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: From JavaScript to ClojureScript (Doing Computers screencast)

2015-01-30 Thread Hildeberto Mendonça
Excellent! Loved the format! Keep it up! Thanks a lot.

On Fri, Jan 30, 2015 at 5:58 AM, Mike Patella  wrote:

> Hey folks! I started the screencast series Doing Computers at the
> beginning of this month.
>
> I wanted to share what I believe is the best of the three screencasts I've
> released so far.
>
> https://www.youtube.com/watch?v=8UYa8PV3CXQ
>
> I managed to introduce a few obvious bugs while recording this one, so
> check out the youtube comments for timestamped corrections. And if you
> notice anything else, please reach out.
>
> Like all software, this series is a work-in-progress, so tasteful feedback
> on content and presentation is appreciated.
>
> Next, I'm working on giving Ruby a similar treatment; turning Ruby code
> into Clojure to illustrate what I feel are similarities between the way we
> use Sequences and our Ruby friends use Enumerables.
>
> Also, I would really appreciate content suggestions, I'm currently writing
> and researching for screencasts on clojure.test, core.async and core.typed.
> I intend to continue this series for at least the next year, so I will need
> a lot more ideas.
>
> Thanks for watching and also for your feedback!
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: lein discovery issues

2015-01-30 Thread Stephen Lester
Hey there Andrea,

So, when I do 'lein search', it caches the index. I don't have anything special 
in my setup (lein version 2.5.1 on Java 1.8.0_25).

Likewise, you can do searches for specific version headers, like

lein search "id:clojurescript version:0.0-2*" to find all the ones in the 
2000s. To get the latest version, you just have to get the last page of your 
query and look at the version number, or go to the specific library's page.


> Le 2015-01-30 à 08:37, andrea crotti  a écrit :
> 
> Noone on the topic?
> 
> Any smarter ways to lookup and try out new stuff with lein otherwise?
> 
> 2015-01-26 14:22 GMT+00:00 andrea crotti :
>> Hello everyone
>> 
>> A couple of questions about Lein and how to find templates/libraries.
>> 
>> I found out now that "lein search" allows me to search for the last
>> stable version of a library, however every time I run it it takes
>> forever downloading the index:
>> 
>> Downloading 
>> https://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
>> 
>> Is that normal and if yes how can I make it usable?
>> 
>> Then if I want to find out the correct version of clojurescript I go to 
>> Clojars:
>> https://clojars.org/search?q=clojurescript
>> 
>> And there I find a lot of things but  none of them seems the correct
>> thing, this is probably not the right thing:
>> https://clojars.org/clojurescript
>> 
>> I also noticed that many things in clojars don't have code available or
>> links to the project, how am I supposed to know what they are actually
>> useful for if there is no Readme/Source code or any other information?
>> 
>> And the last thing is that it would be interesting to see all the
>> possible project templates that can be used with a "lein new", but from
>> what I can understand it depends on the plugins that are currently
>> installed with lein, is that correct?
>> 
>> Thanks a lot,
>> Andrea
> 
> -- 
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: lein discovery issues

2015-01-30 Thread Sean Corfield
On Jan 26, 2015, at 6:22 AM, andrea crotti  wrote:
> A couple of questions about Lein and how to find templates/libraries.

For templates: https://clojars.org/search?q=lein-template

> Then if I want to find out the correct version of clojurescript I go to 
> Clojars:
> https://clojars.org/search?q=clojurescript

You should probably go to the source repo - or look on Maven Central first - 
then Clojars.

As for general discovery, sites like these are helpful:

* http://www.clojure-toolbox.com
* http://crossclj.info

> I also noticed that many things in clojars don't have code available or
> links to the project, how am I supposed to know what they are actually
> useful for if there is no Readme/Source code or any other information?

That pretty much answers your question. If there's no link to the library 
source repo and no details about the project, you should probably avoid it. Do 
you have a specific example that seems like it should be better documented?

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When to use metadata

2015-01-30 Thread adrian . medina
To be clear, I actually agree with Stuart. I would really like to dig into 
this topic and hear everyones thoughts on this; it's such a large piece of 
Clojure's private and public API. 

On Friday, January 30, 2015 at 1:53:37 PM UTC-5, adrian...@mail.yu.edu 
wrote:
>
> Metadata fields proliferate throughout the standard Clojure value and 
> reference types. It seems odd that one would suggest that this seemingly 
> well supported feature should not be taken advantage of except in very 
> narrow circumstances. What is the rationale for such robust support for 
> runtime metadata if their usage should be restricted primarily to 
> compile-time or metaprogramming tasks? If that was the primary purpose, 
> certainly a Common Lisp proclaim/declaim/declare-esque expression would be 
> preferable since then the compiler and macros can take advantage of this 
> information when reading forms without having to extract data out of 
> symbols on an ad-hoc basis. It makes me think maybe we're missing the point 
> here. Rich Hickey clearly carefully designed Clojure to support varied uses 
> of runtime metadata on Clojure objects. 
>
> On Friday, January 30, 2015 at 1:28:04 PM UTC-5, Stuart Sierra wrote:
>>
>> Almost never.
>>
>> Seriously, anything important enough to be included in your program's 
>> input or output is almost certainly important enough to be *data*, not 
>> metadata. And the non-equality-checking semantics of metadata are confusing.
>>
>> About the only place I've found metadata to be worthwhile is 
>> meta-programming namespaces and Vars, e.g. what clojure.test does.
>>
>> My personal rule of thumb is: if you strip all the metadata from your 
>> program it should still work, thought maybe less efficiently.
>>
>> –S
>>
>>
>> On Thursday, January 29, 2015 at 10:10:34 AM UTC-5, Jonathon McKitrick 
>> wrote:
>>>
>>> Is there a rule of thumb or set of use cases when metadata is a more 
>>> elegant solution than simply adding more entries to a map or record?
>>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When to use metadata

2015-01-30 Thread adrian . medina
Metadata fields proliferate throughout the standard Clojure value and 
reference types. It seems odd that one would suggest that this seemingly 
well supported feature should not be taken advantage of except in very 
narrow circumstances. What is the rationale for such robust support for 
runtime metadata if their usage should be restricted primarily to 
compile-time or metaprogramming tasks? If that was the primary purpose, 
certainly a Common Lisp proclaim/declaim/declare-esque expression would be 
preferable since then the compiler and macros can take advantage of this 
information when reading forms without having to extract data out of 
symbols on an ad-hoc basis. It makes me think maybe we're missing the point 
here. Rich Hickey clearly carefully designed Clojure to support varied uses 
of runtime metadata on Clojure objects. 

On Friday, January 30, 2015 at 1:28:04 PM UTC-5, Stuart Sierra wrote:
>
> Almost never.
>
> Seriously, anything important enough to be included in your program's 
> input or output is almost certainly important enough to be *data*, not 
> metadata. And the non-equality-checking semantics of metadata are confusing.
>
> About the only place I've found metadata to be worthwhile is 
> meta-programming namespaces and Vars, e.g. what clojure.test does.
>
> My personal rule of thumb is: if you strip all the metadata from your 
> program it should still work, thought maybe less efficiently.
>
> –S
>
>
> On Thursday, January 29, 2015 at 10:10:34 AM UTC-5, Jonathon McKitrick 
> wrote:
>>
>> Is there a rule of thumb or set of use cases when metadata is a more 
>> elegant solution than simply adding more entries to a map or record?
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When to use metadata

2015-01-30 Thread Stuart Sierra
Almost never.

Seriously, anything important enough to be included in your program's input 
or output is almost certainly important enough to be *data*, not metadata. 
And the non-equality-checking semantics of metadata are confusing.

About the only place I've found metadata to be worthwhile is 
meta-programming namespaces and Vars, e.g. what clojure.test does.

My personal rule of thumb is: if you strip all the metadata from your 
program it should still work, thought maybe less efficiently.

–S


On Thursday, January 29, 2015 at 10:10:34 AM UTC-5, Jonathon McKitrick 
wrote:
>
> Is there a rule of thumb or set of use cases when metadata is a more 
> elegant solution than simply adding more entries to a map or record?
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-30 Thread Marshall Bockrath-Vandegrift
Not a solution to your immediate problem, but if this is for 
new development (not an existing mass of clojure-hadoop code), I'd suggest 
looking at Parkour instead.  As the main Parkour developer I'm obviously 
biased, but Parkour exists in part because the compilation model used by 
clojure-hadoop in order to meet Hadoop's expectations is very much at odds 
with typical Clojure development. In particular, Parkour does not require 
AOT compilation.

https://github.com/damballa/parkour

On Thursday, January 29, 2015 at 2:39:54 AM UTC-5, Jason Wolfe wrote:
>
> First off, I apologize in advance for not having a reduced test case, and 
> express my sincere gratitude in advance for any assistance.  I've been 
> tearing my hair out for a day or so and not making headway, and figured 
> someone here might recognize some keywords and have a pointer in the right 
> direction. (I'm admittedly pretty green when it comes to class loading, and 
> have largely exhausted my google fu).  
>
> *Problem: *
>
> I'm submitting a hadoop job using clojure-hadoop.  All is well with a 
> simple job, but once I require something that transitively depends on 
> Schema, I end up with: 
>
> clojure.lang.Compiler$CompilerException: 
> java.lang.IllegalArgumentException: No implementation of method: :walker of 
> protocol: #'schema.core/Schema found for class: clojure.core$long, 
> compiling:(crane/config.clj:33:4)
>
> It works fine when run in-process with hadoop-mapreduce-client-jobclient, 
> but not with bin/hadoop -jar.  This stunk of a classloader issue, and after 
> digging in it seems that there are multiple versions of clojure.core$long 
> floating around.  The version on which the protocol is extended is not the 
> same class for the fn that the symbol 'long resolves to in client code.
>
> *Context: *
>
> clojure-hadoop is AOT-compiled, and after being loaded by hadoop it 
> dynamically loads the target namespace (not AOT-compiled, nor any other of 
> the code in question) using 
> https://github.com/alexott/clojure-hadoop/blob/master/src/clojure_hadoop/load.clj#L3
>
> From here, schema is transitively required, and then client namespaces 
> attempt to use the Schema protocol to generate validators, and when the 
> schema 'long is used (which resolves to the fn with class 
> clojure.core$long), it fails to find the appropriate method.  
>
> After repeated head-bashing, I've determined that there are (at least two) 
> versions of the clojure.core$long class floating around -- the one used to 
> extend the protocol, which stems from a DynamicClassLoader, and the one 
> that 'long resolves to in client code, which stems from a URLClassLoader. 
>  The URLClassLoader is the loader of the current thread and Compiler, but 
> not @(clojure.lang.Compiler/LOADER).
>
> *Attempts:*
>
> I've tried wrapping the clojure-hadoop loading code with 
> .setContextClassLoader on some obvious candidates and binding 
> *use-context-classloader* around the code doing the loading, with no avail. 
>  I've tried changing the schema code to reference the class in different 
> ways (class (resolve 'long)), (class 'long), etc and that hasn't made a 
> difference.  I've checked and the clojure-hadoop jar doesn't contain any 
> .class files for clojure, schema, or other offending code.  
>
> *Plea:*
>
> I suspect there's something obvious I'm missing.  (In retrospect it seems 
> like the design of Schema may be suboptimal in light of this, but if 
> possible I'd like to figure out a workaround without changing that 
> substantially). Thanks in advance for your help -- any and all pointers are 
> welcome.  
>
> -Jason
>
>
>
>  
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: lein discovery issues

2015-01-30 Thread andrea crotti
Noone on the topic?

Any smarter ways to lookup and try out new stuff with lein otherwise?

2015-01-26 14:22 GMT+00:00 andrea crotti :
> Hello everyone
>
> A couple of questions about Lein and how to find templates/libraries.
>
> I found out now that "lein search" allows me to search for the last
> stable version of a library, however every time I run it it takes
> forever downloading the index:
>
> Downloading 
> https://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
>
> Is that normal and if yes how can I make it usable?
>
> Then if I want to find out the correct version of clojurescript I go to 
> Clojars:
> https://clojars.org/search?q=clojurescript
>
> And there I find a lot of things but  none of them seems the correct
> thing, this is probably not the right thing:
> https://clojars.org/clojurescript
>
> I also noticed that many things in clojars don't have code available or
> links to the project, how am I supposed to know what they are actually
> useful for if there is no Readme/Source code or any other information?
>
> And the last thing is that it would be interesting to see all the
> possible project templates that can be used with a "lein new", but from
> what I can understand it depends on the plugins that are currently
> installed with lein, is that correct?
>
> Thanks a lot,
> Andrea

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heaps in clojure vs SML

2015-01-30 Thread Maris

yes,  it helped :-)

type hints make non-trivial difference   

thank you

On Friday, 30 January 2015 12:43:40 UTC, Nicola Mometto wrote:
>
>
> If you set! *warn-on-reflection* to true, you'd see a lot of reflection 
> warnings from your code. 
>
> Type-hinting the code like this: http://sprunge.us/ATiV makes your 
> example execute in 120ms on my machine. 
>
> Maris writes: 
>
> > I implemented leftist heap (from Purely Functional Data Structures book) 
> >  in clojure. 
> > 
> > https://gist.github.com/maruks/135fef92455578b61de2 
> > 
> > It takes 32 seconds to insert 10 elements in heap: 
> > 
> > (time  (peek   (reduce conj (empty-heap)  (range 1000 2000 100) 
> > ))) 
> > "Elapsed time: 32649.71438 msecs" 
> > 1000 
> > 
> > Why is it so much slower than SML NJ?  Something wrong with my code? 
> > 
> > 
> > Here is SML version: 
> > https://gist.github.com/maruks/c863eac9cf057a071307 
> > 
> > And function that inserts 10 elements in *54* milliseconds ! 
> > 
> > fun test(n:int) : int  = 
> > let 
> > val r = List.tabulate(n, fn x => 1000 + 100 * x) 
> > val h = foldl ( fn (e, h) => IntHeap.insert(e , h) )  IntHeap.empty  r 
> > in 
> > IntHeap.findMin(h) 
> > end 
>
> -- 
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: heaps in clojure vs SML

2015-01-30 Thread Nicola Mometto

If you set! *warn-on-reflection* to true, you'd see a lot of reflection
warnings from your code.

Type-hinting the code like this: http://sprunge.us/ATiV makes your
example execute in 120ms on my machine.

Maris writes:

> I implemented leftist heap (from Purely Functional Data Structures book)
>  in clojure.
>
> https://gist.github.com/maruks/135fef92455578b61de2
>
> It takes 32 seconds to insert 10 elements in heap:
>
> (time  (peek   (reduce conj (empty-heap)  (range 1000 2000 100)
> )))
> "Elapsed time: 32649.71438 msecs"
> 1000
>
> Why is it so much slower than SML NJ?  Something wrong with my code?
>
>
> Here is SML version:
> https://gist.github.com/maruks/c863eac9cf057a071307
>
> And function that inserts 10 elements in *54* milliseconds !
>
> fun test(n:int) : int  =
> let
> val r = List.tabulate(n, fn x => 1000 + 100 * x)
> val h = foldl ( fn (e, h) => IntHeap.insert(e , h) )  IntHeap.empty  r
> in
> IntHeap.findMin(h)
> end

--

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


heaps in clojure vs SML

2015-01-30 Thread Maris

I implemented leftist heap (from Purely Functional Data Structures book) 
 in clojure. 

https://gist.github.com/maruks/135fef92455578b61de2

It takes 32 seconds to insert 10 elements in heap:

(time  (peek   (reduce conj (empty-heap)  (range 1000 2000 100)   
)))
"Elapsed time: 32649.71438 msecs"
1000

Why is it so much slower than SML NJ?  Something wrong with my code?


Here is SML version:
https://gist.github.com/maruks/c863eac9cf057a071307

And function that inserts 10 elements in *54* milliseconds !

fun test(n:int) : int  =
let
val r = List.tabulate(n, fn x => 1000 + 100 * x)
val h = foldl ( fn (e, h) => IntHeap.insert(e , h) )  IntHeap.empty  r 
in
IntHeap.findMin(h)
end



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multi purpose webframework deciding between serverside generated templates and cljs SPA approach

2015-01-30 Thread Torsten Uhlmann
I'm currently wrapping my head around single page apps with authentication
/ authorization,

so I would be interested in seeing a spa approach.

Thanks for publishing, whatever way you choose.

2015-01-30 11:11 GMT+01:00 Sven Richter :

> Hi,
>
> I am working on taking luminus and chestnut templates some steps further
> by additionally providing authentication and user management + some crud
> generation for entities plus whatever comes to my mind.
>
> Now, I am a bit undecided, I am working on a view that lists available
> users plus some editing. The original plan was to do it with server side
> templating and form submissions, however, as I also plan provide some
> headstart with reagent I could do the same in an SPA approach with ajax
> requests to the server.
> Of course, what fits better is almost always a question of the specific
> project, but I would be interested what the general feeling for this is in
> the clojure community.
>
> What would other people prefer? What would make sense? Anything one would
> have to think of that I may have forgot?
>
> Btw. who wants to follow, this is the github page:
> https://github.com/sveri/closp
>
> Thanks,
> Sven
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone: +49 3721 273445
Fax: +49 3721 273446
Mobile: +49 151 12412427
Web:http://www.agynamix.de
Author of "Lift Web Applications How-To
"

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multi purpose webframework deciding between serverside generated templates and cljs SPA approach

2015-01-30 Thread Sven Richter
Hi,

I am working on taking luminus and chestnut templates some steps further by 
additionally providing authentication and user management + some crud 
generation for entities plus whatever comes to my mind.

Now, I am a bit undecided, I am working on a view that lists available 
users plus some editing. The original plan was to do it with server side 
templating and form submissions, however, as I also plan provide some 
headstart with reagent I could do the same in an SPA approach with ajax 
requests to the server.
Of course, what fits better is almost always a question of the specific 
project, but I would be interested what the general feeling for this is in 
the clojure community.

What would other people prefer? What would make sense? Anything one would 
have to think of that I may have forgot?

Btw. who wants to follow, this is the github page: 
https://github.com/sveri/closp

Thanks,
Sven

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clojurescript :advanced compilation extern only partly working.

2015-01-30 Thread Thomas Heller
For the missing data.json, you probably need to run "./script/bootstrap".

I tend to just run "lein install" but the version which gets installed is 
[org.clojure/clojurescript "0.0-SNAPSHOT"] so you have to adjust the 
version in your project as well. Or edit the clojurescript/project.clj to 
set a specific version.

Alternatively you can run "./script/build" which generates a proper version 
off the number of git commits but that script touches some files so extra 
take must be taken those changes don't end up in any git commit later.


On Friday, January 30, 2015 at 2:16:42 AM UTC+1, Crispin Wellington wrote:
>
> I got to the bottom of it. It's almost embarrassing to say. But the path 
> to the w3c_audio.js extern file was wrong. Unfortunately, lein doesn't give 
> any sort of warning or error if any of the externs files don't exist. I'm 
> not sure if it's a cljsbuild issue, or a clojurescript issue, or a google 
> closure compiler issue.
>
> So I am thinking I'll give adding this warning (or error?) to 
> clojurescript a go. I notice in clojurescript source that closure.clj deals 
> with running the closure compiler. I can see exactly where I want to add 
> the warning (or tweak the calling of google closure compiler). I could do 
> this, but I'm having trouble now running a locally built clojurescript. 
>
> I've checked it out. Added some debug. Then I build a jar with 'lein jar'. 
> I upload it to a local maven repository. I add that repository to my 
> project-with-the-missing-extern's project.clj. I lein deps. It grabs the 
> new jar. I lein cljsbuild, and the build begins, but then the build 
> explodes with:
>
> Exception in thread "main" java.io.FileNotFoundException: Could not locate 
> clojure/data/json__init.class or clojure/data/json.clj on classpath: , 
> compiling:(cljs/source_map.clj:1:1)
> ...
> Caused by: java.io.FileNotFoundException: Could not locate 
> clojure/data/json__init.class or clojure/data/json.clj on classpath: 
>
> So this is now off the original topic, but how do you work on 
> clojurescript itself? What step am I missing thats leading to the missing 
> clojre/data/json.clj class on the classpath? What's the best workflow for 
> hacking clojurescript itself?
>
> Regards
>
> Crispin
>
> On Wednesday, January 28, 2015 at 11:29:25 PM UTC+8, David Nolen wrote:
>>
>> Run a `lein deps :tree` to compare the version of the Google Closure 
>> Compiler you are getting.
>>
>> David
>>
>> On Wed, Jan 28, 2015 at 9:58 AM, Crispin Wellington > > wrote:
>>
>>> OK something very strange is going on. I tried the let block, and it was 
>>> the same in my project. 
>>>
>>> So I created a new minimal project, lein new mies test-sound, and made a 
>>> minimal test: https://github.com/retrogradeorbit/test-sound
>>>
>>> And here it works!
>>>
>>> Go back to my old project, and it doesn't.
>>>
>>> So now I have to go and gradually work through the project differences 
>>> to see what's causing this. If I find anything, I'll post it.
>>>
>>> Thanks for your help
>>>
>>> Crispin
>>>
>>> On Wednesday, January 28, 2015 at 10:06:52 PM UTC+8, David Nolen wrote:

 I mentioned trying this in a `let` binding instead. What happens when 
 you try that?

 David

 On Wed, Jan 28, 2015 at 9:04 AM, Crispin Wellington <
 retrogr...@gmail.com> wrote:

> No, that's not it. So I tried:
>
> (def audio-context (js/AudioContext.))
> (.decodeAudioData audio-context (js/ArrayBuffer. 256) #(println "ok" 
> %) #(println "error" %))
>
> and it compiled to:
>
> ;var zv = new AudioContext;
> zv.Rd(new ArrayBuffer(256), function(a) {
>   return fo.c(mh(["ok", a], 0));
> }, function(a) {
>   return fo.c(mh(["error", a], 0));
> });
>
> This has really got me stumped.
>
> Crispin
>
>
> On Wednesday, January 28, 2015 at 6:23:29 PM UTC+8, Thomas Heller 
> wrote:
>>
>> I just have a guess for you.
>>
>> AudioContext.decodeAudioData parameters are declared as ArrayBuffer, 
>> Function, Function but you are passing "data" which is a String not an 
>> ArrayBuffer. Maybe the type inference thinks you are calling a method 
>> that 
>> is not defined in the externs?
>>
>> Maybe it will work if you pass an ArrayBuffer? Other than that I see 
>> no reason why it would munge the name.
>>
>> /thomas
>>
>> On Wednesday, January 28, 2015 at 2:14:31 AM UTC+1, Crispin 
>> Wellington wrote:
>>>
>>> Hi there,
>>>
>>> I have been trying to compile some audio code in clojurescript in 
>>> advanced mode. I have setup the w3c_audio.js extern (from: 
>>> http://closureplease.com/externs/) into my extern list. When I 
>>> compile, it prevents the munging of "AudioContext" (without the extern, 
>>> this is being munged, so the extern is 'working'). But it doesn't 
>>> prevent 
>>> the munging of methods on AudioContext object. 
>

Re: datomic <-> datascript transfers

2015-01-30 Thread henry w
hi  Leon, thanks for your response. yes its true it wont suit all 
situations. 

in this case the user is changing their own data. and i think it will be 
nice to allow for of undo/redo locally then single 'done with changes' 
transaction back to datomic. 

On Thursday, January 29, 2015 at 10:10:28 PM UTC, Leon Grapenthin wrote:
>
> I have considered the approach once and dropped it quickly. 
>
> The key problem is the loss of atomicity. It introduces a second 
> transactor (the Datascript transactor) and thus synchronization 
> requirements that can rarely be fulfilled. One example where they would be 
> fulfilled automatically is where the browser is the only instance with 
> write access to the selected information. But in reality, this is almost 
> never the case. Then, if you don't fulfill the synchronization 
> requirements, your local DataScript database is an unreliable information 
> source.
>
> Instead, you can change step 2 with "Transactions into Datomic" (via HTTP 
> request to your app) and stream the relevant Datoms from d/tx-listen via 
> SSD back into the Datascript DB. So you only do transactions into the 
> Datascript DB indirectly. 
>
> Best regards,
>  Leon.
>
>
> On Thursday, January 29, 2015 at 3:24:57 PM UTC+1, henry w wrote:
>>
>> I am knocking out a webapp, backed by datomic on the server side and 
>> planning to use datascript in the client.
>>
>> the plan is to:
>>
>> 1) export a bunch of related data to the client (datomic 
>> query/pull/entity apis to create edn data suitable for transact into 
>> datascript)
>>-- could be a one-time thing or seed data with more getting pulled 
>> later.
>> 2) let the user change it about (transactions into datascript)
>> 3) save all user changes back to datomic (could send complete list of 
>> transactions made on client back to server, but ideally one tx representing 
>> sum of all changes)
>>
>> One issue to deal with is identity. For example upserts and retractions 
>> (on both client and server) need to happen to the right entities.
>>
>> I have some plans for how it will all work, but before going into details 
>> I am just curious if anyone else has considered this general approach?
>>
>> Thanks,
>> Henry
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.