Re: [ANN] electron-app 1.0.0

2021-11-01 Thread Johannes
Hi,
today I followed the usage instructions. Trying to run a development build 
with clojure -A:dev I get the windows "myapp" and "myapp Tests" but both 
are empty.
The repl is started and (conns) delivers

Will Eval On: Judson
Session Name Age URL
Judson 0m /figwheel-connect
nil

Are there any hints, what I should do. I am working on macOs.

Johannes 

Paul Butcher schrieb am Montag, 2. Dezember 2019 um 22:46:45 UTC+1:

> I’ve just published a clj template for for an Electron application 
> built with deps.edn, Figwheel Main, Reagent, and test integration via 
> cljs-test-display:
>
> https://github.com/paulbutcher/electron-app
>
> --
> paul.butcher->msgCount++
>
> Silverstone, Brands Hatch, Donington Park...
> Who says I have a one track mind?
>
> http://www.paulbutcher.com/
> LinkedIn: http://www.linkedin.com/in/paulbutcher
> Skype: paulrabutcher
>
> Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
> http://pragprog.com/book/pb7con
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/9b35e9ae-8388-4956-b16a-1d12dca1dcd2n%40googlegroups.com.


Re: Conceptual difference between map and class

2020-04-01 Thread Johannes
A few years ago I built some kind of internal DSL using Clojure macros 
which allowed to create objects and classes like in conventional OOP 
languages as Smalltalk and Java.

The macro obj creates a classless, immutable object, for example:
(obj {:x 1, :y 2} {:f (fn [] (+ (self :x) (self :y)))})
obj expects to maps as arguments, one for the instance variables (:x and 
:y) and one for the methods (:f). The variable self is provided by obj
 automatically.
The methods can be activated using a message passing style:
((obj {:x 1, :y 2} {:f (fn [] (+ (self :x) (self :y)))}) :f) ;=>3
Classes can be created through an explicit abstraction step by sending the 
message :kappa to an object:
((obj {:x 1, :y 2} {:f (fn [] (+ (self :x) (self :y)))}) :kappa 'C) ;=> 
#'dosl2clj.core/C
Classes understand the message :new  for creating new instances:
((C :new) :data) ;=> {:x 1, :y 2}
All objects understand the message :data. Class hierarchies are possible, 
too.

I built the DSL, because I wanted to figure out, wether it could make 
porting an application from Smalltalk to Clojure less difficult. I tried 
two simple applications.
My conclusion is: Yes, the porting is possible, of course, and quite 
simple. But it is in no way simpler than using the native Clojure language 
features. Using normal hash-maps and functions isn't more difficult. 
Building a DSL for objects isn't worth the effort.

Johannes

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/51957f2f-ecf3-4bf0-b1de-de1968baac11%40googlegroups.com.


Re: Why ('f 1) does deliver nil?

2019-10-26 Thread Johannes
Thank you for the explanation; until now I associated this behavior only to 
keywords not not symbols.

Johannes

Am Samstag, 26. Oktober 2019 19:12:11 UTC+2 schrieb Andy Fingerhut:
>
> Both symbols and keywords, when placed inside of an expression in the 
> first position, e.g. (:my-keyword my-map), or ('some-symbol my-map), behave 
> as functions that "look themselves up" in the map that is the first 
> argument, and if that symbol or keyword is a key in that map, the 
> associated value is returned from the expression.  This is most often used 
> for keywords, but it does also work for symbols, which is what is happening 
> in your expression.  The number `1` is not a map, and both this kind of 
> lookup expression, as well as the function `get`, have always returned nil 
> when the thing-to-be-looked-up-in is not a map or set (or anything else 
> that implements the appropriate lookup interface methods being used in the 
> Java implementation under the covers there).
>
> Some other examples of similar behavior:
>
> $ clj
> Clojure 1.10.1
> user=> ('f 1)
> nil
> user=> ('f 1 :not-found)
> :not-found
> user=> ('f {'f 17 :bar 8})
> 17
> user=> ('f {:bar 8} :not-found-value)
> :not-found-value
> user=> (get {'f 17 :bar 8} 'f)
> 17
> user=> (get 1 'f)
> nil
> user=> (get 1 'f :not-found)
> :not-found
>
> Andy
>
>
>
> On Sat, Oct 26, 2019 at 10:05 AM Johannes  > wrote:
>
>> ... instead of an exception?
>>
>> Can anyone explain it to me?
>>
>> Johannes
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clo...@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 clo...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/clojure/f2007954-107c-4918-bf0a-6bfd8040ba39%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/clojure/f2007954-107c-4918-bf0a-6bfd8040ba39%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/8d0613d6-a084-4035-9208-226ed8a911d9%40googlegroups.com.


Why ('f 1) does deliver nil?

2019-10-26 Thread Johannes
... instead of an exception?

Can anyone explain it to me?

Johannes

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/f2007954-107c-4918-bf0a-6bfd8040ba39%40googlegroups.com.


Why ('f 1) does deliver nil?

2019-10-26 Thread Johannes
... instead of an exception?

Can anyone explain it to me?

Johannes

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/e572919f-3a44-4f1b-8120-06ccc98c2be0%40googlegroups.com.


Re: questionable result of Clojure code execution in org babel

2019-09-08 Thread Johannes


Am Mittwoch, 4. September 2019 13:19:30 UTC+2 schrieb Johannes:
>
> Until today there is no response to my post on org mode list.
>
> In the meantime I've upgraded Aquamacs to the lastest stable version (3.5) 
> and upgraded all my packages (esp. Org mode version 9.2.6).
> If I now try to execute the the following code section in an org-mode file 
> with C-c C-c
>
> #+BEGIN_SRC clojure :results value
> (* 3 5)
> #+END_SRC
>
> I get the error message:
> executing Clojure code block...
> nrepl-send-sync-request: Wrong type argument: stringp, nil
>
> There is a running cider-real.
>
I fear I was wrong. The connection to the cider-repl wasn't okay.

Now I get the same (wrong) answer as before:
 
#+BEGIN_SRC clojure :results value
(* 3 5)
#+END_SRC

#+RESULTS:
: nil15

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/22e5d761-32e6-473d-9dcd-d38a3738c2c8%40googlegroups.com.


Re: questionable result of Clojure code execution in org babel

2019-09-04 Thread Johannes
Until today there is no response to my post on org mode list.

In the meantime I've upgraded Aquamacs to the lastest stable version (3.5) 
and upgraded all my packages (esp. Org mode version 9.2.6).
If I now try to execute the the following code section in an org-mode file 
with C-c C-c

#+BEGIN_SRC clojure :results value
(* 3 5)
#+END_SRC

I get the error message:
executing Clojure code block...
nrepl-send-sync-request: Wrong type argument: stringp, nil

There is a running cider-real.

The former behavior wasn't nice but better than this.

Any ideas what to do?
Johannes

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/d068cb3a-f8ac-4b03-a00c-1c6113e4f470%40googlegroups.com.


Re: questionable result of Clojure code execution in org babel

2019-08-09 Thread Johannes


Am Freitag, 9. August 2019 08:36:32 UTC+2 schrieb numb...@gmail.com:
>
> Actually I commited that patch, I intened to fix a problem in ob-clojure 
> which also is a feature for ob-clojure allow user can specify `:ns` header 
> argument. I noticed this result problem. I tried to dig in. But have no 
> lucky. Maybe someone in Org Mode mailing list can help.
>
I posted the problem there. 

>
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
>
> On Wed, Aug 7, 2019 at 8:37 PM Peter Hull  > wrote:
>
>> On Wednesday, 7 August 2019 12:42:07 UTC+1, Peter Hull wrote:
>>
>>
>> The connection returns two values, first 'nil' then '24', and function 
>> nrepl--merge concats these into the incorrect response that org-mode pastes 
>> into your doc.
>>
>> Wait, might be on to something here. In org-mode 9.1.9 the sent message 
>> looks like:
>> (-->
>>  id "8"
>>  op "eval"
>>  session "a34917da-541a-4d4a-b790-af8e11020c96"
>>  time-stamp "2019-08-07 13:18:00.307045105"
>>  code "(* 1 2 3 4)"
>>  ns "org-babel-clojure.core"
>> )
>>
>>
>> in 9.2.5 it's
>> (-->
>>  id "18"
>>  op "eval"
>>  session "86281560-e467-47c4-869d-043b03f5c546"
>>  time-stamp "2019-08-07 12:23:33.769213028"
>>  code "(ns org-babel-clojure.core)
>> (* 1 2 3 4)"
>> )
>>
>>
>>
>> In the latter we're sending two forms (ns ...) and (* ...) so we get two 
>> responses. Previously it sent only one and used the ns key in the 
>> message to set the message.
>>
>> This relates to this change last year: 
>> https://github.com/bzg/org-mode/commit/d7e12d1df7091563c5f0fe0bd8b2db634d3e87ba
>>
>> So, I think you should bug the ob-clojure people at org-mode about this!
>>
>> Hope that helps,
>> Pete
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clo...@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 clo...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/clojure/ac4eeb01-f29b-4f6c-bf0b-86029202dae9%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/51a6b674-9e42-413c-9300-689d733e0e3e%40googlegroups.com.


Re: questionable result of Clojure code execution in org babel

2019-08-08 Thread Johannes
Thank you, Pete, for your investigation. 

Am Mittwoch, 7. August 2019 14:37:06 UTC+2 schrieb Peter Hull:
>
> On Wednesday, 7 August 2019 12:42:07 UTC+1, Peter Hull wrote:
>
>
> The connection returns two values, first 'nil' then '24', and function 
> nrepl--merge concats these into the incorrect response that org-mode pastes 
> into your doc.
>
> Wait, might be on to something here. In org-mode 9.1.9 the sent message 
> looks like:
> (-->
>  id "8"
>  op "eval"
>  session "a34917da-541a-4d4a-b790-af8e11020c96"
>  time-stamp "2019-08-07 13:18:00.307045105"
>  code "(* 1 2 3 4)"
>  ns "org-babel-clojure.core"
> )
>
>
> in 9.2.5 it's
> (-->
>  id "18"
>  op "eval"
>  session "86281560-e467-47c4-869d-043b03f5c546"
>  time-stamp "2019-08-07 12:23:33.769213028"
>  code "(ns org-babel-clojure.core)
> (* 1 2 3 4)"
> )
>
>
>
> In the latter we're sending two forms (ns ...) and (* ...) so we get two 
> responses. Previously it sent only one and used the ns key in the message 
> to set the message.
>
> This relates to this change last year: 
> https://github.com/bzg/org-mode/commit/d7e12d1df7091563c5f0fe0bd8b2db634d3e87ba
>
> So, I think you should bug the ob-clojure people at org-mode about this!
>
> Hope that helps,
> Pete
>
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/56aab6cb-73ea-4f45-b283-5d4dcba047d7%40googlegroups.com.


Re: questionable result of Clojure code execution in org babel

2019-08-06 Thread Johannes
My versions:

;; org-mode 9.2.5
;; Aquamacs 3.5  GNU Emacs 25.3.50.1
;; CIDER 0.21.0 (New York), nREPL 0.6.0
;; Clojure 1.9.0, Java 11

Is there a better place to post the problem?

Johannes

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/c7efd7c9-feab-40a0-8451-bf935944995d%40googlegroups.com.


questionable result of Clojure code execution in org babel

2019-08-05 Thread Johannes
Hi

executing the the following code section in an org-mode file with C-c C-c

#+BEGIN_SRC clojure :results value
(* 3 5)
#+END_SRC

I get 

 #+RESULTS:
 : nil15

instead of

 #+RESULTS:
 : 15

Trying the same with emacs-lisp instead of clojure the correct result 
appears.

What is going wrong?

Johannes 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/382035ed-167f-4dcb-a8af-ade2ca2c0037%40googlegroups.com.


Re: command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes
Now, I've found the source of the problem. I'd got an "old" alias named clojure 
in my .profile. Now all works fine.

Johannes

Am Donnerstag, 19. Juli 2018 16:28:04 UTC+2 schrieb Johannes:
>
> I suppose I have installed the command line tools on my Mac with
>
> brew install clojure
>
> as described in the Getting Started Guide.
>
> If I try clj I get
>
> Clojure 1.9.0
>
> user=> 
> fine!
>
> If I try clojure I get
>
> Fehler: Hauptklasse clojure.main konnte nicht gefunden oder geladen werden
>
> Ursache: java.lang.ClassNotFoundException: clojure.main
>
> Any hints, what is going wrong?
>
> Johannes
>

-- 
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: command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes


Am Donnerstag, 19. Juli 2018 16:41:24 UTC+2 schrieb Alex Miller:
>
> It might be good to check that `clojure` actually points to what you think 
> it points to. Check `which clj` and `which clojure` to make sure they are 
> coming out of the same directory.
>
I think they do:

JohMBAir:~ johannes$ which clj

/usr/local/bin/clj

JohMBAir:~ johannes$ which clojure

/usr/local/bin/clojure

JohMBAir:~ johannes$ 
 

>
> On Thursday, July 19, 2018 at 9:28:04 AM UTC-5, Johannes wrote:
>>
>> I suppose I have installed the command line tools on my Mac with
>>
>> brew install clojure
>>
>> as described in the Getting Started Guide.
>>
>> If I try clj I get
>>
>> Clojure 1.9.0
>>
>> user=> 
>> fine!
>>
>> If I try clojure I get
>>
>> Fehler: Hauptklasse clojure.main konnte nicht gefunden oder geladen werden
>>
>> Ursache: java.lang.ClassNotFoundException: clojure.main
>>
>> Any hints, what is going wrong?
>>
>> Johannes
>>
>

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


command line tool clojure raises java.lang.ClassNotFoundException: clojure.main

2018-07-19 Thread Johannes
I suppose I have installed the command line tools on my Mac with

brew install clojure

as described in the Getting Started Guide.

If I try clj I get

Clojure 1.9.0

user=> 
fine!

If I try clojure I get

Fehler: Hauptklasse clojure.main konnte nicht gefunden oder geladen werden

Ursache: java.lang.ClassNotFoundException: clojure.main

Any hints, what is going wrong?

Johannes

-- 
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: downloading of files from Dropbox using cli-http

2018-06-26 Thread Johannes
Yes, there was an authorisation problem, I have to include :with-credentials? 
false. Additionally the "Content-Type" has to be specified in the headers. 
The following call works now:
(go (let [response (https://content.dropboxapi.com/2/files/download";
  {:with-credentials? false
   :headers {"authorization" "Bearer 
QfCC..."
 "Dropbox-API-Arg" 
"{\"path\":\"/log.txt\"}"
 "Content-Type" "text/plain; 
charset=utf-8"}     
   }))] 
  (println response)))

Thanks for your help!

Johannes

Am Dienstag, 26. Juni 2018 12:51:14 UTC+2 schrieb Immo Heikkinen:
>
> Have you checked JS console in your browser, does is show any errors?
>
> Br,
> Immo
>
> ti 26. kesäk. 2018 klo 13.36 Johannes  > kirjoitti:
>
>> Thanks Immo, what a silly mistake!
>>
>> But after having corrected it, I get the same result as before:
>>
>> (go (let [response (> https://content.dropboxapi.com/2/files/download";
>>   {:headers {"authorization" "Bearer 
>> QfCCK..."
>>  "Dropbox-API-Arg" 
>> "{\"path\":\"/log.txt\"}"} 
>>}))] 
>>   (println response)))
>>
>> ==>
>>
>> #object[*cljs.core.async.impl.channels.ManyToManyChannel*]
>>
>> {:status 0, :success false, :body , :headers {}, :trace-redirects [
>> https://content.dropboxapi.com/2/files/download 
>> https://content.dropboxapi.com/2/files/download], :error-code 
>> :http-error, :error-text  [0]}
>>
>> Am Dienstag, 26. Juni 2018 11:54:22 UTC+2 schrieb Immo Heikkinen:
>>
>>> You have slash instead of dot after "content" in the url: "
>>> https://content/dropboxapi.com/2/files/download";
>>>
>>> Br,
>>> Immo
>>>
>>>
>>>
>>> ti 26. kesäk. 2018 klo 10.38 Thomas  kirjoitti:
>>>
>> I have no idea what could be wrong here... sorry.
>>>>
>>>> Thomas
>>>>
>>>> On Monday, 25 June 2018 14:38:12 UTC+2, Johannes wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to download a file from Dropbox which I can get with the 
>>>>> Http request:
>>>>>
>>>>> POST /2/files/download Host: https://content.dropboxapi.com User-Agent: 
>>>>> api-explorer-client Authorization: Bearer QfCCK... Dropbox-API-Arg: 
>>>>> {"path":"/log.txt"}
>>>>>
>>>>> or the curl request looks like that:
>>>>>
>>>>> curl -X POST https://content.dropboxapi.com/2/files/download \ --header 
>>>>> 'Authorization: Bearer QfCCK...' \ --header 'Dropbox-API-Arg: 
>>>>> {"path":"/log.txt"}'
>>>>>
>>>>> If I try the following using cli-http in a Clojurescript repl:
>>>>>
>>>>> (go (let [response (>>>> https://content/dropboxapi.com/2/files/download"; {:headers 
>>>>> {"authorization" "Bearer QfCCK..." "Dropbox-API-Arg" 
>>>>> "{\"path\":\"/log.txt\"}"} }))] (println response)))
>>>>>
>>>>> I get
>>>>>
>>>>> #object[*cljs.core.async.impl.channels.ManyToManyChannel*]
>>>>>
>>>>> {:status 0, :success false, :body , :headers {}, :trace-redirects [
>>>>> https://content/dropboxapi.com/2/files/download 
>>>>> https://content/dropboxapi.com/2/files/download], :error-code 
>>>>> :http-error, :error-text  [0]}
>>>>>
>>>>>
>>>>> I cannot figure out where my mistake is. Any help?
>>>>>
>>>>>
>>>>> Johannes
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Clojure" group.
>>>>
>>> To post to this group, send email to clo...@googlegroups.com
>>>
>>>
>>>> Note that posts from new members are moderated - please be patient with 
>>>> your first post.
>>>> To unsubscribe from this group, send email to
>>>>
>>

Re: downloading of files from Dropbox using cli-http

2018-06-26 Thread Johannes
Thanks Immo, what a silly mistake!

But after having corrected it, I get the same result as before:

(go (let [response (https://content.dropboxapi.com/2/files/download";
  {:headers {"authorization" "Bearer 
QfCCK..."
 "Dropbox-API-Arg" 
"{\"path\":\"/log.txt\"}"} 
   }))] 
  (println response)))

==>

#object[*cljs.core.async.impl.channels.ManyToManyChannel*]

{:status 0, :success false, :body , :headers {}, :trace-redirects 
[https://content.dropboxapi.com/2/files/download 
https://content.dropboxapi.com/2/files/download], :error-code :http-error, 
:error-text  [0]}

Am Dienstag, 26. Juni 2018 11:54:22 UTC+2 schrieb Immo Heikkinen:
>
> You have slash instead of dot after "content" in the url: "
> https://content/dropboxapi.com/2/files/download";
>
> Br,
> Immo
>
>
>
> ti 26. kesäk. 2018 klo 10.38 Thomas > 
> kirjoitti:
>
>> I have no idea what could be wrong here... sorry.
>>
>> Thomas
>>
>> On Monday, 25 June 2018 14:38:12 UTC+2, Johannes wrote:
>>
>>> Hi,
>>>
>>> I am trying to download a file from Dropbox which I can get with the 
>>> Http request:
>>>
>>> POST /2/files/download Host: https://content.dropboxapi.com User-Agent: 
>>> api-explorer-client Authorization: Bearer QfCCK... Dropbox-API-Arg: 
>>> {"path":"/log.txt"}
>>>
>>> or the curl request looks like that:
>>>
>>> curl -X POST https://content.dropboxapi.com/2/files/download \ --header 
>>> 'Authorization: 
>>> Bearer QfCCK...' \ --header 'Dropbox-API-Arg: {"path":"/log.txt"}'
>>>
>>> If I try the following using cli-http in a Clojurescript repl:
>>>
>>> (go (let [response (>> https://content/dropboxapi.com/2/files/download"; {:headers 
>>> {"authorization" "Bearer QfCCK..." "Dropbox-API-Arg" 
>>> "{\"path\":\"/log.txt\"}"} }))] (println response)))
>>>
>>> I get
>>>
>>> #object[*cljs.core.async.impl.channels.ManyToManyChannel*]
>>>
>>> {:status 0, :success false, :body , :headers {}, :trace-redirects [
>>> https://content/dropboxapi.com/2/files/download 
>>> https://content/dropboxapi.com/2/files/download], :error-code 
>>> :http-error, :error-text  [0]}
>>>
>>>
>>> I cannot figure out where my mistake is. Any help?
>>>
>>>
>>> Johannes
>>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=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+u...@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: downloading of files from Dropbox using cli-http

2018-06-25 Thread Johannes


That's the result:



curl -vX POST https://content.dropboxapi.com/2/files/download   --header 
'Authorization: Bearer QfCCK...'   --header 'Dropbox-API-Arg: 
{"path":"/log.txt"}'>x.txt 

  % Total% Received % Xferd  Average Speed   TimeTime Time  
Current

 Dload  Upload   Total   SpentLeft  
Speed

  0 00 00 0  0  0 --:--:-- --:--:-- --:--:--   
  0*   Trying 2620:100:6022:8::a27d:4208...

* TCP_NODELAY set

* Connected to content.dropboxapi.com (2620:100:6022:8::a27d:4208) port 443 
(#0)

* ALPN, offering h2

* ALPN, offering http/1.1

* Cipher selection: 
ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

* successfully set certificate verify locations:

*   CAfile: /etc/ssl/cert.pem

  CApath: none

* TLSv1.2 (OUT), TLS handshake, Client hello (1):

} [512 bytes data]

* TLSv1.2 (IN), TLS handshake, Server hello (2):

{ [106 bytes data]

* TLSv1.2 (IN), TLS handshake, Certificate (11):

{ [3302 bytes data]

* TLSv1.2 (IN), TLS handshake, Server key exchange (12):

{ [333 bytes data]

* TLSv1.2 (IN), TLS handshake, Server finished (14):

{ [4 bytes data]

* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

} [70 bytes data]

* TLSv1.2 (OUT), TLS change cipher, Client hello (1):

} [1 bytes data]

* TLSv1.2 (OUT), TLS handshake, Finished (20):

} [16 bytes data]

* TLSv1.2 (IN), TLS change cipher, Client hello (1):

{ [1 bytes data]

* TLSv1.2 (IN), TLS handshake, Finished (20):

{ [16 bytes data]

* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384

* ALPN, server accepted to use http/1.1

* Server certificate:

*  subject: C=US; ST=California; L=San Francisco; O=Dropbox, Inc; 
OU=Dropbox Ops; CN=content.dropboxapi.com

*  start date: Feb  7 00:00:00 2017 GMT

*  expire date: Feb 12 12:00:00 2020 GMT

*  subjectAltName: host "content.dropboxapi.com" matched cert's 
"content.dropboxapi.com"

*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High 
Assurance Server CA

*  SSL certificate verify ok.

> POST /2/files/download HTTP/1.1

> Host: content.dropboxapi.com

> User-Agent: curl/7.54.0

> Accept: */*

> Authorization: Bearer QfCCK...

> Dropbox-API-Arg: {"path":"/log.txt"}

> 

  0 00 00 0  0  0 --:--:--  0:00:01 --:--:--   
  0< HTTP/1.1 200 OK

< Server: nginx

< Date: Mon, 25 Jun 2018 15:29:43 GMT

< Content-Type: application/octet-stream

< Content-Length: 199945

< Connection: keep-alive

< accept-ranges: bytes

< etag: W/"2a575a545945"

< pragma: no-cache

< cache-control: no-cache

< original-content-length: 199945

< dropbox-api-result: {"name": "log.txt", "path_lower": "/log.txt", 
"path_display": "/log.txt", "id": "id:hNm0VDys4tAADA", 
"client_modified": "2018-06-24T21:53:42Z", "server_modified": 
"2018-06-24T21:53:43Z", "rev": "2a575a545945", "size": 199945, 
"content_hash": 
"4366a79928e7a4e7db9da0c7b05c4c76fa016c0f5886fa106b47fd2e7a960db9"}

< X-Server-Response-Time: 765

< X-Dropbox-Request-Id: 3301820ab86536937d476e8ea895ff22

< X-Robots-Tag: noindex, nofollow, noimageindex

< 

{ [15632 bytes data]

100  195k  100  195k0 0   156k  0  0:00:01  0:00:01 --:--:--  
156k

* Connection #0 to host content.dropboxapi.com left intact


The has been downloaded successfully.



Am Montag, 25. Juni 2018 17:09:58 UTC+2 schrieb Thomas:
>
> try and do a curl -v and see what it really does under the covers as there 
> might be a redirect
>
> Good luck,
> Thomas
>
> On Monday, 25 June 2018 14:38:12 UTC+2, Johannes wrote:
>>
>> Hi,
>>
>> I am trying to download a file from Dropbox which I can get with the Http 
>> request:
>>
>> POST /2/files/download Host: https://content.dropboxapi.com User-Agent: 
>> api-explorer-client Authorization: Bearer QfCCK... Dropbox-API-Arg: 
>> {"path":"/log.txt"}
>>
>> or the curl request looks like that:
>>
>> curl -X POST https://content.dropboxapi.com/2/files/download \ --header 
>> 'Authorization: 
>> Bearer QfCCK...' \ --header 'Dropbox-API-Arg: {"path":"/log.txt"}'
>>
>> If I try the following using cli-http in a Clojurescript repl:
>>
>> (go (let [response (> https://content/dropboxapi.com/2/files/download"; {:headers 
>> {"authorization" "Bearer QfCCK..." "Dropbox-API-Arg" 
>> "{\"path\":\"/log.txt\"}"} }))] (println response)))
>>
>> I get
>>
>> #object[*cljs.

downloading of files from Dropbox using cli-http

2018-06-25 Thread Johannes
Hi,

I am trying to download a file from Dropbox which I can get with the Http 
request:

POST /2/files/download Host: https://content.dropboxapi.com User-Agent: 
api-explorer-client Authorization: Bearer QfCCK... Dropbox-API-Arg: 
{"path":"/log.txt"}

or the curl request looks like that:

curl -X POST https://content.dropboxapi.com/2/files/download \ --header 
'Authorization: 
Bearer QfCCK...' \ --header 'Dropbox-API-Arg: {"path":"/log.txt"}'

If I try the following using cli-http in a Clojurescript repl:

(go (let [response (https://content/dropboxapi.com/2/files/download"; {:headers 
{"authorization" "Bearer QfCCK..." "Dropbox-API-Arg" 
"{\"path\":\"/log.txt\"}"} }))] (println response)))

I get

#object[*cljs.core.async.impl.channels.ManyToManyChannel*]

{:status 0, :success false, :body , :headers {}, :trace-redirects 
[https://content/dropboxapi.com/2/files/download 
https://content/dropboxapi.com/2/files/download], :error-code :http-error, 
:error-text  [0]}


I cannot figure out where my mistake is. Any help?


Johannes

-- 
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: Application silently shuts down by itself after running for some hours

2017-03-07 Thread Johannes Ahvenniemi
I'm under the impression that setDefaultExceptionHandler still catches OOM 
errors. Some googling suggests this too. If not, how should I try to catch it?

I am running the app on a virtual server with 512mb ram. free -m is showing 
30mb free. Lack of memory can be the issue. What would be the best way to 
confirm this if I'm not able to log the error?

Sent from my iPhone

> On 7 Mar 2017, at 23.25, piastkra...@gmail.com wrote:
> 
> I asked the same question a year ago. The problem was that I was getting an 
> OutOfMemoryError. This is an Error but it is not an Exception. If you catch 
> all Exceptions, you will still not catch the OutOfMemoryError. You have to 
> catch that too. 
> 
> 
> 
>> On Tuesday, March 7, 2017 at 2:54:26 PM UTC-5, Kevin Corcoran wrote:
>>> On Mon, Mar 6, 2017 at 11:56 PM, JokkeB  wrote:
>>> After adding this, I still can't see an exception before the app dies.
>> 
>> I've encountered this before when the Linux "OOM killer" kicks in, which is 
>> especially likely if you are running your application on a 
>> resource-constrained system (say, a VM with a low RAM allocation) or your 
>> application is competing with other programs for memory.
> 
> -- 
> 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 a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/zhdcNMC7fQ8/unsubscribe.
> To unsubscribe from this group and all its topics, 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: results of expression evaluation using clojure in org mode in Emacs with CIDER

2016-12-19 Thread Johannes


Am Montag, 19. Dezember 2016 15:55:25 UTC+1 schrieb ae...@posteo.de:
>
> 2016-12-19 02:23 -0800, Johannes >: 
>
> > Hi, 
> > 
> > without problems I can do something like that: 
> > 
> > #+begin_src clojure :results value 
> >   (get [ 1 2 3 4] 3) 
> > #+end_src 
> > 
> > 
> > #+RESULTS: 
> > : 4 
> > 
> > But evaluating 
> > 
> > #+begin_src clojure :results value 
> >   [ 1 2 3 4] 
> > #+end_src 
> > 
> > I get 
> > #+RESULTS: 
> > | 1 | 2 | 3 | 4 | 
> > instead of 
> > [1 2 3 4] 
> > 
> > My org-mode version: Org-mode version 8.3.6 (8.3.6-7-g4d7d52-elpa @ 
> > /Users/johannes/Library/Preferences/Aquamacs 
> > Emacs/Packages/elpa/org-20161010/) 
> > 
> > Any hints? 
>
> It's an org-mode related question, and here is a hint 
>
>
> https://emacs.stackexchange.com/questions/7291/disable-tabular-output-for-code-block-in-org-mode
>  
>
> tanks, I will follow the hint 

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


results of expression evaluation using clojure in org mode in Emacs with CIDER

2016-12-19 Thread Johannes
Hi,

without problems I can do something like that:

#+begin_src clojure :results value
  (get [ 1 2 3 4] 3)
#+end_src

#+RESULTS:
: 4

But evaluating 
#+begin_src clojure :results value
  [ 1 2 3 4]
#+end_src
I get
#+RESULTS:
| 1 | 2 | 3 | 4 |
instead of 
[1 2 3 4]

My org-mode version: Org-mode version 8.3.6 (8.3.6-7-g4d7d52-elpa @ 
/Users/johannes/Library/Preferences/Aquamacs 
Emacs/Packages/elpa/org-20161010/)

Any hints?

Johannes

-- 
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: strange (for me) problem with "No matching ctor found for class ..."

2016-05-08 Thread Johannes
Hi Jason,

thank for your hints, perhaps I can use your workaround.

Johannes

Am Sonntag, 8. Mai 2016 03:43:22 UTC+2 schrieb Jason Wolfe:
>
> Hi Johannes, 
>
> I've run into this before.  Here is a ticket [1] and some context and a 
> potential workaround [2]:
>
> [1] http://dev.clojure.org/jira/browse/CLJ-1206
> [2] https://groups.google.com/d/msg/clojure/BZwinR2zNgU/8HGOgzOxzosJ
>
> -Jason
>
>
>
> On Thursday, May 5, 2016 at 1:32:21 AM UTC+7, Johannes wrote:
>>
>> Hi!
>>
>> I have a function f- defined using a local function f which uses a local 
>> var v:
>> user> (def f- (let [v 1
>>   f (fn [x] v)] f))
>> ;; => #'user/f-
>>
>> Putting f- in a map
>> user> {:d f-}
>> ;; => {:d #function[user/fn--13335/f--13336]}
>> all is as expected. But giving the map as argument to eval
>> user> (eval {:d f-})
>> this error message appear:
>> IllegalArgumentException No matching ctor found for class 
>> user$fn__13335$f__13336  clojure.lang.Reflector.invokeConstructor 
>> (Reflector.java:163)
>>
>> This problem doesn't arise if the local function f doesn't  use v:
>> user> (def f- (let [v 1
>>   f (fn [x] x)] f))
>> ;; => #'user/f-
>> user> (eval {:d f-})
>> ;; => {:d #function[user/fn--13345/f--13346]}
>>
>> Is there any explanation for this behavior?
>>
>> Johannes
>>
>

-- 
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: strange (for me) problem with "No matching ctor found for class ..."

2016-05-08 Thread Johannes
Hi Mike!

Am Samstag, 7. Mai 2016 19:00:11 UTC+2 schrieb Mike Rodriguez:
>
> ...
> I can see how the docs @ http://clojure.org/reference/evaluation could 
> mislead someone to thinking that it is perfectly fine and acceptable to 
> embed any objects into a call to `eval`, but I really don't think that is 
> what the docs are discussing in this case.  Calling `eval` is a way to dig 
> into the evaluator of Clojure to use it "ad hoc" yourself at a different 
> time than "normal".
>
indeed, the docs say that function objects should evaluate to themselves. 

>
> So at this point, you've circumvented Clojure's standard evaluation and 
> you are attempting to take matters into your own hand.  When you do that, 
> there starts to become a lot of subtle issue, like the one of whether or 
> not you can get away with embedding already evaluated objects into a new 
> evaluation.  Since, in your example, you functions are already evaluated to 
> their function objects, you are effectively "double evaluating" them.  When 
> you do that, expect issue.
>
> This is a subtle and confusing topic because there are indeed times when 
> you can get away with embedding objects into the code you are calling eval 
> on.  However, I'd argue that is not the normal case and you shouldn't rely 
> on that because it doesn't take much change to break it and no longer be 
> able to do it.  For example, functions that have closures, I believe, can 
> never successfully be embedded into a call to eval.
>
> The real point here is in understanding evaluation semantics.  The reader 
> reads characters/text into data structures.  However these data structure 
> are not unbounded.  They are the data structures that are used to describe 
> the syntax of the Clojure language, e.g. [], {}, (), :keywords, symbols, 
> "strings", 123, etc.
> If you try to print a function object, you'll see it has no clear 
> representation as a valid data structures in the Clojure syntax subset of 
> data structures.  
> It'll be something like: 
>
I think, I understand, but nevertheless I cannot understand why
{:f `(~(let [v (fn [] 1)
   f (fn [x] (v))] f))} 
evaluates as expected, but
(eval {:f `(~(let [v (fn [] 1)
   f (fn [x] (v))] f))})
does not. That looks like a bug, for me.

>
> This is your warning sign that it is going to be trouble to call eval on 
> it.  Eval is intended to evaluate _code_ represented as data.  This 
> function object is not in a form amendable for interpretation as code.
>
> If you do not try to control evaluation yourself, when evaluating 
> functions typically looks like this (fn [x] (inc x)).  That is not a 
> function object to the evaluator.  It is a list, with 3 elements.  The 
> first is a symbol, the next is a vector, the last is another list, and we 
> can describe its subforms similarly.
>
> Clojure does provide a facility to give a meaningful reader/data syntax 
> representation to arbitrary objects to allow evaluation later for things 
> like serialization.  This is via the 
> clojure.core/print-dup family of functionality.  Functions themselves in 
> Clojure do not out-of-the-box come with a useful implementation of 
> print-dup, but it is a multimethod and can be dynamically extended to new 
> types of data.
>
> I think you should try to solve your problem in a simpler way than going 
> to this level of depth and/or trying to call eval yourself on 
> already-pre-evaluated forms, but for the sake of learning, you may be 
> interested in seeing how to make a macro for creating functions that do 
> have a print-dup implementation that would allow them to be printed as 
> readable, then "evaluatable" code data structures later on.  
> https://github.com/sorenmacbeth/serializable-fn is an example of this.  I 
> have used it for inspiration before where I did want to be able to 
> serialize pre-eval'ed functions, but I had some tweaks to it of my own. 
>  The basic idea holds.  However, I only have needed to go to this level of 
> complexity when I was trying to serialize this data so that I could store 
> it away and use it in another separate process later, which I think is 
> where it can become useful.
>
I will take a look at your hint. 

>
>
> Hopefully you find this useful.
>
thank you, Mike

Johannes 

>
>
>>

-- 
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: strange (for me) problem with "No matching ctor found for class ..."

2016-05-04 Thread Johannes


Am Mittwoch, 4. Mai 2016 23:47:07 UTC+2 schrieb Ben Kovitz:
>
> On May 4, 2016, at 5:28 PM, Johannes > 
> wrote:
>
> Maybe you are right. But I've deliberately given function objects to eval 
> often without any problems until I used functions of some special kind. I 
> do not understand why the behavior for the 2 versions of the function f- 
> I've shown is different.
>
>
> Oops, I think I missed the main problem: you were passing a pre-evaluated 
> map object directly to eval. What eval really wants is the kind of thing 
> that the reader returns after it reads a string. The reader doesn’t 
> evaluate symbols, like f-. That’s eval’s job. When the reader sees the 
> string f-, it returns the symbol f-. You passed eval the actual function 
> object, not the symbol f-. Eval wants to see the symbol; it will replace 
> it with the object that it evaluates to.
>
> In other words, I think you just forgot to quote the expressions that you 
> were passing to eval. Adding the quote, here’s what I get:
>
> user=> (def f- (let [v 1
>   #_=>   f (fn [x] v)] f))
> #'user/f-
>
> user=> (eval '{:d f-})
> {:d #function[user/fn--10235/f--10236]}
>
> user=> (def f- (let [v 1
>   #_=>   f (fn [x] x)] f))
> #'user/f-
>
> user=> (eval '{:d f-})
> {:d #function[user/fn--10243/f--10244]}
>
> okay, but why does the following work without quotation?
user> (def f- (let [v 1
  f (fn [x] x)] f))
;; => #'user/f-
user> (eval {:d f-})
;; => {:d #function[user/fn--14679/f--14680]}
user>  

The problem is that the place in my program where I give the map containing 
the function object to eval, the map cannot be quoted.

Johannes

-- 
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: strange (for me) problem with "No matching ctor found for class ..."

2016-05-04 Thread Johannes


Am Mittwoch, 4. Mai 2016 21:24:08 UTC+2 schrieb Ben Kovitz:
>
> On May 4, 2016, at 2:32 PM, Johannes > 
> wrote: 
>
> > Is there any explanation for this behavior? 
>
> My understanding is that you can't eval function objects. Whatever you 
> give to eval needs to be code that you could enter into the REPL. You 
> couldn't type #function[user/fn--13335/f--13336] into the REPL and have it 
> evaluate to that function. More to the point, the reader doesn't handle the 
> function object represented by that string. For the same reason, you can't 
> put function objects directly into code generated by macros. 
>
> That said, I've inadvertently given a function object to eval a few times, 
> and *sometimes* it worked. I don't have an explanation for that. It 
> actually caused me some confusion, because, since it worked the first time 
> I tried it, I concluded with surprise and glee that you *can* eval function 
> objects. But it's not true, at least not reliably. If you want to 
> (reliably) make eval return something containing a function object, you 
> need to give eval an expression containing a symbol or expression that 
> evaluates to that function object—not the function object itself. 
>
> Maybe you are right. But I've deliberately given function objects to eval 
often without any problems until I used functions of some special kind. I 
do not understand why the behavior for the 2 versions of the function f- 
I've shown is different.

Johannes

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


strange (for me) problem with "No matching ctor found for class ..."

2016-05-04 Thread Johannes
Hi!

I have a function f- defined using a local function f which uses a local 
var v:
user> (def f- (let [v 1
  f (fn [x] v)] f))
;; => #'user/f-

Putting f- in a map
user> {:d f-}
;; => {:d #function[user/fn--13335/f--13336]}
all is as expected. But giving the map as argument to eval
user> (eval {:d f-})
this error message appear:
IllegalArgumentException No matching ctor found for class 
user$fn__13335$f__13336  clojure.lang.Reflector.invokeConstructor 
(Reflector.java:163)

This problem doesn't arise if the local function f doesn't  use v:
user> (def f- (let [v 1
  f (fn [x] x)] f))
;; => #'user/f-
user> (eval {:d f-})
;; => {:d #function[user/fn--13345/f--13346]}

Is there any explanation for this behavior?

Johannes

-- 
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: Symbol's function definition is void: cider-turn-on-eldoc-mode

2016-04-16 Thread Johannes
thanks for the hint!

Johannes

Am Samstag, 16. April 2016 20:31:17 UTC+2 schrieb Bozhidar Batsov:
>
> This was deprecated a while back (and deleted recently). Use `eldoc-mode` 
> instead in your hooks. 
>
> On 16 April 2016 at 08:55, Johannes > 
> wrote:
>
>> Hi every,
>>
>> I have upgrade the latest emacs-cider:
>> clojure-mode (version 5.3.0)
>> CIDER 0.12.0snapshot (package: 20160414.1712)
>>
>> But now when I try to start a nREPL server I get the following error 
>> messages:
>>
>> nREPL server started on 64355
>> [nREPL] Establishing direct connection to localhost:64355 ...
>> [nREPL] Direct connection established
>> error in process filter: run-hooks: Symbol's function definition is void: 
>> cider-turn-on-eldoc-mode
>> error in process filter: Symbol's function definition is void: 
>> cider-turn-on-eldoc-mode
>>
>> I never saw this message before. What ist going wrong?
>>
>> Johannes
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> 
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=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+u...@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.


Symbol's function definition is void: cider-turn-on-eldoc-mode

2016-04-16 Thread Johannes
Hi every,

I have upgrade the latest emacs-cider:
clojure-mode (version 5.3.0)
CIDER 0.12.0snapshot (package: 20160414.1712)

But now when I try to start a nREPL server I get the following error 
messages:

nREPL server started on 64355
[nREPL] Establishing direct connection to localhost:64355 ...
[nREPL] Direct connection established
error in process filter: run-hooks: Symbol's function definition is void: 
cider-turn-on-eldoc-mode
error in process filter: Symbol's function definition is void: 
cider-turn-on-eldoc-mode

I never saw this message before. What ist going wrong?

Johannes

-- 
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: Advice getting started with concurrency and parallelism in Clojure

2016-04-08 Thread Johannes Staffans
I found the introductory talk on Claypoole pretty informative with regards 
to parallelism in Clojure in general: 
https://www.youtube.com/watch?v=BzKjIk0vgzE

On Thursday, April 7, 2016 at 5:09:39 PM UTC+2, Mars0i wrote:
>
> Niels-- Ah, interesting.  My uses of pmap haven't been I/O bound.  I 
> didn't know about the claypoole library.  Will keep that in mind.
>
> On Thursday, April 7, 2016 at 8:00:39 AM UTC-5, Niels van Klaveren wrote:
>>
>> The biggest problem with pmap I have is ordering, ie. it will process in 
>> batches of (+ 2 (.. Runtime getRuntime availableProcessors)), and only 
>> take a new batch when the slowest of the old batch has been evaluated. With 
>> functions dependent on IO, parallel gains are only a fraction of what they 
>> could be. I used to solve this by creating my own code to process in 
>> futures and delays, but when I found the claypoole library, especially it's 
>> unordered pmap and for, I never had to touch these again.
>>
>> On Wednesday, April 6, 2016 at 3:11:52 PM UTC+2, Mars0i wrote:
>>>
>>> Maybe people forget about pmap 
>>> , pcalls 
>>> , and pvalues 
>>>  because they're just too 
>>> easy.
>>>
>>> On Tuesday, April 5, 2016 at 8:51:59 PM UTC-5, tbc++ wrote:

 If it all seems confusing, do not despair, there's two things that will 
 handle the vast majority of the use cases you may have: 

 1) `future` - spawns a thread that runs the body of the future (
 https://clojuredocs.org/clojure.core/future)
 2) `atom` and `swap!` - Used to store data that needs to be shared 
 between threads and updated concurrently (
 https://clojuredocs.org/clojure.core/atom) these are built on top of 
 CAS, which itself is foundation upon which most of concurrent programming 
 is built. (https://en.wikipedia.org/wiki/Compare-and-swap)

 Those two primitives alone will handle 90% of the use cases you will 
 run into as a new clojure developer. The rest of the stuff (agents, thread 
 pools, refs, vars, cps/core.async) can all come in time, but you will use 
 them much less often than threads and atoms. So read up on those two and 
 feel free to come back with any questions you may have. 

 Timothy


 On Tue, Apr 5, 2016 at 7:24 PM, Chris White  wrote:

> I was doing some reading of code recently to help me get up to speed 
> with Clojure. One of the libraries I randomly came across dealt with 
> parallelism and I had a hard time following along with it. To try and 
> wrap 
> my head around things I did a quick search and found this article:
>
>
> http://www.thattommyhall.com/2014/02/24/concurrency-and-parallelism-in-clojure/
>
> I'm not sure how authoritative this is based on my current experience, 
> but needless to say I was a bit overwhelmed. That said is there any sort 
> of 
> introductory material that list members have used to help get them into 
> how 
> Clojure deals with concurrency and parallelism? I also don't mind 
> anything 
> that's not specifically using Clojure but will at least help me 
> understand 
> the concepts behind how Clojure does it. Thanks again for any and all 
> help!
>
> - Chris White (@cwgem)
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient 
> with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=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+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



 -- 
 “One of the main causes of the fall of the Roman Empire was 
 that–lacking zero–they had no way to indicate successful termination of 
 their C programs.”
 (Robert Firth) 

>>>

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

Re: org-mode Clojure babel

2016-01-07 Thread Johannes Brauer
thanks a lot,Martin, upgrading leiningen from 2.5.1 to 2.5.3 solves the problem

Johannes
Am 07.01.2016 um 21:05 schrieb Martin Clausen 
mailto:martin.clau...@gmail.com>>:

Have you tried updating leiningen?

On Thu, Jan 7, 2016 at 9:02 PM Johannes Brauer 
mailto:bra...@nordakademie.de>> wrote:
now my profiles.clj looks like
{:repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
  [lein-pprint "1.1.2"]]
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}

 But repl complains:
; CIDER 0.11.0snapshot (package: 20160104.1114) (Java 1.8.0_25, Clojure 1.6.0, 
nREPL 0.2.6)
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: The following required nREPL ops are not supported:
  apropos classpath complete eldoc format-code format-edn info inspect-pop 
inspect-push inspect-refresh macroexpand ns-list ns-vars ns-path refresh 
resource stacktrace toggle-trace-var toggle-trace-ns undef
  Please, install (or update) cider-nrepl 0.11.0-SNAPSHOT and restart CIDER
user>

Is anything wrong with my profiles.clj?

Johannes
Am 07.01.2016 um 17:58 schrieb Johannes Brauer 
mailto:bra...@nordakademie.de>>:

okay, that I could have figured out myself, sorry. But now I get another 
exception:
error in process sentinel: Could not start nREPL server: 
java.lang.IllegalArgumentException: No value supplied for key: .
 at clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
leiningen.core.project$dependency_map.invoke (project.clj:77)
leiningen.core.project$dep_key.invoke (project.clj:228)
leiningen.core.project$reduce_dep_step.invoke (project.clj:232)
clojure.lang.ArrayChunk.reduce (ArrayChunk.java:58)
…
???
Johannes
Am 06.01.2016 um 23:22 schrieb Reid McKenzie 
mailto:rmckenzi...@gmail.com>>:

"0.11.0-SNAPSHOT". It's case sensitive.

Reid

On 01/06/2016 02:23 PM, Johannes Brauer wrote:
I tried this before. But with
{:repl {:plugins [[cider/cider-nrepl " 0.11.0-snapshot"]]}}
in my profiles.clj and cider-jack-in I get a Java exception:
Starting nREPL server via lein repl :headless...
error in process sentinel: Could not start nREPL server: 
java.lang.IllegalArgumentException: Bad artifact coordinates 
cider:cider-nrepl:jar: 0.11.0-snapshot, expected format is 
:[:[:]]:
 at org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:73)
org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:56)
cemerick.pomegranate.aether$artifact.invoke (aether.clj:222)
cemerick.pomegranate.aether$dependency.invoke (aether.clj:230)
cemerick.pomegranate.aether$resolve_dependencies_STAR_$fn__190.invoke 
(aether.clj:708)
…


Am 06.01.2016 um 13:11 schrieb Martin Clausen 
mailto:martin.clau...@gmail.com>>:

If you update to cider/cider-nrepl 0.11.0-snapshot in your .lein/profiles.clj 
that should fix the problem.

On Wed, Jan 6, 2016 at 1:02 PM Johannes 
mailto:bra...@nordakademie.de>> wrote:
BUT!!!

With cider-nrepl set to 0.10.0 and cider set to 0.11.0-snapshot emacs complains:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version 
(0.10.1). Things will break!

That's not an org-bable problem, but perhaps there is a tip what to do.

Johannes

Am Dienstag, 29. Dezember 2015 13:01:30 UTC+1 schrieb Johannes:
thanks for the hint; indeed it works
Am 21.12.2015 um 16:12 schrieb martin_clausen 
<<mailto:martin.clau...@gmail.com>martin.clau...@gmail.com<mailto:martin.clau...@gmail.com>>:

I found that

Org-mode version 8.3.2 and CIDER 0.11.0 snapshot (package: 20151212.1044)

works great and can be easily be installed from repos.

On Sunday, December 20, 2015 at 6:16:15 PM UTC+1, Johannes wrote:
Thanks, for the explanations. I hope for the best, that there will be an 
working org-babel version in the future. In the mean time I will continue using 
lentilc.

Johannes
Am 10.12.2015 um 16:24 schrieb Matching Socks 
http://gmail.com/>>:

The latest stable Org Babel stopped working with the introduction of Cider 
0.10.0.

You can either go back to Cider 0.9.1, or
(1) get Org 8.3.2,
(2) git-clone Org's repo, and
(3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest 
Cider.

The breakage was raised at <https://github.com/clojure-emacs/cider/issues/1302> 
https://github.com/clojure-emacs/cider/issues/1302 and closed with a comment, 
"I don't have nor the time nor the energy to sync up with everyone maintaining 
a 3rd party extension. I just hope they're following the development and will 
do the necessary changes when needed."

But three considerations, which are not Cider's fault, argue for a kinder 
accommodation.  First, Org freezes for bundling into a major Emacs release only 
a few times a century, and the resulting Emacs release then enjoys wide 
distr

Re: org-mode Clojure babel

2016-01-07 Thread Johannes Brauer
now my profiles.clj looks like
{:repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
  [lein-pprint "1.1.2"]]
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}

 But repl complains:
; CIDER 0.11.0snapshot (package: 20160104.1114) (Java 1.8.0_25, Clojure 1.6.0, 
nREPL 0.2.6)
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: The following required nREPL ops are not supported:
  apropos classpath complete eldoc format-code format-edn info inspect-pop 
inspect-push inspect-refresh macroexpand ns-list ns-vars ns-path refresh 
resource stacktrace toggle-trace-var toggle-trace-ns undef
  Please, install (or update) cider-nrepl 0.11.0-SNAPSHOT and restart CIDER
user>

Is anything wrong with my profiles.clj?

Johannes
Am 07.01.2016 um 17:58 schrieb Johannes Brauer 
mailto:bra...@nordakademie.de>>:

okay, that I could have figured out myself, sorry. But now I get another 
exception:
error in process sentinel: Could not start nREPL server: 
java.lang.IllegalArgumentException: No value supplied for key: .
 at clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77)
leiningen.core.project$dependency_map.invoke (project.clj:77)
leiningen.core.project$dep_key.invoke (project.clj:228)
leiningen.core.project$reduce_dep_step.invoke (project.clj:232)
clojure.lang.ArrayChunk.reduce (ArrayChunk.java:58)
…
???
Johannes
Am 06.01.2016 um 23:22 schrieb Reid McKenzie 
mailto:rmckenzi...@gmail.com>>:

"0.11.0-SNAPSHOT". It's case sensitive.

Reid

On 01/06/2016 02:23 PM, Johannes Brauer wrote:
I tried this before. But with
{:repl {:plugins [[cider/cider-nrepl " 0.11.0-snapshot"]]}}
in my profiles.clj and cider-jack-in I get a Java exception:
Starting nREPL server via lein repl :headless...
error in process sentinel: Could not start nREPL server: 
java.lang.IllegalArgumentException: Bad artifact coordinates 
cider:cider-nrepl:jar: 0.11.0-snapshot, expected format is 
:[:[:]]:
 at org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:73)
org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:56)
cemerick.pomegranate.aether$artifact.invoke (aether.clj:222)
cemerick.pomegranate.aether$dependency.invoke (aether.clj:230)
cemerick.pomegranate.aether$resolve_dependencies_STAR_$fn__190.invoke 
(aether.clj:708)
…


Am 06.01.2016 um 13:11 schrieb Martin Clausen 
mailto:martin.clau...@gmail.com>>:

If you update to cider/cider-nrepl 0.11.0-snapshot in your .lein/profiles.clj 
that should fix the problem.

On Wed, Jan 6, 2016 at 1:02 PM Johannes 
mailto:bra...@nordakademie.de>> wrote:
BUT!!!

With cider-nrepl set to 0.10.0 and cider set to 0.11.0-snapshot emacs complains:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version 
(0.10.1). Things will break!

That's not an org-bable problem, but perhaps there is a tip what to do.

Johannes

Am Dienstag, 29. Dezember 2015 13:01:30 UTC+1 schrieb Johannes:
thanks for the hint; indeed it works
Am 21.12.2015 um 16:12 schrieb martin_clausen 
<<mailto:martin.clau...@gmail.com>martin.clau...@gmail.com<mailto:martin.clau...@gmail.com>>:

I found that

Org-mode version 8.3.2 and CIDER 0.11.0 snapshot (package: 20151212.1044)

works great and can be easily be installed from repos.

On Sunday, December 20, 2015 at 6:16:15 PM UTC+1, Johannes wrote:
Thanks, for the explanations. I hope for the best, that there will be an 
working org-babel version in the future. In the mean time I will continue using 
lentilc.

Johannes
Am 10.12.2015 um 16:24 schrieb Matching Socks 
http://gmail.com/>>:

The latest stable Org Babel stopped working with the introduction of Cider 
0.10.0.

You can either go back to Cider 0.9.1, or
(1) get Org 8.3.2,
(2) git-clone Org's repo, and
(3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest 
Cider.

The breakage was raised at <https://github.com/clojure-emacs/cider/issues/1302> 
https://github.com/clojure-emacs/cider/issues/1302 and closed with a comment, 
"I don't have nor the time nor the energy to sync up with everyone maintaining 
a 3rd party extension. I just hope they're following the development and will 
do the necessary changes when needed."

But three considerations, which are not Cider's fault, argue for a kinder 
accommodation.  First, Org freezes for bundling into a major Emacs release only 
a few times a century, and the resulting Emacs release then enjoys wide 
distribution for many years.  Second, the bundled Org is unusually significant 
because overriding it with another version is not always fool-proof.  Third, 
Org with Clojure snippets is dynamite!  Therefore, I hope Org will get advice 
from Cider about a more durable technique, so the next Emacs+Org release might 
be

Re: org-mode Clojure babel

2016-01-06 Thread Johannes Brauer
I tried this before. But with
{:repl {:plugins [[cider/cider-nrepl " 0.11.0-snapshot"]]}}
in my profiles.clj and cider-jack-in I get a Java exception:
Starting nREPL server via lein repl :headless...
error in process sentinel: Could not start nREPL server: 
java.lang.IllegalArgumentException: Bad artifact coordinates 
cider:cider-nrepl:jar: 0.11.0-snapshot, expected format is 
:[:[:]]:
 at org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:73)
org.sonatype.aether.util.artifact.DefaultArtifact. 
(DefaultArtifact.java:56)
cemerick.pomegranate.aether$artifact.invoke (aether.clj:222)
cemerick.pomegranate.aether$dependency.invoke (aether.clj:230)
cemerick.pomegranate.aether$resolve_dependencies_STAR_$fn__190.invoke 
(aether.clj:708)
…


Am 06.01.2016 um 13:11 schrieb Martin Clausen 
mailto:martin.clau...@gmail.com>>:

If you update to cider/cider-nrepl 0.11.0-snapshot in your .lein/profiles.clj 
that should fix the problem.

On Wed, Jan 6, 2016 at 1:02 PM Johannes 
mailto:bra...@nordakademie.de>> wrote:
BUT!!!

With cider-nrepl set to 0.10.0 and cider set to 0.11.0-snapshot emacs complains:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version 
(0.10.1). Things will break!

That's not an org-bable problem, but perhaps there is a tip what to do.

Johannes

Am Dienstag, 29. Dezember 2015 13:01:30 UTC+1 schrieb Johannes:
thanks for the hint; indeed it works
Am 21.12.2015 um 16:12 schrieb martin_clausen 
mailto:martin.clau...@gmail.com>>:

I found that

Org-mode version 8.3.2 and CIDER 0.11.0 snapshot (package: 20151212.1044)

works great and can be easily be installed from repos.

On Sunday, December 20, 2015 at 6:16:15 PM UTC+1, Johannes wrote:
Thanks, for the explanations. I hope for the best, that there will be an 
working org-babel version in the future. In the mean time I will continue using 
lentilc.

Johannes
Am 10.12.2015 um 16:24 schrieb Matching Socks 
http://gmail.com/>>:

The latest stable Org Babel stopped working with the introduction of Cider 
0.10.0.

You can either go back to Cider 0.9.1, or
(1) get Org 8.3.2,
(2) git-clone Org's repo, and
(3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest 
Cider.

The breakage was raised at https://github.com/clojure-emacs/cider/issues/1302 
and closed with a comment, "I don't have nor the time nor the energy to sync up 
with everyone maintaining a 3rd party extension. I just hope they're following 
the development and will do the necessary changes when needed."

But three considerations, which are not Cider's fault, argue for a kinder 
accommodation.  First, Org freezes for bundling into a major Emacs release only 
a few times a century, and the resulting Emacs release then enjoys wide 
distribution for many years.  Second, the bundled Org is unusually significant 
because overriding it with another version is not always fool-proof.  Third, 
Org with Clojure snippets is dynamite!  Therefore, I hope Org will get advice 
from Cider about a more durable technique, so the next Emacs+Org release might 
be useful even on the glacial Emacs time scale.


On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
Hi,

I am looking for a working environment for using org-mode with Clojure babel. 
Googleing for the issue I can only find some apparently outdated hints. I am 
using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, and CIDER 0.10.0.

Any hints, where I can find the right configuration?

Johannes


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to 
clo...@googlegroups.com<http://googlegroups.com/>
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com<http://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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+u...@googlegroups.com<http://googlegroups.com/>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682


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

Re: org-mode Clojure babel

2016-01-06 Thread Johannes
BUT!!!

With cider-nrepl set to 0.10.0 and cider set to 0.11.0-snapshot emacs 
complains:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
WARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's 
version (0.10.1). Things will break!

That's not an org-bable problem, but perhaps there is a tip what to do.

Johannes

Am Dienstag, 29. Dezember 2015 13:01:30 UTC+1 schrieb Johannes:
>
> thanks for the hint; indeed it works 
>
> Am 21.12.2015 um 16:12 schrieb martin_clausen :
>
> I found that
>
> Org-mode version 8.3.2 and CIDER 0.11.0 snapshot (package: 20151212.1044) 
>
> works great and can be easily be installed from repos.
>
> On Sunday, December 20, 2015 at 6:16:15 PM UTC+1, Johannes wrote: 
>>
>> Thanks, for the explanations. I hope for the best, that there will be an 
>> working org-babel version in the future. In the mean time I will continue 
>> using lentilc. 
>>
>> Johannes
>>
>> Am 10.12.2015 um 16:24 schrieb Matching Socks :
>>
>> The latest stable Org Babel stopped working with the introduction of 
>> Cider 0.10.0.  
>>
>> You can either go back to Cider 0.9.1, or
>> (1) get Org 8.3.2, 
>> (2) git-clone Org's repo, and 
>> (3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the 
>> latest Cider. 
>>
>> The breakage was raised at 
>> https://github.com/clojure-emacs/cider/issues/1302 and closed with a 
>> comment, "I don't have nor the time nor the energy to sync up with everyone 
>> maintaining a 3rd party extension. I just hope they're following the 
>> development and will do the necessary changes when needed."  
>>
>> But three considerations, which are not Cider's fault, argue for a kinder 
>> accommodation.  First, Org freezes for bundling into a major Emacs release 
>> only a few times a century, and the resulting Emacs release then enjoys 
>> wide distribution for many years.  Second, the bundled Org is unusually 
>> significant because overriding it with another version is not always 
>> fool-proof.  Third, Org with Clojure snippets is dynamite!  Therefore, I 
>> hope Org will get advice from Cider about a more durable technique, so the 
>> next Emacs+Org release might be useful even on the glacial Emacs time scale.
>>
>>
>> On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote: 
>>>
>>> Hi,
>>>
>>> I am looking for a working environment for using org-mode with Clojure 
>>> babel. Googleing for the issue I can only find some apparently outdated 
>>> hints. I am using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, 
>>> and CIDER 0.10.0.
>>>
>>> Any hints, where I can find the right configuration?
>>>
>>> Johannes
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> clojure+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>>
>>
>> Staatlich anerkannte private Fachhochschule
>> NORDAKADEMIE
>> Gemeinnützige Aktiengesellschaft
>> Köllner Chaussee 11
>> 25337 Elmshorn
>>
>> Vorstand:
>> Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. 
>> Vorstand)
>>
>> Vorsitzender des Aufsichtsrats:
>> Dr. h.c. Hans-Heinrich Bruns
>>
>> Sitz:
>> Elmshorn, Amtsgericht Pinneberg, HRB 1682
>>
>>
> -- 
> 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 

Re: org-mode Clojure babel

2015-12-29 Thread Johannes Brauer
thanks for the hint; indeed it works
Am 21.12.2015 um 16:12 schrieb martin_clausen 
mailto:martin.clau...@gmail.com>>:

I found that

Org-mode version 8.3.2 and CIDER 0.11.0 snapshot (package: 20151212.1044)

works great and can be easily be installed from repos.

On Sunday, December 20, 2015 at 6:16:15 PM UTC+1, Johannes wrote:
Thanks, for the explanations. I hope for the best, that there will be an 
working org-babel version in the future. In the mean time I will continue using 
lentilc.

Johannes
Am 10.12.2015 um 16:24 schrieb Matching Socks 
http://gmail.com/>>:

The latest stable Org Babel stopped working with the introduction of Cider 
0.10.0.

You can either go back to Cider 0.9.1, or
(1) get Org 8.3.2,
(2) git-clone Org's repo, and
(3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest 
Cider.

The breakage was raised at https://github.com/clojure-emacs/cider/issues/1302 
and closed with a comment, "I don't have nor the time nor the energy to sync up 
with everyone maintaining a 3rd party extension. I just hope they're following 
the development and will do the necessary changes when needed."

But three considerations, which are not Cider's fault, argue for a kinder 
accommodation.  First, Org freezes for bundling into a major Emacs release only 
a few times a century, and the resulting Emacs release then enjoys wide 
distribution for many years.  Second, the bundled Org is unusually significant 
because overriding it with another version is not always fool-proof.  Third, 
Org with Clojure snippets is dynamite!  Therefore, I hope Org will get advice 
from Cider about a more durable technique, so the next Emacs+Org release might 
be useful even on the glacial Emacs time scale.


On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
Hi,

I am looking for a working environment for using org-mode with Clojure babel. 
Googleing for the issue I can only find some apparently outdated hints. I am 
using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, and CIDER 0.10.0.

Any hints, where I can find the right configuration?

Johannes


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to 
clo...@googlegroups.com<http://googlegroups.com/>
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com<http://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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+u...@googlegroups.com<http://googlegroups.com/>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682


--
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<mailto: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<mailto: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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

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

Re: org-mode Clojure babel

2015-12-20 Thread Johannes Brauer
Thanks, for the explanations. I hope for the best, that there will be an 
working org-babel version in the future. In the mean time I will continue using 
lentilc.

Johannes
Am 10.12.2015 um 16:24 schrieb Matching Socks 
mailto:phill.w...@gmail.com>>:

The latest stable Org Babel stopped working with the introduction of Cider 
0.10.0.

You can either go back to Cider 0.9.1, or
(1) get Org 8.3.2,
(2) git-clone Org's repo, and
(3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest 
Cider.

The breakage was raised at https://github.com/clojure-emacs/cider/issues/1302 
and closed with a comment, "I don't have nor the time nor the energy to sync up 
with everyone maintaining a 3rd party extension. I just hope they're following 
the development and will do the necessary changes when needed."

But three considerations, which are not Cider's fault, argue for a kinder 
accommodation.  First, Org freezes for bundling into a major Emacs release only 
a few times a century, and the resulting Emacs release then enjoys wide 
distribution for many years.  Second, the bundled Org is unusually significant 
because overriding it with another version is not always fool-proof.  Third, 
Org with Clojure snippets is dynamite!  Therefore, I hope Org will get advice 
from Cider about a more durable technique, so the next Emacs+Org release might 
be useful even on the glacial Emacs time scale.


On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
Hi,

I am looking for a working environment for using org-mode with Clojure babel. 
Googleing for the issue I can only find some apparently outdated hints. I am 
using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, and CIDER 0.10.0.

Any hints, where I can find the right configuration?

Johannes


--
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<mailto: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<mailto: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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinn?tzige Aktiengesellschaft
K?llner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. J?rg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

-- 
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: org-mode Clojure babel

2015-11-10 Thread Johannes
I am quite impressed about lentic. I think I will use it. Thank you, Phil. 

Nevertheless I am looking for a working configuration for Emacs org-mode 
with Clojure babel.

Johannes

Am Freitag, 6. November 2015 18:10:58 UTC+1 schrieb Phillip Lord:
>
>
> If you are willing to entertain a slightly different interaction model, 
> you might want to take a look at the lentic package 
>
> https://github.com/phillord/lentic 
>  pInstead of Clojure snippets which you can pop out and edit, this gives 
> you two buffers, one entirely valid clojure (which syntax highlights, 
> you can eval, test and so forth) and one entirely valid org (which you 
> can publish, show-hide and so forth). You can edit either one (the 
> Clojure view or the Org-mode view) and changes percolate backward. 
>
> This video shows it working with org-mode and Emacs-lisp. 
>
> https://vimeo.com/116078853 
>
> And this video shows it working with latex and clojure. 
>
> https://vimeo.com/116141808 
>
> I don't have a video of it working with org and clojure, but it does 
> work with them. My tawny-owl library is being (slowly) ported to this 
> form of literate development. 
>
> https://github.com/phillord/tawny-owl/blob/master/src/tawny/owl.clj 
>
> It also allows integration with asciidoc, and clojure. I wrote these 
> slides: 
>
>
> http://homepages.cs.ncl.ac.uk/phillip.lord/download/tawny/icbo_2015/2015_lisbon.html
>  
>
> as literate clojure source. 
>
> Have fun. 
>
> Phil 
>
>
>
> Johannes Brauer > writes: 
>
> > Hi Karsten, 
> > 
> > thank you for the links to your project. But until now, I haven’t 
> succeeded to 
> > setup my Emacs so that I can evaluate Clojure code snippets in an org 
> file. 
> > 
> > Johannes 
> >> Am 03.11.2015 um 19:56 schrieb Karsten Schmidt  >: 
> >> 
> >> Hi Johannes, checkout my leiningen template for org-mode projects 
> >> here: http://thi.ng/babel and an example project using this template 
> >> here: http://thi.ng/fabric 
> >> 
> >> 
> >> On 3 November 2015 at 13:03, Stuart Sierra  > wrote: 
> >>> Hi Johannes 
> >>> 
> >>> I have a working Org babel & Clojure in my Emacs setup. It's 
> idiosyncratic 
> >>> to my preferences, but maybe it will be useful: 
> >>> github.com/stuartsierra/dotfiles 
> >>> 
> >>> –S 
> >>> 
> >>> 
> >>> 
> >>> On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote: 
> >>>> 
> >>>> Hi, 
> >>>> 
> >>>> I am looking for a working environment for using org-mode with 
> Clojure 
> >>>> babel. Googleing for the issue I can only find some apparently 
> outdated 
> >>>> hints. I am using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 
> 2.5.1, 
> >>>> and CIDER 0.10.0. 
> >>>> 
> >>>> Any hints, where I can find the right configuration? 
> >>>> 
> >>>> Johannes 
> >>>> 
> >>> -- 
> >>> You received this message because you are subscribed to the Google 
> >>> Groups "Clojure" group. 
> >>> To post to this group, send email to clo...@googlegroups.com 
>  
> >>> Note that posts from new members are moderated - please be patient 
> with your 
> >>> first post. 
> >>> To unsubscribe from this group, send email to 
> >>> clojure+u...@googlegroups.com  
> >>> For more options, visit this group at 
> >>> http://groups.google.com/group/clojure?hl=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+u...@googlegroups.com . 
> >>> For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> 
> >> 
> >> -- 
> >> Karsten Schmidt 
> >> http://postspectacular.com | http://thi.ng | http://toxiclibs.org 
> >> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> >> Groups "Clojure" group. 
> >> To post to this group, send email to clo...@googlegroups.com 
>  
> >> Note that posts from new members are moderated - please be patient with 
> your first post. 
> >> To unsubscribe from this group, send email to 
> >> clojure+u...@goo

Re: org-mode Clojure babel

2015-11-07 Thread Johannes Brauer
it sounds exciting, I’ll give it a try.

Johannes
> Am 06.11.2015 um 18:10 schrieb Phillip Lord :
>
>
> If you are willing to entertain a slightly different interaction model,
> you might want to take a look at the lentic package
>
> https://github.com/phillord/lentic
>
> Instead of Clojure snippets which you can pop out and edit, this gives
> you two buffers, one entirely valid clojure (which syntax highlights,
> you can eval, test and so forth) and one entirely valid org (which you
> can publish, show-hide and so forth). You can edit either one (the
> Clojure view or the Org-mode view) and changes percolate backward.
>
> This video shows it working with org-mode and Emacs-lisp.
>
> https://vimeo.com/116078853
>
> And this video shows it working with latex and clojure.
>
> https://vimeo.com/116141808
>
> I don't have a video of it working with org and clojure, but it does
> work with them. My tawny-owl library is being (slowly) ported to this
> form of literate development.
>
> https://github.com/phillord/tawny-owl/blob/master/src/tawny/owl.clj
>
> It also allows integration with asciidoc, and clojure. I wrote these
> slides:
>
> http://homepages.cs.ncl.ac.uk/phillip.lord/download/tawny/icbo_2015/2015_lisbon.html
>
> as literate clojure source.
>
> Have fun.
>
> Phil
>
>
>
> Johannes Brauer  writes:
>
>> Hi Karsten,
>>
>> thank you for the links to your project. But until now, I haven’t succeeded 
>> to
>> setup my Emacs so that I can evaluate Clojure code snippets in an org file.
>>
>> Johannes
>>> Am 03.11.2015 um 19:56 schrieb Karsten Schmidt :
>>>
>>> Hi Johannes, checkout my leiningen template for org-mode projects
>>> here: http://thi.ng/babel and an example project using this template
>>> here: http://thi.ng/fabric
>>>
>>>
>>> On 3 November 2015 at 13:03, Stuart Sierra  
>>> wrote:
>>>> Hi Johannes
>>>>
>>>> I have a working Org babel & Clojure in my Emacs setup. It's idiosyncratic
>>>> to my preferences, but maybe it will be useful:
>>>> github.com/stuartsierra/dotfiles
>>>>
>>>> –S
>>>>
>>>>
>>>>
>>>> On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am looking for a working environment for using org-mode with Clojure
>>>>> babel. Googleing for the issue I can only find some apparently outdated
>>>>> hints. I am using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1,
>>>>> and CIDER 0.10.0.
>>>>>
>>>>> Any hints, where I can find the right configuration?
>>>>>
>>>>> Johannes
>>>>>
>>>> --
>>>> 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.
>>>
>>>
>>>
>>> --
>>> Karsten Schmidt
>>> http://postspectacular.com | http://thi.ng | http://toxiclibs.org
>>>
>>> --
>>> 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 a topic in the 
>>> Google Groups "Clojure" group.
>>> To unsubscribe from th

Re: org-mode Clojure babel

2015-11-05 Thread Johannes Brauer
Hi!

Thank you for your hints.

...
One thing to do is look at your Org mode's ob-clojure.el and figure out whether 
it mentions cider.  (The older or "stable" versions use only slime or nrepl.)  
The Org website is a house of mirrors, but somewhere you should find a tidy 
tar.gz of a nicely assembled Org whose ob-clojure.el covers cider.
indeed, my version of ob-clojure did not mention cider. I’ve one in the house 
of mirrors (http://orgmode.org/cgit.cgi/org-mode.git/plain/lisp/ob-clojure.el) 
which does.
But the error message
 executing Clojure code block...
 let: Wrong number of arguments: (3 . 4), 1
remains.

Another thing that might go wrong, is that the cider-capable version of 
ob-clojure may try to detect whether it should use cider, nrepl, or slime.  
Detection might reach an unfortunate conclusion if Emacs had not loaded cider.  
Therefore, it might help to open a cider REPL buffer before opening any Org 
buffers.  (If I recall, Org Babel will need that REPL sooner or later anyway; 
it does not open its own REPL.)
I tried this too, but without success

Johannes

--
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<mailto: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<mailto: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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

-- 
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: org-mode Clojure babel

2015-11-04 Thread Johannes Brauer
Hi Karsten,

thank you for the links to your project. But until now, I haven’t succeeded to 
setup my Emacs so that I can evaluate Clojure code snippets in an org file.

Johannes
> Am 03.11.2015 um 19:56 schrieb Karsten Schmidt :
>
> Hi Johannes, checkout my leiningen template for org-mode projects
> here: http://thi.ng/babel and an example project using this template
> here: http://thi.ng/fabric
>
>
> On 3 November 2015 at 13:03, Stuart Sierra  
> wrote:
>> Hi Johannes
>>
>> I have a working Org babel & Clojure in my Emacs setup. It's idiosyncratic
>> to my preferences, but maybe it will be useful:
>> github.com/stuartsierra/dotfiles
>>
>> –S
>>
>>
>>
>> On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
>>>
>>> Hi,
>>>
>>> I am looking for a working environment for using org-mode with Clojure
>>> babel. Googleing for the issue I can only find some apparently outdated
>>> hints. I am using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1,
>>> and CIDER 0.10.0.
>>>
>>> Any hints, where I can find the right configuration?
>>>
>>> Johannes
>>>
>> --
>> 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.
>
>
>
> --
> Karsten Schmidt
> http://postspectacular.com | http://thi.ng | http://toxiclibs.org
>
> --
> 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 a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

-- 
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: org-mode Clojure babel

2015-11-04 Thread Johannes Brauer
Hi Stuart,

thanks a lot for your help. I’ve included your settings in my Emacs (Aquamacs) 
setup. After having activated CIDER I tried to compile (C-c C-c) a little code 
snippet:

#+begin_src clojure  :results silent
   (+ 1 2)
#+end_src

What happens, is:

Evaluate this clojure code block on your system? (y or n) y
executing Clojure code block...
let: Wrong number of arguments: (3 . 4), 1

What I am doing wrongly?

Johannes
Am 03.11.2015 um 14:03 schrieb Stuart Sierra 
mailto:the.stuart.sie...@gmail.com>>:

Hi Johannes

I have a working Org babel & Clojure in my Emacs setup. It's idiosyncratic to 
my preferences, but maybe it will be useful:
github.com/stuartsierra/dotfiles<https://github.com/stuartsierra/dotfiles/blob/c1168328d7e4483f24b0b82d9e19e235bd0007f0/.emacs.d/stuart.org#org-babel-and-clojure>

–S


On Tuesday, November 3, 2015 at 3:25:51 AM UTC-5, Johannes wrote:
Hi,

I am looking for a working environment for using org-mode with Clojure babel. 
Googleing for the issue I can only find some apparently outdated hints. I am 
using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, and CIDER 0.10.0.

Any hints, where I can find the right configuration?

Johannes


--
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<mailto: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<mailto: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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/PldQTR3yB3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.





Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

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


org-mode Clojure babel

2015-11-03 Thread Johannes
Hi,

I am looking for a working environment for using org-mode with Clojure 
babel. Googleing for the issue I can only find some apparently outdated 
hints. I am using org-mode version 8.2.10, Clojure 1.6.0, Leiningen 2.5.1, 
and CIDER 0.10.0.

Any hints, where I can find the right configuration?

Johannes

-- 
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: let vs. let*

2015-06-25 Thread Johannes
Hi,

I fear that I have to excuse me for triggering a debate about principles of 
behavior patterns on this list. Of course, I tried to answer my question 
myself using Google. Perhaps I made a mistake on the selection of the right 
search pattern so I didn't find satisfactory results.  The  lmgtfy link 
posted by raould was helpful.

Johannes

On Thursday, June 25, 2015 at 3:22:02 PM UTC+2, Alex Miller wrote:
>
> raould,
>
> I find lmgtfy links to be a condescending way to answer a question and I 
> would prefer that we not use them on this list. If you have an answer or a 
> link to one, then respond with this, otherwise I do not see a reason to 
> post this. 
>
> Thanks,
> Alex
>
>
> On Thursday, June 18, 2015 at 3:35:53 PM UTC-5, raould wrote:
>>
>> http://lmgtfy.com/?q=clojure+%22let+vs.+let*%22 
>>
>

-- 
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: let vs. let*

2015-06-18 Thread Johannes
thanks

Am Donnerstag, 18. Juni 2015 22:35:53 UTC+2 schrieb raould:
>
> http://lmgtfy.com/?q=clojure+%22let+vs.+let*%22 
>

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


let vs. let*

2015-06-18 Thread Johannes
Hi!

I cannot figure out, what the difference between let and let* is. Can 
anyone enlighten me?

Johannes

-- 
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: If code is data why do we use text editors?

2014-11-15 Thread Johannes
Perhaps a look at subtext (http://www.subtext-lang.org/demo1.html) could be 
interesting.

Johannes

-- 
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: Evaluation order

2014-10-08 Thread Johannes Langøy
Here is the finished Yatzy, in case anyone is interested:
https://github.com/Jovlang/catzy/blob/master/src/catzy/core.clj

kl. 19:05:50 UTC+2 onsdag 8. oktober 2014 skrev Johannes Langøy følgende:
>
> Thanks!
>
> kl. 02:17:45 UTC+2 onsdag 8. oktober 2014 skrev adrian...@mail.yu.edu 
> følgende:
>>
>> *output
>>
>> On Tuesday, October 7, 2014 8:17:34 PM UTC-4, adrian...@mail.yu.edu 
>> wrote:
>>>
>>> You need to flush the input stream after printing. Call 
>>> (clojure.core/flush) to do so.
>>>
>>> On Tuesday, October 7, 2014 4:51:05 PM UTC-4, Johannes Langøy wrote:
>>>>
>>>> Hi, I can't figure this out.  I have these two functions:
>>>>
>>>> (defn get-number []
>>>>   (try (let [input (read-string (read-line))]
>>>>  (if (number? input)
>>>>input
>>>>(get-number)))
>>>>(catch Exception e (get-number
>>>>
>>>> (defn selection-handler [tests]
>>>>   (dotimes [i (count tests)]
>>>> (printf "(%s) %s: %s\n"
>>>> (inc i)
>>>> (first (nth tests i))
>>>> (or (second (nth tests i))
>>>> "--")))
>>>>   (loop [input (dec (get-number))]
>>>> (if ((set (range (count tests))) input)
>>>>   (nth tests input)
>>>>   (recur (dec (get-number))
>>>>
>>>> Now, the problem is that when I run selection-handler, the dotimes 
>>>> output isn't printed until (get-number) has returned. Why is this?
>>>>
>>>

-- 
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: Evaluation order

2014-10-08 Thread Johannes Langøy
Thanks!

kl. 02:17:45 UTC+2 onsdag 8. oktober 2014 skrev adrian...@mail.yu.edu 
følgende:
>
> *output
>
> On Tuesday, October 7, 2014 8:17:34 PM UTC-4, adrian...@mail.yu.edu wrote:
>>
>> You need to flush the input stream after printing. Call 
>> (clojure.core/flush) to do so.
>>
>> On Tuesday, October 7, 2014 4:51:05 PM UTC-4, Johannes Langøy wrote:
>>>
>>> Hi, I can't figure this out.  I have these two functions:
>>>
>>> (defn get-number []
>>>   (try (let [input (read-string (read-line))]
>>>  (if (number? input)
>>>input
>>>(get-number)))
>>>(catch Exception e (get-number
>>>
>>> (defn selection-handler [tests]
>>>   (dotimes [i (count tests)]
>>> (printf "(%s) %s: %s\n"
>>> (inc i)
>>> (first (nth tests i))
>>> (or (second (nth tests i))
>>> "--")))
>>>   (loop [input (dec (get-number))]
>>> (if ((set (range (count tests))) input)
>>>   (nth tests input)
>>>   (recur (dec (get-number))
>>>
>>> Now, the problem is that when I run selection-handler, the dotimes 
>>> output isn't printed until (get-number) has returned. Why is this?
>>>
>>

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


Evaluation order

2014-10-07 Thread Johannes Langøy
Hi, I can't figure this out.  I have these two functions:

(defn get-number []
  (try (let [input (read-string (read-line))]
 (if (number? input)
   input
   (get-number)))
   (catch Exception e (get-number

(defn selection-handler [tests]
  (dotimes [i (count tests)]
(printf "(%s) %s: %s\n"
(inc i)
(first (nth tests i))
(or (second (nth tests i))
"--")))
  (loop [input (dec (get-number))]
(if ((set (range (count tests))) input)
  (nth tests input)
  (recur (dec (get-number))

Now, the problem is that when I run selection-handler, the dotimes output 
isn't printed until (get-number) has returned. Why is this?

-- 
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: cannot import namespace reducers

2013-07-23 Thread Johannes Brauer
if I remember correctly I solved the problem by reinstalling Java 7 from 
Oracle. Thereafter my $JAVA_HOME points to:
/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home

Johannes
Am 24.07.2013 um 03:02 schrieb Keith Maynard 
mailto:kpmayn...@gmail.com>>
:

Please spam the list!!! I am sure anyone who receives that message is probably 
running Mac OS X 10.7.x or later and trying to unravel the mess between Java 6 
and Java 7.  Please post recommendations. I finally got Eclipse to see the 
jdl1.7.0_25.jdk now how do I get the OS to replace the Apple installed 1.6.x?

On Sunday, 16 June 2013 17:29:40 UTC-4, Las wrote:

Then you are having a path problem.
Your lein is still using java6
Check your $PATH and $JAVA_HOME env. variables.

As this not strictly clojure related, let's not spam the list, im happy to help 
off list

Sent from my phone

On Jun 16, 2013 11:22 PM, "Johannes Brauer"  wrote:
I am on clojure 1.5.1 and I use lein repl.

But after

(require '[clojure.core.reducers :as r])

I still get the same error message as with Java 6:
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

A second input of
(require '[clojure.core.reducers :as r])

generates the message:
Exception namespace 'clojure.core.reducers' not found  clojure.core/load-lib 
(core.clj:5380)

Johannes

Am 16.06.2013 um 23:16 schrieb László Török 
:

are you on clojure 1.5+ ?

If I launch the REPL using "lein repl"

and then

(require 'clojure.core.reducers)

it works ok for me.


2013/6/16 Johannes Brauer 
now, I've Java 7 installed and get another error message:
Exception namespace 'clojure.core.reducers' not found  clojure.core/load-lib 
(core.clj:5380)

any further hints?

Johannes
Am 16.06.2013 um 22:43 schrieb Johannes Brauer 
:

thank you, Las, for the quick tip. I will give Java 7 a try. I hope there are 
no problems on Mac OS 10.8.4

Johannes
Am 16.06.2013 um 22:15 schrieb László Török 
:

.. sorry, gmail's new annoying keyboard shortcut

b) include the dependency to the forkjoin library [1] that is not included in 
Java6

Las

[1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


2013/6/16 László Török 
Hi,

there are two ways to deal with this:

a) use Java 7


2013/6/16 Johannes 
Hi,

trying
(require '[clojure.core.reducers :as r])
at the repl prompt the error message
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

What is going wrong?

Johannes



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





--
László Török



--
László Török

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







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group

Re: cannot import namespace reducers

2013-06-16 Thread Johannes Brauer
I am on clojure 1.5.1 and I use lein repl.

But after

(require '[clojure.core.reducers :as r])

I still get the same error message as with Java 6:
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

A second input of
(require '[clojure.core.reducers :as r])

generates the message:
Exception namespace 'clojure.core.reducers' not found  clojure.core/load-lib 
(core.clj:5380)

Johannes

Am 16.06.2013 um 23:16 schrieb László Török 
mailto:ltoro...@gmail.com>>
:

are you on clojure 1.5+ ?

If I launch the REPL using "lein repl"

and then

(require 'clojure.core.reducers)

it works ok for me.


2013/6/16 Johannes Brauer 
mailto:bra...@nordakademie.de>>
now, I've Java 7 installed and get another error message:
Exception namespace 'clojure.core.reducers' not found  clojure.core/load-lib 
(core.clj:5380)

any further hints?

Johannes
Am 16.06.2013 um 22:43 schrieb Johannes Brauer 
mailto:bra...@nordakademie.de>>
:

thank you, Las, for the quick tip. I will give Java 7 a try. I hope there are 
no problems on Mac OS 10.8.4

Johannes
Am 16.06.2013 um 22:15 schrieb László Török 
mailto:ltoro...@gmail.com>>
:

.. sorry, gmail's new annoying keyboard shortcut

b) include the dependency to the forkjoin library [1] that is not included in 
Java6

Las

[1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


2013/6/16 László Török mailto:ltoro...@gmail.com>>
Hi,

there are two ways to deal with this:

a) use Java 7


2013/6/16 Johannes mailto:bra...@nordakademie.de>>
Hi,

trying
(require '[clojure.core.reducers :as r])
at the repl prompt the error message
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

What is going wrong?

Johannes



--
--
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<mailto: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<mailto:clojure%2bunsubscr...@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<mailto:clojure%2bunsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.





--
László Török



--
László Török

--
--
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<mailto: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<mailto: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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682


--
--
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<mailto: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<mailto: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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gem

Re: cannot import namespace reducers

2013-06-16 Thread Johannes Brauer
now, I've Java 7 installed and get another error message:
Exception namespace 'clojure.core.reducers' not found  clojure.core/load-lib 
(core.clj:5380)

any further hints?

Johannes
Am 16.06.2013 um 22:43 schrieb Johannes Brauer 
mailto:bra...@nordakademie.de>>
:

thank you, Las, for the quick tip. I will give Java 7 a try. I hope there are 
no problems on Mac OS 10.8.4

Johannes
Am 16.06.2013 um 22:15 schrieb László Török 
mailto:ltoro...@gmail.com>>
:

.. sorry, gmail's new annoying keyboard shortcut

b) include the dependency to the forkjoin library [1] that is not included in 
Java6

Las

[1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


2013/6/16 László Török mailto:ltoro...@gmail.com>>
Hi,

there are two ways to deal with this:

a) use Java 7


2013/6/16 Johannes mailto:bra...@nordakademie.de>>
Hi,

trying
(require '[clojure.core.reducers :as r])
at the repl prompt the error message
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

What is going wrong?

Johannes



--
--
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<mailto: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<mailto:clojure%2bunsubscr...@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<mailto:clojure%2bunsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.





--
László Török



--
László Török

--
--
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<mailto: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<mailto: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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682


--
--
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<mailto: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<mailto: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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

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

Re: cannot import namespace reducers

2013-06-16 Thread Johannes Brauer
thank you, Las, for the quick tip. I will give Java 7 a try. I hope there are 
no problems on Mac OS 10.8.4

Johannes
Am 16.06.2013 um 22:15 schrieb László Török 
mailto:ltoro...@gmail.com>>
:

.. sorry, gmail's new annoying keyboard shortcut

b) include the dependency to the forkjoin library [1] that is not included in 
Java6

Las

[1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


2013/6/16 László Török mailto:ltoro...@gmail.com>>
Hi,

there are two ways to deal with this:

a) use Java 7


2013/6/16 Johannes mailto:bra...@nordakademie.de>>
Hi,

trying
(require '[clojure.core.reducers :as r])
at the repl prompt the error message
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21)

What is going wrong?

Johannes



--
--
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<mailto: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<mailto:clojure%2bunsubscr...@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<mailto:clojure%2bunsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.





--
László Török



--
László Török

--
--
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<mailto: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<mailto: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<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.







Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Pinneberg, HRB 1682

-- 
-- 
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/groups/opt_out.




cannot import namespace reducers

2013-06-16 Thread Johannes
Hi,

trying
(require '[clojure.core.reducers :as r])
at the repl prompt the error message
CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool, 
compiling:(clojure/core/reducers.clj:56:21) 

What is going wrong?

Johannes


-- 
-- 
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/groups/opt_out.




Re: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:15:17 UTC+1 schrieb thorwil:
>
> On 11/13/2012 11:06 AM, Johannes wrote: 
> > I define a record 
> > (defrecord point [x y]) 
> > 
> > and the following macro: 
> > 
> > (defmacro drg 
> >[typename components] 
> >`(def ~(symbol (str typename "-" (str (first components 
> >   (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
> > (first components 
>
> > But calling the macro results in an error message: 
> > user> (drg point [x y]) 
> > CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
> > :x in this context, compiling:(NO_SOURCE_PATH:1) 
> > 
> > Can anyone tell me what my mistake is? 
>
> I guess the problem is that you created :x using symbol, so it is not 
> recognized as a key. 
>
> But the whole approach, starting with creating names to def to inside a 
> macro, is troublesome. This makes it hard to follow what's going on. If 
> you provide a larger context of what you are trying to accomplish, I'm 
> sure someone can suggest a much better approach. 
>
I am trying to build an alternative record building macro. For example

(define-record point [x y])
should define 
- a new type point
- a constructor make-point
- a type checker point?
- and 2 getters point-x and point-y

Johannes

-- 
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: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:09:39 UTC+1 schrieb Jim foo.bar:
>
> You can't convert to keyword simply by (str ":" (str (first 
> components))...you need the (keyword (first components))

in the meantime I learned this from Christophe 

> ...also why is 
> your argument (symbol "obj")? I'd prefer obj# or (gensym obj)... 
>
I looked for something like that, but didn't find Bitte um Rücksprache!

Johannes 


> On 13/11/12 10:06, Johannes wrote: 
> > Hi, 
> > 
> > I define a record 
> > (defrecord point [x y]) 
> > 
> > and the following macro: 
> > 
> > (defmacro drg 
> >   [typename components] 
> >   `(def ~(symbol (str typename "-" (str (first components 
> >  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
> > (first components 
> > 
> > the call 
> > user> (macroexpand-1 '(drg point [x y])) 
> > 
> > delivers what I expect: 
> > (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x))) 
> > 
> > Evalutating this expression at the repl delivers what I expect: 
> > user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x))) 
> > #'user/point-x 
> > 
> > But calling the macro results in an error message: 
> > user> (drg point [x y]) 
> > CompilerException java.lang.RuntimeException: Unable to resolve 
> > symbol: :x in this context, compiling:(NO_SOURCE_PATH:1) 
> > 
> > Can anyone tell me what my mistake is? 
> > 
> > Johannes 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient 
> > with your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=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: question concerning macros by a newbie

2012-11-13 Thread Johannes


Am Dienstag, 13. November 2012 12:06:10 UTC+1 schrieb Christophe Grand:
>
> (symbol (str ":" (str (first components should be (keyword (first 
> components))
> In your expansion, :x is not a keyword but a symbol starting by a colon -- 
> the symbol fn performs no validation on its input.
> When you copied/pasted it for evaluation it was then read as a keyword.
>
I understand 

>
> Btw I'm a little worried: are you planning to generate accessors for your 
> fields or are you just toying with macros?
>
both, I am learning about macros and I enjoy to build an alternative syntax 
for records; I know that the keywords can be uses as accessors

thanks
Johannes

>
>
> On Tue, Nov 13, 2012 at 11:06 AM, Johannes 
> 
> > wrote:
>
>> Hi,
>>
>> I define a record
>> (defrecord point [x y])
>>
>> and the following macro:
>>
>> (defmacro drg
>>   [typename components]
>>   `(def ~(symbol (str typename "-" (str (first components
>>  (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
>> (first components
>>
>> the call 
>> user> (macroexpand-1 '(drg point [x y]))
>>
>> delivers what I expect:
>> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
>>
>> Evalutating this expression at the repl delivers what I expect:
>> user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
>> #'user/point-x
>>
>> But calling the macro results in an error message:
>> user> (drg point [x y])
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> :x in this context, compiling:(NO_SOURCE_PATH:1) 
>>
>> Can anyone tell me what my mistake is?
>>
>> Johannes
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com 
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>
>
> -- 
> Professional: http://cgrand.net/ (fr)
> On Clojure: http://clj-me.cgrand.net/ (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

question concerning macros by a newbie

2012-11-13 Thread Johannes
Hi,

I define a record
(defrecord point [x y])

and the following macro:

(defmacro drg
  [typename components]
  `(def ~(symbol (str typename "-" (str (first components
 (fn [~(symbol "obj")] (get ~(symbol "obj") ~(symbol (str ":" (str 
(first components

the call 
user> (macroexpand-1 '(drg point [x y]))

delivers what I expect:
(def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))

Evalutating this expression at the repl delivers what I expect:
user> (def point-x (clojure.core/fn [obj] (clojure.core/get obj :x)))
#'user/point-x

But calling the macro results in an error message:
user> (drg point [x y])
CompilerException java.lang.RuntimeException: Unable to resolve symbol: :x 
in this context, compiling:(NO_SOURCE_PATH:1) 

Can anyone tell me what my mistake is?

Johannes

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