core.async top use cases

2016-09-17 Thread Matan Safriel
Hi,

It's very easy to see how core.async solves callback hell for front-end 
development with clojurescript.
In what use cases would you use it for server-side? we already have 
non-blocking IO from Java, and we have clojure agents. So what's a bunch of 
salient use cases?
Are there prominent clojure http server implementations which rely on it 
for transcending the threaded web service paradigm?

Thanks,
Matan

-- 
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: Clojure support for Visual Studio Code

2016-09-17 Thread Andrey Lisin
Hi Ikuru,

please, see my comments below.

On Sunday, September 18, 2016 at 6:52:47 AM UTC+6, Ikuru Kanuma wrote:
>
>
> I guess the installation part is then something specific to the ubuntu 
> flavor(I am using ubuntu-mate) I am using/ what ever it could be.
> (I also did try to open the file from the menu, but same story as dragging 
> and dropping).
> Also my vs-code installation is a bit suspicious, so I will look up other 
> trouble shooting resources.
> Thanks anyways!
>

I'm with Michael here. Try to use the package from the VSCode download 
web-site.
 

>
> Regarding the dependency part, I meant that in cider(on emacs)
> I do not have to specify any of those dependencies by my self because it 
> is handled when I start a repl from cider.
> https://github.com/clojure-emacs/cider/pull/1552 and thought it would be 
> a great improvement.
>
>
Wow, I didn't know about it (haven't used Emacs Cider for a while.) Not 
sure how to implement this, but will definitely take a look. Thank you for 
pointing this out!
 

-- 
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: Clojure support for Visual Studio Code

2016-09-17 Thread Andrey Lisin
Hi Michael,

First of all, I would like to thank you for your feedback, it helps a lot. 
See my comments inlined.

On Saturday, September 17, 2016 at 4:32:39 AM UTC+6, Michael Ball wrote:
>
>
> - Explicit docs/instructions on how to start and connect to the repl would 
> be good. I was able to get it connected but it was unclear if the repl 
> should be started from within VS code, or from a terminal then only connect 
> to it from VS code.
>

The instructions can be found in the "How to Use?" section of readme file. 
Not sure I understand your point about where the repl should be started. Do 
you mean you mean you expected repl will be run by VSCode on connect like 
it happens in Emacs?
 

>
> - The commands in the command pallet could be prefixed with a "clj: " or 
> perhaps "clojure: " or something like that. Other plugins I've used(e.g. 
> elm) do this so it's easy  to know which commands are associated with the 
> extension and which are part of the editor.
>

This is a valid point. I will do the necessary modifications soon.
 

>
> - Docstrings don't seem to work for thread first  (-> xxx)? I also noticed 
> that it took some time after initial repl connect for the docstrings to 
> become available, probably some indexing delay because my laptop is 
> old+slow, initially they showed "Docstring not found". Also the docstring 
> not found message pops up for all characters on hover of mouse over things 
> such as parenthesis.
>

You're right about the thread first docstring. It looks like I need to 
adjust the regex for finding Clojure words. Will fix it soon.

About docstrings. There shouldn't be snoticable time between pointing a 
thing and getting its documentation. However, the is a subtly aspect you 
should be aware of. If you have a namespace definition in the beginning of 
a file you should eval the file first. Say, you have a file with the 
following content:

(ns foo)

(println "Hello World")

 When you point println you won't see the docstring. The reason is the 
extension sends the following message to the repl: "Give me a docstring for 
the function println from foo namespace." But at the moment repl *know 
nothing *about foo namespace! So you neen to eval the file. This will 
result adding foo namespace to the repl and importing everything from 
clojure.core namespace to it (this is a sideeffect of ns macro). I believe, 
this is the common behaviour for all solutions based on cider-nrepl (I've 
checked it is true for Emacs Cider and Vim Fireplace). Though I admit it's 
not the most intuitive one. So I'm open to suggestions.

- I found a command to eval the entire file which worked good. Is there a 
> way to send selected expressions to a repl yet?
>

Yes, it is! Just select code you want to send to a repl and eval it with 
"Eval" command.
 

>
> - If I had one feature request it would be for inline results a-la 
> LightTable. Any plans for something like that?
>

It's definetly a useful feature and I can add it easily. The only thing I'm 
not sure about is where to show an evaluation result :) Do you have any 
ideas. Maybe you've seen the similar feature in other VSCode plugins and 
know how to do it right?
 

>
> Overall this is a great start, thank you very much for getting the ball 
> rolling and building this extension!
>

Pleasure! 

-- 
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: Reader macro not ignoring form?

2016-09-17 Thread Alex Engelberg
This appears to be a more general issue that can be reproduced by sending
" " as a single command to the REPL. I was able
to get similar behavior by sending in other types of malformed expressions.
When I hit enter the second time, the valid form came through.

user=> ​​:) ​1​
​
RuntimeException Invalid token: :  clojure.lang.Util.runtimeException
(Util.java:221)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException
(Util.java:221)
user=>
​1​
user=> :a/ ​:result​

RuntimeException Invalid token: :a/  clojure.lang.Util.runtimeException
(Util.java:221)
user=>
​:result


On Sat, Sep 17, 2016 at 7:14 PM, craig worrall <
craig.worr...@transacumen.com> wrote:

>
> nREPL server started on port 37885 on host 127.0.0.1 - nrepl://
> 127.0.0.1:37885
> REPL-y 0.3.7, nREPL 0.2.12
> Clojure 1.9.0-alpha11
> OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14
> Docs: (doc function-name-here)
>   (find-doc "part-of-name-here")
>   Source: (source function-name-here)
>  Javadoc: (javadoc java-object-or-class-here)
> Exit: Control+D or (exit) or (quit)
>  Results: Stored in vars *1, *2, *3, an exception in *e
>
> user=> (::foo/bar {})
>
> RuntimeException Invalid token: ::foo/bar  clojure.lang.Util.runtimeException
> (Util.java:221)
> RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException
> (Util.java:221)
> user=> #_(::foo/bar {})
> {}
> user=>
>
> but:
>
> nREPL server started on port 39659 on host 127.0.0.1 - nrepl://
> 127.0.0.1:39659
> REPL-y 0.3.7, nREPL 0.2.12
> Clojure 1.9.0-alpha11
> OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14
> Docs: (doc function-name-here)
>   (find-doc "part-of-name-here")
>   Source: (source function-name-here)
>  Javadoc: (javadoc java-object-or-class-here)
> Exit: Control+D or (exit) or (quit)
>  Results: Stored in vars *1, *2, *3, an exception in *e
>
> user=> #_(::foo/bar {})
>
> user=>
>
>
>
> Craig
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Reader macro not ignoring form?

2016-09-17 Thread craig worrall

nREPL server started on port 37885 on host 127.0.0.1 - 
nrepl://127.0.0.1:37885
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-alpha11
OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14
Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (::foo/bar {})

RuntimeException Invalid token: ::foo/bar  
clojure.lang.Util.runtimeException (Util.java:221)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:221)
user=> #_(::foo/bar {})
{}
user=> 

but:

nREPL server started on port 39659 on host 127.0.0.1 - 
nrepl://127.0.0.1:39659
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-alpha11
OpenJDK 64-Bit Server VM 1.8.0_91-8u91-b14-0ubuntu4~14.04-b14
Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> #_(::foo/bar {})

user=> 



Craig


-- 
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: Clojure support for Visual Studio Code

2016-09-17 Thread Michael Ball
Hi Ikuru, did you install VS code from your package manager and install the 
code-oss package? 

I ask because when I first installed VS code on Solus Linux I used the one 
from the package manager which was the "code-oss package". Unfortunately I 
found out later that extensions are not supported in the code-oss version. 

I had to download the .tar.gz version of VS Code package directly 
(https://code.visualstudio.com/download), install manually, then extensions 
worked great.





On Saturday, September 17, 2016 at 5:52:47 PM UTC-7, Ikuru Kanuma wrote:
>
> Thanks for the reply Andrey!
>
> I guess the installation part is then something specific to the ubuntu 
> flavor(I am using ubuntu-mate) I am using/ what ever it could be.
> (I also did try to open the file from the menu, but same story as dragging 
> and dropping).
> Also my vs-code installation is a bit suspicious, so I will look up other 
> trouble shooting resources.
> Thanks anyways!
>
> Regarding the dependency part, I meant that in cider(on emacs)
> I do not have to specify any of those dependencies by my self because it 
> is handled when I start a repl from cider.
> https://github.com/clojure-emacs/cider/pull/1552 and thought it would be 
> a great improvement.
>
>

-- 
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: Clojure support for Visual Studio Code

2016-09-17 Thread Ikuru Kanuma
Thanks for the reply Andrey!

I guess the installation part is then something specific to the ubuntu 
flavor(I am using ubuntu-mate) I am using/ what ever it could be.
(I also did try to open the file from the menu, but same story as dragging 
and dropping).
Also my vs-code installation is a bit suspicious, so I will look up other 
trouble shooting resources.
Thanks anyways!

Regarding the dependency part, I meant that in cider(on emacs)
I do not have to specify any of those dependencies by my self because it is 
handled when I start a repl from cider.
https://github.com/clojure-emacs/cider/pull/1552 and thought it would be a 
great improvement.

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


[ANN] rete4frames, v. 5.2.5 - CLIPS-like expert system shell

2016-09-17 Thread ru
Hi,

New version 5.2.5 of rete4frames CLIPS-like expert system shell is 
published on https://github.com/rururu/rete4frames.

News:

Integrated Development Environment based on Protege-3.5 ontology editor 
(http://protege.stanford.edu) is added.

Enjoy!

Sincerely,
  Ru

-- 
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: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Matching Socks
No escape needed; or, rather, no need to invent an escape.  A mapping from 
IRI to URI is already specified in RFC 3987, "Internationalized Resource 
Identifiers (IRIs)".  Just translate IRI to URI, and thence to keyword.  

-- 
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: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Herwig Hochleitner
2016-09-17 15:10 GMT+02:00 Matching Socks :

> To make a URI into a Clojure keyword namespace, we may simply replace
> the 11 URI characters that are forbidden or problematic in keywords
> with Unicode-alphabetic characters outside Latin-1.
>

Yep, I've been thinking along those lines as well. We'd still need an
escape character, since unicode uris are a thing, but at least we could
substitute :,/,... without it.

The substitutes should be present in common desktop fonts, and should
> not be mistaken for Latin-1 characters.  They should come from a
> single Unicode script, to avoid burdensome Unicode puns.  It should
> be a raster script that does not require decades of handwriting practice.
>
> Cyrillic fits the bill very well:  it's recognizable and out-of-band.
> You'd
> never type these URI keywords in, but Cyrillic is a software-selectable
> keyboard so you could if you felt like it.
>
>   http://www.cs.yale.edu/~perlis-alan/quotes.html
>   httpцЛЛwwwЯcsЯyaleЯeduЛжperlis-alanЛquotesЯhtml
>

Cyrillic might serve us well, but maybe is a set of dedicated substitution
characters in unicode?

I'm still concerned, that doing this might be viewed as an ugly hack, but I
think, being able to reuse namespace aliasing is a powerful proposition...

-- 
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: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Matching Socks
To make a URI into a Clojure keyword namespace, we may simply replace
the 11 URI characters that are forbidden or problematic in keywords
with Unicode-alphabetic characters outside Latin-1.

The substitutes should be present in common desktop fonts, and should
not be mistaken for Latin-1 characters.  They should come from a
single Unicode script, to avoid burdensome Unicode puns.  It should
be a raster script that does not require decades of handwriting practice.

Cyrillic fits the bill very well:  it's recognizable and out-of-band.  You'd
never type these URI keywords in, but Cyrillic is a software-selectable 
keyboard so you could if you felt like it.

  http://www.cs.yale.edu/~perlis-alan/quotes.html
  httpцЛЛwwwЯcsЯyaleЯeduЛжperlis-alanЛquotesЯhtml

Here is a demonstration of a simple URI <-> keyword translator 
and a keyword-namespace aliasing macro to facilitate relatively 
painless use of namespace literals in source code.

(To furthermore overcome the problem that "%" hex expressions compare
case-blind in URIs, but not keywords, we should norm %xx to %XX as RFC
3986 recommends before converting to a keyword namespace.)

(def problems  [\. \~ \: \/ \[ \] \@ \( \) \, \;])
(def solutions [\Я \ж \ц \Л \П \Ю \Ж \ъ \Ъ \г \д])

(defn- tr [a b]
  (let [m (zipmap a b)]
(fn [s]
  (apply str (map #(m % %) s)

(def uri->kwns
  (tr problems solutions))

(def kwns->uri
  (tr solutions problems))

(defmacro alias-xml-ns [sym uri]
  `(let [kwns# (symbol (uri->kwns ~uri))]
(create-ns kwns#)
(alias ~sym kwns#)))

(comment

  (uri->kwns "http://www.w3.org/2000/01/rdf-schema#";)
  
  (kwns->uri *1)

  (alias-xml-ns 'html "http://www.w3.org/1999/xhtml";)

  (assert
   (identical? ::html/aside
   :httpцЛЛwwwЯw3ЯorgЛ1999Лxhtml/aside))

)


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