Re: clojure, not the go to for data science

2015-04-08 Thread Christopher Small
Made some updates to http://clojure-datascience.herokuapp.com/. In 
particular, went with the tagline "Resources for the budding Clojure Data 
Scientist." Couldn't come up with anything else sufficiently punny and 
appropriate.

Again; please contribute! I'll be starting a list in the about page 
mentioning everyone who's contributed.

Chris


On Tuesday, April 7, 2015 at 8:24:27 PM UTC-7, Emrehan Tüzün wrote:
>
> Clojure isn't the first tool coming into mind on data science at the 
> moment but the number of useful libraries are growing up. You can check out 
> https://github.com/razum2um/awesome-clojure#science-and-data-analysis.

-- 
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] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Alex Miller
Thanks! I like that metric.

On Wednesday, April 8, 2015 at 1:07:46 PM UTC-5, Mike Haney wrote:
>
> Yeah, I noticed my mistake after I posted.  I regularly use the kindle app 
> and iBooks and I forgot how they represent page numbers differently. 
>
> So I'll use a different, more appropriate metric - AIDKT's (Ah, I didn't 
> know that).  About 30% of the way through the book, and I'm registering 3-4 
> AIDKT's per chapter.  Good stuff.

-- 
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: Generating .clj files with content

2015-04-08 Thread Sven Richter
Hi,

@Tassilo Thank you. Your example works nicely the way I imagined it.

However, I want to generate human readable code and I want line breaks and 
nice formatting and things. I will also try a templating language. 
lein-template uses moustache or something. I will see how that works out.

Thanks everyone for your suggestions,
Sven

Am Mittwoch, 8. April 2015 19:25:23 UTC+2 schrieb James Reeves:
>
> On 8 April 2015 at 14:20, Sven Richter  > wrote:
>>
>> I want to create clojure source files with some code and a namespace and 
>> everything else what is useful for some source code.
>> What I am looking for is a templating language for clojure code, is there 
>> something like this already? What would be the most idiomatic way to do 
>> that besides just writing strings into a file?
>>
>
> What's the purpose? If it's just to generate some Clojure code that will 
> never be read by a human, then you can use Clojure's backtick syntax with 
> the pr-str function. If it's to generate human-readable code, then you're 
> probably best using a text templating language.
>
> You may also want to look at Leiningen templates or lein-generate.
>
> - James
>

-- 
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] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Mike Haney
Yeah, I noticed my mistake after I posted.  I regularly use the kindle app and 
iBooks and I forgot how they represent page numbers differently.

So I'll use a different, more appropriate metric - AIDKT's (Ah, I didn't know 
that).  About 30% of the way through the book, and I'm registering 3-4 AIDKT's 
per chapter.  Good stuff.

-- 
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: Generating .clj files with content

2015-04-08 Thread John Wiseman
Since I'm not sure what your purpose is, I'll also mention yasnippet for
emacs, which is a general-purpose template system for generating pieces of
text, but there are sets of clojure templates like
https://github.com/swannodette/clojure-snippets

Basically you create a file in the right place that looks like this:

#name: ns
# --
(ns `(clojure-expected-ns)`
  "$0"
  (:require [])
  (:import ()))

(set! *warn-on-reflection* true)


And then when you type "n s TAB" you get something like this, with the
point inside the empty docstring:

(ns com.lemondronor.orbital-detector.airportdata
  ""
  (:require [])
  (:import ()))

(set! *warn-on-reflection* true)


John


On Wed, Apr 8, 2015 at 10:54 AM, Michael Blume  wrote:

> What James said -- if you want the results to be human readable, if you
> want control of how it's formatted, if you want to be able to comment it,
> if you want people to use it as a starting point for code they're going to
> write, then check out the punctions in
> https://github.com/technomancy/leiningen/blob/master/src/leiningen/new/templates.clj
> -- if not, pr-str will do you fine.
>
> On Wed, Apr 8, 2015 at 10:25 AM James Reeves 
> wrote:
>
>> On 8 April 2015 at 14:20, Sven Richter  wrote:
>>>
>>> I want to create clojure source files with some code and a namespace and
>>> everything else what is useful for some source code.
>>> What I am looking for is a templating language for clojure code, is
>>> there something like this already? What would be the most idiomatic way to
>>> do that besides just writing strings into a file?
>>>
>>
>> What's the purpose? If it's just to generate some Clojure code that will
>> never be read by a human, then you can use Clojure's backtick syntax with
>> the pr-str function. If it's to generate human-readable code, then you're
>> probably best using a text templating language.
>>
>> You may also want to look at Leiningen templates or lein-generate.
>>
>> - James
>>
>> --
>> 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.
>

-- 
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: Generating .clj files with content

2015-04-08 Thread Michael Blume
What James said -- if you want the results to be human readable, if you
want control of how it's formatted, if you want to be able to comment it,
if you want people to use it as a starting point for code they're going to
write, then check out the punctions in
https://github.com/technomancy/leiningen/blob/master/src/leiningen/new/templates.clj
-- if not, pr-str will do you fine.

On Wed, Apr 8, 2015 at 10:25 AM James Reeves  wrote:

> On 8 April 2015 at 14:20, Sven Richter  wrote:
>>
>> I want to create clojure source files with some code and a namespace and
>> everything else what is useful for some source code.
>> What I am looking for is a templating language for clojure code, is there
>> something like this already? What would be the most idiomatic way to do
>> that besides just writing strings into a file?
>>
>
> What's the purpose? If it's just to generate some Clojure code that will
> never be read by a human, then you can use Clojure's backtick syntax with
> the pr-str function. If it's to generate human-readable code, then you're
> probably best using a text templating language.
>
> You may also want to look at Leiningen templates or lein-generate.
>
> - James
>
> --
> 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: Generating .clj files with content

2015-04-08 Thread James Reeves
On 8 April 2015 at 14:20, Sven Richter  wrote:
>
> I want to create clojure source files with some code and a namespace and
> everything else what is useful for some source code.
> What I am looking for is a templating language for clojure code, is there
> something like this already? What would be the most idiomatic way to do
> that besides just writing strings into a file?
>

What's the purpose? If it's just to generate some Clojure code that will
never be read by a human, then you can use Clojure's backtick syntax with
the pr-str function. If it's to generate human-readable code, then you're
probably best using a text templating language.

You may also want to look at Leiningen templates or lein-generate.

- James

-- 
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] Lisp source code formatter for Emacs in any major mode (including fundamental-mode)

2015-04-08 Thread Tu Do
A few days ago I announced a new released of Srefactor with only a 
rudimentary support for Lisp code formatting. Now it is quite complete and 
can format a 10k Lisp source file fine in around 10 seconds, with 
significant time spending on indentation rather than code rearrangement. 

Homepage: https://github.com/tuhdo/semantic-refactor. 

Some demos: 

- Formatting whole buffer in Clojure: http://i.imgur.com/puTmYJL.gif 
- Formatting whole buffer demo in Emacs Lisp: http://i.imgur.com/BNWSL7W.gif
 
- Transform between one line <--> Multiline: http://i.imgur.com/L8D5tXv.gif 

Available Commands: 

- srefactor-lisp-format-buffer: format whole buffer 
- srefactor-lisp-format-defun: format current defun cursor is in 
- srefactor-lisp-one-line: turn the current sexp of the same level into one 
line; with prefix argument, recursively turn all inner sexps into one line. 
- srefactor-lisp-format-sexp: format the current sexp cursor is in. 

The formatting commands are usable on Common Lisp and Scheme as well. With 
such formatting tool like this, it would be useful when you try to read 
your Emacas Lisp backtrace (which is just one-line unformatted code), other 
than writing code. 

If there is any problem, please submit an issue report and I will be happy 
to fix it. 

-- 
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: video 'clojure for lisp programmers' won't play on youtube.

2015-04-08 Thread henry w
Thanks! I'll try that.
On 8 Apr 2015 16:53, "Eli Naeher"  wrote:

> I ran into this problem last year and was able to watch it successfully by
> using the youtube-dl tool (http://rg3.github.io/youtube-dl/) to download
> the video (and I then had no problems playing it locally).
>
> -Eli
>
> On Wed, Apr 8, 2015 at 10:31 AM, henry w  wrote:
>
>> I just checked the comments and it has been this way for quite some time.
>>
>> Does anyone know if it can be found elsewhere?
>>
>> i found old links to bliptv but it has been taken down from there.
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/BG7MPDZvxag/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: Anyone Worked with NW.js and ClojureScript

2015-04-08 Thread kovas boguta
FWIW its also possible to embed JVM Clojure within atom shell or nw via
https://github.com/joeferner/node-java, and then script the web component
entirely from Clojure, though its not trivial to set up.


On Tue, Apr 7, 2015 at 6:41 AM, JPatrick Davenport 
wrote:

> Hello,
> I recently started looking at a project that's all about being offline. I
> thought about using Java + Clojure + JavaFX as my implementation path, but
> I fear that there's a security backlash against client side Java these
> days. Mulling it over, I thought, "wouldn't it be terrifying to use some
> sort of shelled web project using ClojureScript to implement the
> application?"
>
> To that end, has anyone done anything like that? I couldn't find a plugin
> for lein to build the shell app.
>
> Thanks,
> JPD
>
> --
> 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: Generating .clj files with content

2015-04-08 Thread Phillip Lord
Tassilo Horn  writes:
> Using qualified names (like clojure.core/ns) is perfectly fine except if
> a human is going to read the code.  But you can force unqualified
> symbols by using ~'sym.  And you can create a symbol from a string with
> the function `symbol`.


You might want to take a look at the backtick library

https://github.com/brandonbloom/backtick

It provides a syntax-quoting without namespace qualification (or with
it, at your option), which is nicer than putting ~'sym everywhere.

Phil

-- 
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: video 'clojure for lisp programmers' won't play on youtube.

2015-04-08 Thread Eli Naeher
I ran into this problem last year and was able to watch it successfully by
using the youtube-dl tool (http://rg3.github.io/youtube-dl/) to download
the video (and I then had no problems playing it locally).

-Eli

On Wed, Apr 8, 2015 at 10:31 AM, henry w  wrote:

> I just checked the comments and it has been this way for quite some time.
>
> Does anyone know if it can be found elsewhere?
>
> i found old links to bliptv but it has been taken down from there.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


video 'clojure for lisp programmers' won't play on youtube.

2015-04-08 Thread henry w
I just checked the comments and it has been this way for quite some time.

Does anyone know if it can be found elsewhere? 

i found old links to bliptv but it has been taken down from there.

Thanks

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


Re: [ANN] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Alex Miller
I'm not sure what unit of "page" you're seeing on your device, but there 
are ~160 PDF pages in the beta and we expect to add maybe 60 more pages 
before completion. Pragmatic adheres to a fairly regular beta schedule of a 
new chapter every 2-3 weeks, so all content should be available within a 
couple months. Thanks for reading!

Alex


On Wednesday, April 8, 2015 at 10:00:32 AM UTC-5, Mike Haney wrote:
>
> I've been waiting for this since the Conj, and so far it has been worth 
> the wait. 
>
> One thing that impressed me right off the bat was the amount of content - 
> 300 pages in this beta version.  A pleasant surprise considering the recent 
> trend of "early access" books that only have 2-3 chapters completed (and 
> often times just the introductory info at that).

-- 
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: Generating .clj files with content

2015-04-08 Thread Tassilo Horn
Sven Richter  writes:

Hi Sven,

> What you are saying makes sense. I am always a bit shy to using macros
> as I have not understood them completely yet and everytime I tried I
> got distracted fast enough to not get it.

Syntax-quoting has not much to do with macros except that the latter
frequently use the former.

> So I just played a bit with it and I am failing already on the
> generation of the namespace.
>
> I have this function:
>
> (defn generate-ns [ns]
> (let [ns `(ns ~ns (:require [foo.bar :as bar]))]
> (clojure.pprint/pprint ns)))
>
> And calling it like this: (generate-ns "foons") will return this:
> (clojure.core/ns
> "foons"
> (:require [foo.bar :as leiningen.code-generator/bar]))
>
> However, what I need is this:
> (ns ;only ns here
> foons ; a symbol
> (:require [foo.bar :as bar])) ; only bar

Using qualified names (like clojure.core/ns) is perfectly fine except if
a human is going to read the code.  But you can force unqualified
symbols by using ~'sym.  And you can create a symbol from a string with
the function `symbol`.

So this function does what you want:

--8<---cut here---start->8---
(defn generate-ns [ns]
  (let [ns `(~'ns ~(symbol ns) (:require [foo.bar :as ~'bar]))]
(clojure.pprint/pprint ns)))

(generate-ns "foons")
;(ns foons (:require [foo.bar :as bar]))
;=> nil
--8<---cut here---end--->8---

Bye,
Tassilo

-- 
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] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Mike Haney
I've been waiting for this since the Conj, and so far it has been worth the 
wait.

One thing that impressed me right off the bat was the amount of content - 300 
pages in this beta version.  A pleasant surprise considering the recent trend 
of "early access" books that only have 2-3 chapters completed (and often times 
just the introductory info at that).

-- 
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] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Colin Yates
Well done- just purchased and looking forward to read this tonight.

Sent from my iPhone

> On 8 Apr 2015, at 14:27, Alex Miller  wrote:
> 
> Hey all,
> 
> I'm very happy to announce that Clojure Applied is now available in beta:
> 
> https://pragprog.com/book/vmclojeco/clojure-applied
> 
> I've been working on this with Ben Vandgrift for a long time, hoping to fill 
> the underserved niche of intermediate Clojure material. Our goal is to step 
> in after you've read any of the fine introductory books and provide the next 
> level of guidance needed to successfully apply Clojure to real problems.
> 
> The chapters are:
> 
> 1. Model Your Domain - an overview of modeling domain entities, modeling 
> relationships, validating them, and creating domain operations.
> 2. Collect And Organize Your Data - choosing the right collection, updating 
> collections, accessing collections, and building custom collections.
> 3. Processing Sequential Data - using sequence functions and transducers to 
> transform your data.
> 4. State, Identity, and Change - modeling change and state with Clojure's 
> state constructs.
> 5. Use Your Cores - waiting in the background, queues and workers, 
> parallelism with reducers, and thinking in processes with core.async.
> 6. Creating Components - organizing your code with namespaces, designing 
> component APIs, connecting components with core.async channels, and 
> implementing components with state.
> 7. Compose Your Application - assembling components, configuration, and entry 
> points.
> 8. Testing Clojure - example- and property-based testing with clojure.test, 
> expectations, and test.check. 
> 9. Playing With Others - details TBD
> 10. Getting Out The Door - publishing your code and deploying your 
> application.
> 
> Chapters 1-6 and 10 are available now in beta form. We expect to release a 
> new chapter every 2-3 weeks until completion. The printed book should be 
> available this fall.
> 
> Alex
> -- 
> 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: Generating .clj files with content

2015-04-08 Thread Sven Richter
Hi Tassilo,

What you are saying makes sense. I am always a bit shy to using macros as I 
have not understood them completely yet and everytime I tried I got 
distracted fast enough to not get it.

So I just played a bit with it and I am failing already on the generation 
of the namespace.
I have this function:

(defn generate-ns [ns]
  (let [ns `(ns ~ns (:require [foo.bar :as bar]))]
(clojure.pprint/pprint ns)))

And calling it like this: (generate-ns "foons") will return this:
(clojure.core/ns
 "foons"
 (:require [foo.bar :as leiningen.code-generator/bar]))

However, what I need is this:
(ns;only ns here
 foons ; a symbol
 (:require [foo.bar :as bar])) ; only bar

It seems like these are basics, still I struggle to get it right. 

Any help is appreciated, thanks, 
Sven

Am Mittwoch, 8. April 2015 15:50:13 UTC+2 schrieb Tassilo Horn:
>
> Sven Richter > writes: 
>
> Hi Sven, 
>
> > I want to create clojure source files with some code and a namespace 
> > and everything else what is useful for some source code.  What I am 
> > looking for is a templating language for clojure code, is there 
> > something like this already? 
>
> The templating language for all lisps is syntax-quote with unquote and 
> unquote-splicing, isn't it? 
>
> So I'd write functions which create the contents of the to-be generated 
> source files as data structures, i.e., a function definition is a list 
> whose first element in the symbol clojure.core/defn etc, and then print 
> these data structures into a file, e.g., using clojure.pprint. 
>
> Bye, 
> Tassilo 
>

-- 
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: Generating .clj files with content

2015-04-08 Thread Tassilo Horn
Sven Richter  writes:

Hi Sven,

> I want to create clojure source files with some code and a namespace
> and everything else what is useful for some source code.  What I am
> looking for is a templating language for clojure code, is there
> something like this already?

The templating language for all lisps is syntax-quote with unquote and
unquote-splicing, isn't it?

So I'd write functions which create the contents of the to-be generated
source files as data structures, i.e., a function definition is a list
whose first element in the symbol clojure.core/defn etc, and then print
these data structures into a file, e.g., using clojure.pprint.

Bye,
Tassilo

-- 
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] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Nando Breiter
Thanks Alex (and Ben)! I rushed off to buy it, and look forward to cracking
it open this evening. It looks like exactly the type of material I've been
looking for.





Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

On Wed, Apr 8, 2015 at 3:27 PM, Alex Miller  wrote:

> Hey all,
>
> I'm very happy to announce that Clojure Applied is now available in beta:
>
> https://pragprog.com/book/vmclojeco/clojure-applied
>
> I've been working on this with Ben Vandgrift for a long time, hoping to
> fill the underserved niche of *intermediate* Clojure material. Our goal
> is to step in after you've read any of the fine introductory books and
> provide the next level of guidance needed to successfully apply Clojure to
> real problems.
>
> The chapters are:
>
> 1. Model Your Domain - an overview of modeling domain entities, modeling
> relationships, validating them, and creating domain operations.
> 2. Collect And Organize Your Data - choosing the right collection,
> updating collections, accessing collections, and building custom
> collections.
> 3. Processing Sequential Data - using sequence functions and transducers
> to transform your data.
> 4. State, Identity, and Change - modeling change and state with Clojure's
> state constructs.
> 5. Use Your Cores - waiting in the background, queues and workers,
> parallelism with reducers, and thinking in processes with core.async.
> 6. Creating Components - organizing your code with namespaces, designing
> component APIs, connecting components with core.async channels, and
> implementing components with state.
> 7. Compose Your Application - assembling components, configuration, and
> entry points.
> 8. Testing Clojure - example- and property-based testing with
> clojure.test, expectations, and test.check.
> 9. Playing With Others - details TBD
> 10. Getting Out The Door - publishing your code and deploying your
> application.
>
> Chapters 1-6 and 10 are available now in beta form. We expect to release a
> new chapter every 2-3 weeks until completion. The printed book should be
> available this fall.
>
> Alex
>
> --
> 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.


[ANN] Clojure Applied: From Practice to Practitioner

2015-04-08 Thread Alex Miller
Hey all,

I'm very happy to announce that Clojure Applied is now available in beta:

https://pragprog.com/book/vmclojeco/clojure-applied

I've been working on this with Ben Vandgrift for a long time, hoping to
fill the underserved niche of *intermediate* Clojure material. Our goal is
to step in after you've read any of the fine introductory books and provide
the next level of guidance needed to successfully apply Clojure to real
problems.

The chapters are:

1. Model Your Domain - an overview of modeling domain entities, modeling
relationships, validating them, and creating domain operations.
2. Collect And Organize Your Data - choosing the right collection, updating
collections, accessing collections, and building custom collections.
3. Processing Sequential Data - using sequence functions and transducers to
transform your data.
4. State, Identity, and Change - modeling change and state with Clojure's
state constructs.
5. Use Your Cores - waiting in the background, queues and workers,
parallelism with reducers, and thinking in processes with core.async.
6. Creating Components - organizing your code with namespaces, designing
component APIs, connecting components with core.async channels, and
implementing components with state.
7. Compose Your Application - assembling components, configuration, and
entry points.
8. Testing Clojure - example- and property-based testing with clojure.test,
expectations, and test.check.
9. Playing With Others - details TBD
10. Getting Out The Door - publishing your code and deploying your
application.

Chapters 1-6 and 10 are available now in beta form. We expect to release a
new chapter every 2-3 weeks until completion. The printed book should be
available this fall.

Alex

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


Generating .clj files with content

2015-04-08 Thread Sven Richter
Hi,

I want to create clojure source files with some code and a namespace and 
everything else what is useful for some source code.
What I am looking for is a templating language for clojure code, is there 
something like this already? What would be the most idiomatic way to do 
that besides just writing strings into a file?

Best Regards,
Sven

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