Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Konrad Hinsen
Zach Tellman writes: > I see.  This is honestly something I hadn't considered, but since > Riddley actually uses the Clojure compiler internals to track > locals, this would be as simple as a (when-not (contains? > (riddley.compiler/locals) (first expr)) ...) guard in the > macroexpansion. I

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Zach Tellman
I'm not sure what you mean by "complete recursive expansion". Could you expand on that? As for replicating the behavior of the compiler, I'd assert that unless &env is precisely what it would be without ahead of time macroexpansion, the compiler's behavior isn't being replicated. The tools.macro

[ANN] "Type Coverage" - core.typed 0.2.3, lein-typed 0.3.0

2013-09-04 Thread Ambrose Bonnaire-Sergeant
Hi, core.typed 0.2.3 is up, and comes with two new functions: - statistics - var-coverage *statistics* returns a map o

Re: Design Composition and Performance

2013-09-04 Thread Sam Aaron
On 3 Sep 2013, at 18:39, Stan Dyck wrote: > (Not giving up on emacs-live tho. Can we wire on a theremin somehow in the > next release?) I already have prototypes of wiring in MIDI controllers directly to values in arbitrary Emacs buffers. It wouldn't be hard to switch to using a Leap Motion

Re: hashing binary data

2013-09-04 Thread Brian Craft
On Tuesday, September 3, 2013 10:03:00 PM UTC-7, Mikera wrote: > > > > On Wednesday, 4 September 2013 12:37:33 UTC+8, Brian Craft wrote: >> >> >> >> On Tuesday, September 3, 2013 9:14:30 PM UTC-7, Mikera wrote: >>> >>> On Wednesday, 4 September 2013 10:00:42 UTC+8, Brian Craft wrote: >>> I'm

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Konrad Hinsen
On Wed, Sep 4, 2013, at 09:25 AM, Zach Tellman wrote: I'm not sure what you mean by "complete recursive expansion". Could you expand on that? Completely ;-) By complete recursive expansion I mean that you get a form that is fully reduced to the core language, i.e. it contains no m

Re: Clojure for the Brave and True, an online book for beginners

2013-09-04 Thread Daniel Higginbotham
On Wednesday, September 4, 2013 12:17:12 AM UTC-4, Jason Lewis wrote: > +1 for outsourcing editor infos. Is this on Github? I might be inclined to > open a pull request for Vim or LightTable. > On Sep 3, 2013 8:42 PM, "Greg" > > wrote: > >> I think it could benefit from more posts on using Cloju

Re: core.async and referential transparency

2013-09-04 Thread bertschi
Hi Sean, thanks for the link, but I did look at Elm before and read the papers a couple month ago ... as far as I remember the implementation somewhat follows FrTime/Flapjax, but with an additional async expression, which does not prevent glitches. Best, Nils On Tuesday, September 3, 2

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-04 Thread Jeremy Wright
I decided to start with the BeagleBone Black as the embedded controller, partly because of the low cost ($45) and partly because I have one on hand. So, the first thing I need to do is make sure that I can get the I2C interface to work from Clojure. Gregg Harrington's post might work as a start

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-04 Thread Jeremy Wright
That's a great idea, thanks Omer. I'm still learning Clojure and haven't touched ClojureScript yet, but it doesn't sound like it's an overly difficult transition. Another plus on the ClojureScript side (long term) might be execution speed. I recently watched a Clojure Conj 2012 presentation by

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-04 Thread Omer Iqbal
Another possible approach could be use clojurescript to a nodejs target. >From some cursory googling, there do seem to be node modules like https://github.com/kelly/node-i2c which offer I2C support. And I believe you might also get a better startup time. On Wed, Sep 4, 2013 at 8:35 PM, Jeremy Wri

Re: [ANN] "Type Coverage" - core.typed 0.2.3, lein-typed 0.3.0

2013-09-04 Thread Brandon Bloom
> lein-typed 0.3.0 is also released, and supports a new coverage command. Awesome! > This is all part of Brandon Bloom's ideal vision of how types should be used in Clojure. Thanks for the great

Screencast: understanding the thread-first and thread-last macros

2013-09-04 Thread Jernau
Hi everyone, I made a screencast about Clojure's *thead-first* (->) and *thread-last* (->>) macros: http://www.youtube.com/watch?v=qxE5wDbt964 If you already have a good understanding of these macros then I'd recommend skipping it, but hopefully newcomers to Clojure might learn something usef

Re: Screencast: understanding the thread-first and thread-last macros

2013-09-04 Thread Giacomo Cosenza
Very clear and easy to follow explanation of Clojure thread macros. Highly recommended for Clojure beginners and intermediates. We should do a lot more screencasts like this. Unfortunately my spoken english is too affected by italian accent :( Highly recommended both for clojure beginners and in

Re: Clojure for the Brave and True, an online book for beginners

2013-09-04 Thread Dima Sabanin
Hi Daniel, Keep up the great work! I really enjoyed the material and how it's presented. Thanks, Dima On Mon, Sep 2, 2013 at 11:35 AM, Daniel Higginbotham wrote: > Hi all, > > I've been putting together http://www.braveclojure.com/ and would love > feedback. I've tried to make it entertaining

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Zach Tellman
So "complete recursive expansion" is postwalk macroexpansion? It seems like that could break anaphoric macros, and likely others. A macro has the option of calling macroexpand-all on its own contents if it wants only special forms, but it shouldn't be forced to take only special forms. Also, her

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Zach Tellman
Actually, postwalk expansion (if that is in fact what you were describing) would ignore any binding forms created by the outer macro. This means that something simple like: (defmacro with-db [db & body] `(with-open [~db (create-db)] ~@body)) would be expanded without any knowledge of the

Clojure JIRA votes

2013-09-04 Thread Alex Miller
A comment from Andy F on another thread prompted me to write this. There has been a lot going on in jira land lately and I promise that I will soon write lots more about it. In the process of getting things moving a bit I've been trying to f

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Ben Wolfson
Postwalk expansion would break macros that inspect their argument forms for e.g. writing special-purpose queries, if they *also* adopt the symbols "and" and "or" for conjunction or disjunction. Korma's "where", for instance, does this; one can write (select my-table (where (and (...) (... And

Catching Exceptions from Threads in REPL

2013-09-04 Thread JvJ
I'm working on a multithreaded program, and debugging in the repl is very hard. Every time an exception occurs, the thread either shuts down or deals with it in some other way. Is there a way I can get the REPL to intercept the exception and display it? -- -- You received this message beca

Re: hashing binary data

2013-09-04 Thread Brian Craft
On Wednesday, September 4, 2013 2:13:12 AM UTC-7, Brian Craft wrote: > > > > On Tuesday, September 3, 2013 10:03:00 PM UTC-7, Mikera wrote: >> >> >> >> On Wednesday, 4 September 2013 12:37:33 UTC+8, Brian Craft wrote: >>> >>> >>> >>> On Tuesday, September 3, 2013 9:14:30 PM UTC-7, Mikera wrote: >

Re: Catching Exceptions from Threads in REPL

2013-09-04 Thread Neale Swinnerton
Have you experimented with setting a default uncaught exception handler? See http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler) *Neale Swinnerton* {t: @sw1nn , w: sw1nn.com }

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Konrad Hinsen
--On 4 septembre 2013 09:27:12 -0700 Zach Tellman wrote: So "complete recursive expansion" is postwalk macroexpansion?  It seems like that could break anaphoric macros, and likely others.  A macro has the option of calling macroexpand-all on its own contents if it wants only special forms, but

Re: Clojure for the Brave and True, an online book for beginners

2013-09-04 Thread Gary Johnson
Looks pretty solid. Great work so far. Also +1 for the Emacs coverage. Despite the fact that our surveys still show the majority of Clojure users develop in Emacs, this mailing list frequently exhibits an anything-but-Emacs tone. By all means add links to other editors for folks who are already

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-04 Thread redc...@gmail.com
I also have a vertigo inducing slide deck to go with the robot lightening talk (which I didn't end up using) http://thelibraryofcongress.s3.amazonaws.com/conj2012-robot/index.html On Sunday, September 1, 2013 8:21:46 PM UTC-7, Jeremy Wright wrote: > > Here are some updates on my own research. >

Building with Java 7 but running on Java 6?

2013-09-04 Thread Tom Emerson
Greetings, I develop with JDK 7 but have coworkers who (for reasons I don't want to get into) run Java 6, and they cannot run the uberjars I create because of the version mismatch. Is it possible for Clojure/Leiningen to generate compatible class files? Or do I need to setup a VM that has Java

Re: Building with Java 7 but running on Java 6?

2013-09-04 Thread r0man
Hi Tom, add this to your project.clj :javac-options ["-target" "1.6" "-source" "1.6"] I have the same problem with our Hadoop cluster ;) On Wednesday, September 4, 2013 9:45:11 PM UTC+2, Tom Emerson wrote: > > Greetings, > > I develop with JDK 7 but have coworkers who (for reasons I don't want

Re: Screencast: understanding the thread-first and thread-last macros

2013-09-04 Thread Jernau
> Very clear and easy to follow explanation of Clojure thread macros. Thanks Mimmo, it's nice to hear that my approach was easy to follow. > Unfortunately my spoken english is too affected by italian accent :( As long as you can make yourself understood, I don't see why an accent should stop you

Re: hashing binary data

2013-09-04 Thread Brian Craft
On Wednesday, September 4, 2013 1:53:17 PM UTC-7, Karsten Schmidt wrote: > > On 4 September 2013 17:52, Brian Craft > > wrote: > > > This gives me a number of reflection warnings, on field ba, on equals, > and > > on hashCode. I can eliminate the one on hashCode by type hinting the ba > > pa

Re: Building with Java 7 but running on Java 6?

2013-09-04 Thread Tom Emerson
This is brilliant, many thanks! On Wednesday, September 4, 2013 3:52:20 PM UTC-4, r0man wrote: > > Hi Tom, > > add this to your project.clj > > :javac-options ["-target" "1.6" "-source" "1.6"] > > I have the same problem with our Hadoop cluster ;) > > On Wednesday, September 4, 2013 9:45:11 PM UTC

Re: hashing binary data

2013-09-04 Thread Karsten Schmidt
On 4 September 2013 17:52, Brian Craft wrote: > This gives me a number of reflection warnings, on field ba, on equals, and > on hashCode. I can eliminate the one on hashCode by type hinting the ba > parameter of BAHashable. > > The one on (.ba g) and equals remains. Is there any way to hint these

Improving a nested if, or How to use multimethods the right way.

2013-09-04 Thread Bruno Kim Medeiros Cesar
I'm writing (another) basic graph library, and would like to treat inputs depending on the type of the graph. A graph can be - Directed, in which case edges are vectors. Otherwise, edges are sets; - Looped, allowing edges from a node to itself; - Pseudo (or multi), allowing multiples edge

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Zach Tellman
I guess I'm confused, then. You contrast "complete recursive expansion" with what the compiler does, and then say it's recursive prewalk expansion, which is exactly what the compiler does. Can you clarify the difference between what you're doing and what the compiler does? On Wed, Sep 4, 2013 a

Re: Clojure On Java Friendly Microcontrollers, Beaglebone, etc

2013-09-04 Thread Jeremy Wright
Thanks for the slide deck Kevin. I'm not sure I've found all the slides yet, but it's great information. Do you have any links or information on Clojure robotics work you've done since the 2012 Conj? Any thoughts on using the GPIO pins through the file system versus using I2C (or maybe SPI)? On

Re: Improving a nested if, or How to use multimethods the right way.

2013-09-04 Thread Leonardo Borges
You could use pattern matching with core.match On 05/09/2013 6:57 AM, "Bruno Kim Medeiros Cesar" wrote: > I'm writing (another) basic graph library, and would like to treat inputs > depending on the type of the graph. A graph can be > >- Directed, in which case edges are vectors. Otherwise, e

Re: Clojure for the Brave and True, an online book for beginners

2013-09-04 Thread Daniel Higginbotham
Thanks for the feedback, Dima and Gary! It's very encouraging. With the C-s/C-r keybindings, I think the emacs.d I point has swapped isearch and regexp search. I'll double-check that. Thanks, Daniel On Wednesday, September 4, 2013 2:58:54 PM UTC-4, Gary Johnson wrote: > > Looks pretty solid. Gr

Why is clojure so powerful?

2013-09-04 Thread Tomislav Tomšić
I suspect, there are numerous possible ways to answer that question. One can ignore it, others would care to offer superficial, "no it isn't", but I guess, few would answer, it is because clojure is the member of the Lisp family of programming languages. Which immediately invites predictable

Re: Why is clojure so powerful?

2013-09-04 Thread Devin Walters
Battle-tested libraries are nice, and Java has a lot of them. Clojure programmers can use all of them with relative ease. I recently tried Erlang/Elixir and was disappointed in the library ecosystem. Another answer to why Clojure is powerful is the company it keeps. The people who work on Cloju

Re: Screencast: understanding the thread-first and thread-last macros

2013-09-04 Thread Curtis Gagliardi
This is a pretty good demo of light table as well for people who haven't really been keeping up with it lately. On Wednesday, September 4, 2013 8:42:06 AM UTC-7, Jernau wrote: > > Hi everyone, > > I made a screencast about Clojure's *thead-first* (->) and *thread-last* > (->>) > macros: > > ht

Handling name collisions with clojure.core

2013-09-04 Thread Mikera
Hi all, While building the API for core.matrix, I've fun into a few cases where the "best" name is a direct clash with clojure.core. Examples are "+", "zero?", "vector?", "==" In many of these cases, the core.matrix behaviour is a natural extension of the clojure.core function (i.e. it extends

Re: Handling name collisions with clojure.core

2013-09-04 Thread Zach Tellman
It is probably instructive to look at how (use-primitive-operators) works in primitive-math [1], though maybe not something you want to emulate. The basic mechanism is pretty simple: use 'ns-unmap' to get rid of the operators you want to shadow, and bring in the operators from the alternate na

Re: Handling name collisions with clojure.core

2013-09-04 Thread Mikera
Hmmm clever trick. I hadn't thought about hijacking "ns" :-) Still, it's a colossal hack. Monkey patching always makes me feel uneasy. Perhaps Clojure itself needs patching to make this use case a bit more palatable? Some obvious options: - Turn off all warnings for symbol replacement by default

Why does this overflow? (a try at the sieve of Eratosthenes)

2013-09-04 Thread John Gabriele
I tried implementing the sieve of Eratosthenes in Clojure. The approach is to loop while (A) keeping my current list of numbers which have not yet been eliminated, and (B) keeping track of the number I'm "on" (checking for multiples thereof). Here's what I came up with (in a foo.clj file): ~~~

I am trying to use lein uberjar to package as jar file that can be executed. but it's not working for another library is not contained.

2013-09-04 Thread Rooney
The another library is just jar file what used to use at java. the following is my project file. the red part is problem that is not contained from jar file when i use lein uberjar command. (defproject make-sentence "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://examp

Re: Handling name collisions with clojure.core

2013-09-04 Thread Sean Corfield
You only get the warning if you 'use' the namespace or 'refer all' tho', correct? And we've recently seen a lot of discussion that basically says "don't do that" so it seems that either users of core.matric are going to have two "approved" choices: * require core.matrix with an alias, or choose to

Re: Handling name collisions with clojure.core

2013-09-04 Thread Dave Ray
Maybe this is a dumb idea, but could you have a macro that rewrites code to use your ops? (require '[clojure.core.matrix :as m]) (m/with-ops (+ ... (* ...) ...)) and then all the "special" symbols get rewritten/qualified with clojure.core.matrix? Dave On Wed, Sep 4, 2013 at 10:26 PM, Sean

Re: I am trying to use lein uberjar to package as jar file that can be executed. but it's not working for another library is not contained.

2013-09-04 Thread Alan Busby
This isn't the solution you were looking for, but it should work; 1. Add simmetrics to your local maven repo; $ mvn install:install-file -Dfile=*simmetrics_jar_v1_6_2_d07_02_07.jar* -DgroupId=simmetrics -DartifactId=simmetrics -Dversion=1.6.2 -Dpackaging=jar -DgeneratePom=true 2. Refer to it in :

let bindings in tree-seq funciton

2013-09-04 Thread Kuba Roth
I'm currently working with tree-seq function from clojure.core and there is one thing I'm struggling to understand... Could you please explain why pretty much all of the body of the function sits within 'let binding' and not in the 'let body' where only (walk root) is placed? Has it something to

Re: Handling name collisions with clojure.core

2013-09-04 Thread Alan Busby
On Thu, Sep 5, 2013 at 2:35 PM, Dave Ray wrote: > could you have a macro that rewrites code to use your ops? > > (require '[clojure.core.matrix :as m]) > (m/with-ops (+ ... (* ...) ...)) I wonder if there is value in a more general (with-ns clojure.core.matrix (foo (bar ...))) macro? I can

Re: Handling name collisions with clojure.core

2013-09-04 Thread Mikera
On Thursday, 5 September 2013 13:26:28 UTC+8, Sean Corfield wrote: > You only get the warning if you 'use' the namespace or 'refer all' > tho', correct? > > And we've recently seen a lot of discussion that basically says "don't > do that" so it seems that either users of core.matric are going t