Re: Simulations in Clojure/Clojurescript

2018-01-10 Thread Michael Nardell
On Wednesday, January 10, 2018 at 4:56:24 PM UTC-8, Christopher Small wrote:

You may be right about an object-oriented approach being the most natural 
> here. But, I'd encourage you to keep an open mind. Clojure has this 
> particular way of encouraging you to and rewarding you for describing your 
> problem domain in terms of pain data, and writing program logic as (mostly) 
> pure functions around that data. 
>

Chris :: Thanks, I am hoping that you are foretelling the path I will end 
up following. That I start with an object approach, because that is what I 
am familiar with and have used in the past. Then find new ways of thinking 
about the problem through through functional and Clojure programming. I 
think a good starting point, is as you recommend, substitute maps for 
objects in my thinking in the problem domain. I can see that I could 
actually set-up the simulation just so, and I will have completely captured 
the model, frozen at time t=0. Then my challenge is to write a set of 
functions that will transition the model to time t+1. At that point I am 
done. 

Mike

-- 
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: Simulations in Clojure/Clojurescript

2018-01-10 Thread Christopher Small

A Wize One once said

> Closures are the poor man's objects

It's easy to build "object-like" things in clojure. Just create a map 
pointing to whatever you like, including stateful things, like atoms. Then 
write functions which take that map and do stuff with it. Clojure's Records 
and Protocols are more formal ways of doing this, with added performance 
optimization and bidirectional polymophism, so they may be worth looking 
into. You may also want to take a look at spec.

You may be right about an object-oriented approach being the most natural 
here. But, I'd encourage you to keep an open mind. Clojure has this 
particular way of encouraging you to and rewarding you for describing your 
problem domain in terms of pain data, and writing program logic as (mostly) 
pure functions around that data. When statefulness is required, we're often 
careful about how we introduce it, and find ways to isolate it as much as 
possible from the non-stateful bits, thereby maximizing how much of the 
code we can keep pure. If you're already familiar with other functional 
languages, I may be saying nothing too new here. But Clojure still has a 
pretty unique take on the data-driven paradigm, so you may find yourself 
thinking about things in new ways. Even if you end up doing something 
pretty object-oriented, think about how you can steer things in this 
general direction, and other ways you might tackle the problem.

Good luck

Chris





On Wednesday, January 10, 2018 at 3:13:00 PM UTC-8, Michael Nardell wrote:
>
> Greetings :: I am new to Clojure and have not really gotten my feet wet 
> with Clojurescript yet. The advice I always give someone when leaning 
> programming or a new language is to pick a project that they are interested 
> in and dive in. For me, that project would be creating educational 
> simulations that model complex systems. 
>
> Part of my challenge with this as a project is that it is leading me 
> towards programming (at least partially) with objects to model the discrete 
> components in these systems. Arguably simulations are one of the domains 
> where objects are the right paradigm. The question I pose to the group is 
> how to work with objects in Clojure, in a manner that "goes with the grain" 
> of the language. Perhaps best to ground my question in a concrete example:
>
> I had created simulations / visualizations of Hubel and Wiesel's model of 
> the  center-surround receptive fields in the retina. My past simulations I 
> used a collection of objects to model  photo receptors (i.e. rods/cones),  
> horizontal, bi-polar cells, connected together to represent the behavior of 
> either on-center or off-center receptive fields. Kind of a simple neural 
> network. Would like to preserve the object nature of nodes in the network, 
> since the nodes have state and should be represented by graphics in a gui. 
> Ultimately I would like to move toward a "constructor kit" approach that 
> would allow students and teachers to model and simulate a whole variety of 
> various systems that can be represented as a network of processes with 
> feed-forward and feed-back connections. 
>
> Interested to know of any useful examples and guidance for doing objects 
> the Clojure/Clojurescript way. Certainly one of the examples I want to look 
> at closely is the Ant Hill that Rich Hickey demonstrated. 
>
> As is the case with a neophyte - any advice is well appreciated. 
>
> Mike
>
>

-- 
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: Officially support Vert.x

2018-01-10 Thread Matching Socks
How do the aims of this undertaking compare with Pedestal?

http://pedestal.io/ says, "Pedestal supports Tomcat, Jetty, Immutant (with 
Undertow), Vert.x, ..."


-- 
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: ANN: Pink 0.4.0 / Score 0.4.0

2018-01-10 Thread Steven Yi
Thanks for the kind words, I hope you enjoy it!

On Wednesday, January 10, 2018 at 12:27:35 PM UTC-5, Shaun Gilchrist wrote:
>
> This looks like it will be a LOT of fun to play with. Also there is 
> nothing like waking up and finding in your inbox a project you only wished 
> you had the time to work on but would much rather just use! Thank you! 
>
> On Mon, Jan 8, 2018 at 1:41 PM, Steven Yi  > wrote:
>
>> Hi All,
>>
>> I'd like to announce the release of Pink 0.4.0 and Score 0.4.0:
>>
>> [kunstmusik/pink "0.4.0"]
>> [kunstmusik/score "0.4.0"]
>>
>> Pink is an audio engine library, and Score is a library for
>> higher-level music representations (e.g. notes, phrases, parts,
>> scores).
>>
>> Change logs are available at:
>>
>> https://github.com/kunstmusik/pink/blob/master/CHANGELOG.md
>> https://github.com/kunstmusik/score/blob/master/CHANGELOG.md
>>
>> Short version is that Pink has a number of new filters and effects,
>> updates to minimize object allocations (e.g., Distruptor-style message
>> ring buffers), and utility code for building streaming disk-based
>> caches for pre-rendered ("frozen") parts. Score has new functions
>> geared towards live coding (e.g., euclidean and hexadecimal beats), a
>> new mini-language for notating musical lines, and number of other
>> updates.
>>
>> Codox-generated documentation/site is now published at:
>>
>> http://kunstmusik.github.com/pink
>> http://kunstmusik.github.com/score
>>
>> For any questions, please feel free to email me or post on the
>> pink-users list.  For issues and PR's, please use the facilities on
>> Github for each of the projects.
>>
>> Thanks!
>> steven
>>
>> --
>> 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.


Simulations in Clojure/Clojurescript

2018-01-10 Thread Michael Nardell
Greetings :: I am new to Clojure and have not really gotten my feet wet 
with Clojurescript yet. The advice I always give someone when leaning 
programming or a new language is to pick a project that they are interested 
in and dive in. For me, that project would be creating educational 
simulations that model complex systems. 

Part of my challenge with this as a project is that it is leading me 
towards programming (at least partially) with objects to model the discrete 
components in these systems. Arguably simulations are one of the domains 
where objects are the right paradigm. The question I pose to the group is 
how to work with objects in Clojure, in a manner that "goes with the grain" 
of the language. Perhaps best to ground my question in a concrete example:

I had created simulations / visualizations of Hubel and Wiesel's model of 
the  center-surround receptive fields in the retina. My past simulations I 
used a collection of objects to model  photo receptors (i.e. rods/cones),  
horizontal, bi-polar cells, connected together to represent the behavior of 
either on-center or off-center receptive fields. Kind of a simple neural 
network. Would like to preserve the object nature of nodes in the network, 
since the nodes have state and should be represented by graphics in a gui. 
Ultimately I would like to move toward a "constructor kit" approach that 
would allow students and teachers to model and simulate a whole variety of 
various systems that can be represented as a network of processes with 
feed-forward and feed-back connections. 

Interested to know of any useful examples and guidance for doing objects 
the Clojure/Clojurescript way. Certainly one of the examples I want to look 
at closely is the Ant Hill that Rich Hickey demonstrated. 

As is the case with a neophyte - any advice is well appreciated. 

Mike

-- 
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: Port graphs: What would Rich Hickey do?

2018-01-10 Thread Ben Kovitz
On Monday, January 8, 2018 at 12:14:59 AM UTC-5, James Gatannah wrote:
 

> FWIW, I think https://leanpub.com/specter looks extremely interesting. 
> (Or it may be awful...I haven't had a chance to read it yet, much less work 
> through the exercises).
>

Actually, I worked through that ebook last week. (Or at least the version 
of the ebook in Google's cache. Leanpub's web site appears to be down.) 
It's excellent! It didn't go all that far, but it got across the main ideas 
very effectively.

I've been continuing to look at Specter, and the more I've learned, the 
better it's seemed. I have yet to try it myself on anything beyond toy 
examples, though. Currently I'm stumped on how to make a navigator for a 
data structure that doesn't work with 'get' and 'assoc'. There's probably 
still something elementary that I haven't understood yet. I just posted a 
question on the github site:
https://github.com/nathanmarz/specter/issues/241

--
Ben Kovitz
http://pages.iu.edu/~bkovitz/

-- 
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: ANN: Pink 0.4.0 / Score 0.4.0

2018-01-10 Thread Shaun Gilchrist
This looks like it will be a LOT of fun to play with. Also there is nothing
like waking up and finding in your inbox a project you only wished you had
the time to work on but would much rather just use! Thank you!

On Mon, Jan 8, 2018 at 1:41 PM, Steven Yi  wrote:

> Hi All,
>
> I'd like to announce the release of Pink 0.4.0 and Score 0.4.0:
>
> [kunstmusik/pink "0.4.0"]
> [kunstmusik/score "0.4.0"]
>
> Pink is an audio engine library, and Score is a library for
> higher-level music representations (e.g. notes, phrases, parts,
> scores).
>
> Change logs are available at:
>
> https://github.com/kunstmusik/pink/blob/master/CHANGELOG.md
> https://github.com/kunstmusik/score/blob/master/CHANGELOG.md
>
> Short version is that Pink has a number of new filters and effects,
> updates to minimize object allocations (e.g., Distruptor-style message
> ring buffers), and utility code for building streaming disk-based
> caches for pre-rendered ("frozen") parts. Score has new functions
> geared towards live coding (e.g., euclidean and hexadecimal beats), a
> new mini-language for notating musical lines, and number of other
> updates.
>
> Codox-generated documentation/site is now published at:
>
> http://kunstmusik.github.com/pink
> http://kunstmusik.github.com/score
>
> For any questions, please feel free to email me or post on the
> pink-users list.  For issues and PR's, please use the facilities on
> Github for each of the projects.
>
> Thanks!
> steven
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Officially support Vert.x

2018-01-10 Thread Timothy Baldridge
A few other points of design:

1) Move the requires into the `ns` form:

(ns example.simple-http-server
  (:require [io.vertx.clojure.core.core :as core]
[io.vertex.lang.clojure.vertx :as vertx]))

2) If you make sure that your functions always return the first argument
passed to them you can leverage the `->` macro:

(-> req
 request/response
 (response/put-header "content-type" "text/plain")
 (response/end "Hello from Vert.x!"))


Just some things to think over.

Timothy

On Wed, Jan 10, 2018 at 6:47 AM, Feuer Au  wrote:

> Thanks a lot
> we modify the hello code to following:
>
> (ns examples.simple-http-server)
>
> (require
>  '[io.vertx.clojure.core.core :as core]
>  '[io.vertx.lang.clojure.vertx :as vertx]
>  '[io.vertx.lang.clojure.http-server :as server]
>  '[io.vertx.lang.clojure.http-server-request :as request]
>  '[io.vertx.lang.clojure.http-server-response :as response])
>
> (defn handle-request [req]
>   (let [response (request/response req)]
> (response/put-header response "content-type" "text/plain")
> (response/end response "Hello from Vert.x!")))
>
> (defn start [vertx]
>   (let [http-server (vertx/create-http-server vertx)]
> (server/request-handler http-server (core/handler handle-request))
> (server/listen http-server 8080)))
>
>
> and we also have one problem
>
> On Wednesday, January 10, 2018 at 6:52:53 PM UTC+8, Gary Verhaegen wrote:
>>
>> It’s not clear what the "do" is supposed to mean in those defns (unless
>> there’s some deep dark magic going on, they are currently not doing
>> anything and you can just remove them), and you very likely want "let"
>> instead of "def" for the local variables.
>>
>> def in Clojure does not follow lexical scoping rules; it’s always a
>> global name.
>>
>> On 10 Jan 2018, at 10:25, Feuer Au  wrote:
>>
>> And here is the simple example "Hello from Vert.x!" like other languages
>> on the Vert.x official frontpage:
>>
>> (ns examples.simple-http-server)
>>
>> (require
>>  '[io.vertx.clojure.core.core :as core]
>>  '[io.vertx.lang.clojure.vertx :as vertx]
>>  '[io.vertx.lang.clojure.http-server :as server]
>>  '[io.vertx.lang.clojure.http-server-request :as request]
>>  '[io.vertx.lang.clojure.http-server-response :as response])
>>
>> (defn handle-request [req]
>>   do
>>   (def response (request/response req))
>>   (response/put-header response "content-type" "text/plain")
>>   (response/end response"Hello from Vert.x!"))
>>
>> (defn start [vertx]
>>   do
>>   (def http-server (vertx/create-http-server vertx))
>>   (server/request-handler http-server (core/handler handle-request))
>>   (server/listen http-server 8080))
>>
>> Pretty straight forward, but we could make it better
>> e.g. combine different namespaces into one single would be nice
>> and we got pure functions in different namespaces
>> hmmm, it looks nice.
>>
>> --
>> 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.
>



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

Re: Officially support Vert.x

2018-01-10 Thread Feuer Au
Thanks a lot
we modify the hello code to following:

(ns examples.simple-http-server)

(require
 '[io.vertx.clojure.core.core :as core]
 '[io.vertx.lang.clojure.vertx :as vertx]
 '[io.vertx.lang.clojure.http-server :as server]
 '[io.vertx.lang.clojure.http-server-request :as request]
 '[io.vertx.lang.clojure.http-server-response :as response])

(defn handle-request [req]
  (let [response (request/response req)]
(response/put-header response "content-type" "text/plain")
(response/end response "Hello from Vert.x!")))

(defn start [vertx]
  (let [http-server (vertx/create-http-server vertx)]
(server/request-handler http-server (core/handler handle-request))
(server/listen http-server 8080)))


and we also have one problem

On Wednesday, January 10, 2018 at 6:52:53 PM UTC+8, Gary Verhaegen wrote:
>
> It’s not clear what the "do" is supposed to mean in those defns (unless 
> there’s some deep dark magic going on, they are currently not doing 
> anything and you can just remove them), and you very likely want "let" 
> instead of "def" for the local variables.
>
> def in Clojure does not follow lexical scoping rules; it’s always a global 
> name.
>
> On 10 Jan 2018, at 10:25, Feuer Au  
> wrote:
>
> And here is the simple example "Hello from Vert.x!" like other languages 
> on the Vert.x official frontpage:
>
> (ns examples.simple-http-server)
>
> (require
>  '[io.vertx.clojure.core.core :as core]
>  '[io.vertx.lang.clojure.vertx :as vertx]
>  '[io.vertx.lang.clojure.http-server :as server]
>  '[io.vertx.lang.clojure.http-server-request :as request]
>  '[io.vertx.lang.clojure.http-server-response :as response])
>
> (defn handle-request [req]
>   do
>   (def response (request/response req))
>   (response/put-header response "content-type" "text/plain")
>   (response/end response"Hello from Vert.x!"))
>
> (defn start [vertx]
>   do
>   (def http-server (vertx/create-http-server vertx))
>   (server/request-handler http-server (core/handler handle-request))
>   (server/listen http-server 8080))
>
> Pretty straight forward, but we could make it better
> e.g. combine different namespaces into one single would be nice 
> and we got pure functions in different namespaces 
> hmmm, it looks nice.
>
> -- 
> 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: Officially support Vert.x

2018-01-10 Thread Gary Verhaegen
It’s not clear what the "do" is supposed to mean in those defns (unless there’s 
some deep dark magic going on, they are currently not doing anything and you 
can just remove them), and you very likely want "let" instead of "def" for the 
local variables.

def in Clojure does not follow lexical scoping rules; it’s always a global name.

> On 10 Jan 2018, at 10:25, Feuer Au  wrote:
> 
> And here is the simple example "Hello from Vert.x!" like other languages on 
> the Vert.x official frontpage:
> (ns examples.simple-http-server)
> 
> (require
>  '[io.vertx.clojure.core.core :as core]
>  '[io.vertx.lang.clojure.vertx :as vertx]
>  '[io.vertx.lang.clojure.http-server :as server]
>  '[io.vertx.lang.clojure.http-server-request :as request]
>  '[io.vertx.lang.clojure.http-server-response :as response])
> 
> (defn handle-request [req]
>   do
>   (def response (request/response req))
>   (response/put-header response "content-type" "text/plain")
>   (response/end response"Hello from Vert.x!"))
> 
> (defn start [vertx]
>   do
>   (def http-server (vertx/create-http-server vertx))
>   (server/request-handler http-server (core/handler handle-request))
>   (server/listen http-server 8080))
> Pretty straight forward, but we could make it better
> e.g. combine different namespaces into one single would be nice 
> and we got pure functions in different namespaces 
> hmmm, it looks nice.
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: Officially support Vert.x

2018-01-10 Thread Feuer Au
And here is the simple example "Hello from Vert.x!" like other languages on 
the Vert.x official frontpage:

(ns examples.simple-http-server)

(require
 '[io.vertx.clojure.core.core :as core]
 '[io.vertx.lang.clojure.vertx :as vertx]
 '[io.vertx.lang.clojure.http-server :as server]
 '[io.vertx.lang.clojure.http-server-request :as request]
 '[io.vertx.lang.clojure.http-server-response :as response])

(defn handle-request [req]
  do
  (def response (request/response req))
  (response/put-header response "content-type" "text/plain")
  (response/end response"Hello from Vert.x!"))

(defn start [vertx]
  do
  (def http-server (vertx/create-http-server vertx))
  (server/request-handler http-server (core/handler handle-request))
  (server/listen http-server 8080))

Pretty straight forward, but we could make it better
e.g. combine different namespaces into one single would be nice 
and we got pure functions in different namespaces 
hmmm, it looks nice.

-- 
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: Officially support Vert.x

2018-01-10 Thread Feuer Au
Hi Toby:

We just complete most parts of vertx-lang-clojure, here is the project 
address:
https://github.com/chengenzhao/vertx-lang-clojure
all reviews and suggestions and issues and PRs are welcomed

Cheers

On Friday, December 29, 2017 at 8:50:53 PM UTC+8, Toby Crawley wrote:
>
> The short answer is no, there is no Clojure support for Vert.x 3 that I 
> know of.
>
> The longer answer: I wrote the Clojure language module for Vert.x 2, which 
> had a pretty low usage rate, partially because core.async was released 
> around the same time. When Vert.x 3 was being written, the Vert.x team 
> asked me if I wanted to build a Clojure module for it. I declined because I 
> didn't think there was enough interest to warrant the effort, and because 
> Vert.x 3 moved to a code generation system for language modules that was 
> geared towards object-oriented languages, which would have been difficult 
> to use for generating a Clojure api.
>
> - Toby
>
>
> On Thu, Dec 28, 2017 at 10:53 PM, Feuer Au  > wrote:
>
>> Hi All,
>>
>> Curious about Vert.x is officially supported?
>>
>> We tried to use some new languages on JVM e.g. Scala, Kotlin etc.
>>
>> and be interested in using some relatively purely functional programming 
>> languages and so far Clojure is our best bet
>>
>> but unfortunately couldn't find native Clojure api on Vert.x but got 
>> official support for Kotlin
>>
>> so just wonder is there any official support for Vert.x in Clojure?
>>
>> Cheers!
>> -- 
>>
>> -- 
>> 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.