Basic usage of namespaces

2014-12-24 Thread Eric Le Goff
While writing my first clojure application, I guess I am facing beginner
issue with namespacing :

I defined a function in a  dedicated namespace
i.e
(ns myapp.other)
(defn foo [x] (+x 42))

and try to use the foo from a different namespace


It seems
*(require 'myapp.other) ;*; is not enough to call the foo function directly


Of course,  calling it with explicit namespace preifx after the
*(require *'myapp.other)
works as expected :

*(require 'myapp.other)*

*(myapp.other/foo 10);;=>52*

I found that using *refer *you may avoid the verbose namespacing prefix

*(require 'myapp.other)*

*(refer 'myapp.other)*

*(foo 20);;=>62*

Now my newbie question :
Is there a simpler way to avoid the redundant 2 lines

*(require 'myapp.other)*
*(refer 'myapp.other)*

As simple as it seems, I was not able to find a proper documentationi which
did not describe the full details of clojure namespacing...

Thanks for your understanding
(and merry xmas)

Eric

-- 
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: Basic usage of namespaces

2014-12-24 Thread Michael Klishin
On 24 December 2014 at 12:59:11, Eric Le Goff (eleg...@gmail.com) wrote:
> Now my newbie question :
> Is there a simpler way to avoid the redundant 2 lines
> (require 'myapp.other)
> (refer 'myapp.other)

(require '[myapp.other :refer [foo]])

See  http://clojure-doc.org/articles/language/namespaces.html
--  
@michaelklishin, github.com/michaelklishin

-- 
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: How can I remove the nils in the result?

2014-12-24 Thread Adam Clements
Colin, minor code review point that makes no real difference for this
example but is a good habit to get into: try not to use last on vectors,
use peek instead, otherwise it calls seq and steps through the entire
sequence on each call. peek on the other hand does what you'd expect. For
long lists this saves you a fair bit of work!

On Wed, 24 Dec 2014 1:54 am Colin Jones  wrote:

> Thanks, I had fun with this!
>
> This isn't more concise, but I went in a little a different direction,
> trying to pull the various concerns apart. In particular I had fun
> separating:
> - the idea of intervals for which any predicate passed from the specific
> case of 0/1 equality comparison
> - the string representation of intervals from their computation
> - the idea of one-indexing from the rest of the problem
>
> https://gist.github.com/trptcolin/a573561ac9262092f254
>
> - Colin
>
> p.s. There was no need for me to use `juxt` in `format-interval` but
> honestly, if you're not going to use `juxt` at every conceivable
> opportunity, why bother?
>
>
> On Monday, December 22, 2014 10:09:06 PM UTC-6, Pauli wrote:
>>
>> Hi, all:
>>
>> I'm tring to solve such a problem: Given a string consisting of "1" and
>> "0", find all the locations of "1", and print them in the format of
>> intervals.
>>
>> For example: "00101110101110" => 3, 5-7, 9, 11-13
>>
>> Here is my solution:
>>
>> (defn bar [x]
>>   (letfn [(foo [mystr]
>> (->>
>>   (map-indexed vector mystr)
>>   (filter #(= (second %) \1))
>>   (map (comp inc first))
>>   (partition-all 2 1)
>>   (filter #(= 2 (count %)]
>> (let [y (map #(if (> (- (second %) (first %)) 1) (print (first %) ", " 
>> (second %) "-")) (foo x))]
>>   (print (ffirst y) "-" y (last (last (foo x)))
>>
>>
>> With the code above, I got many nils in the result:
>>
>> (bar "00101110101110") => 3 , 5 -nil - (nil nil 7 , 9 -nil 9 , 11 -nil
>> nil nil nil) 13
>>
>> How can I remove them?
>>
>> And, is there any way to make my code more concise?
>>
>>
>>
>>  --
> 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: [ANN] cuerdas 0.1.0: A string manipulation library for clojure and clojurescript.

2014-12-24 Thread Sean Johnson
Very nice work. I'll be using this!

Also, I agree with Noam that there's a fairly common expectation of blank? 
that started in the Ruby world.

Here's my suggestion for what it's worth:

blank? - true iff "" or nil
empty? - true iff "", false if nil
whitespace? true iff "" or only white space, false if nil

Cheers,
Sean

On Tuesday, December 23, 2014 12:48:35 PM UTC-5, Andrey Antukh wrote:
>
> Hello everybody.
>
> I wanted to announce the first release of cuerdas. A string manipulation 
> library for clojure and clojurescript.
>
> It is mainly based on underscore.string and string.js, but also influenced 
> by lodash.
>
> Documentation: http://funcool.github.io/cuerdas/latest/
> Github: https://github.com/funcool/cuerdas
>
> Cheers.
> Andrey
>
> -- 
> Andrey Antukh - Андрей Антух - > / <
> ni...@niwi.be >
> http://www.niwi.be 
> https://github.com/niwibe
>  

-- 
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: [ClojureScript] Re: [ANN] cuerdas 0.1.0: A string manipulation library for clojure and clojurescript.

2014-12-24 Thread Andrey Antukh
Hi!

Thank you very much!

You are right about nil handling, it should be documented and proper
handled.

But I'm not completely convinced with ruby behavior for that, in many other
implementations in other languages it is slightly different.

In my opinion that is more proper behavior:

blank? (nil, whitespace chars resolves to true, something else, false)
empty? (nil and "" (empty string) resolves to true, something else is false)
the purposed whitespace? is synonym of blank?

I'll document and add tests for it in next days.

Again, thanks for the feedback.

Cheers.
Andrey

2014-12-24 13:03 GMT+01:00 Sean Johnson :

> Very nice work. I'll be using this!
>
> Also, I agree with Noam that there's a fairly common expectation of blank?
> that started in the Ruby world.
>
> Here's my suggestion for what it's worth:
>
> blank? - true iff "" or nil
> empty? - true iff "", false if nil
> whitespace? true iff "" or only white space, false if nil
>
> Cheers,
> Sean
>
> On Tuesday, December 23, 2014 12:48:35 PM UTC-5, Andrey Antukh wrote:
>>
>> Hello everybody.
>>
>> I wanted to announce the first release of cuerdas. A string manipulation
>> library for clojure and clojurescript.
>>
>> It is mainly based on underscore.string and string.js, but also
>> influenced by lodash.
>>
>> Documentation: http://funcool.github.io/cuerdas/latest/
>> Github: https://github.com/funcool/cuerdas
>>
>> Cheers.
>> Andrey
>>
>> --
>> Andrey Antukh - Андрей Антух -  / > >
>> http://www.niwi.be 
>> https://github.com/niwibe
>>
>  --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>



-- 
Andrey Antukh - Андрей Антух -  / 
http://www.niwi.be 
https://github.com/niwibe

-- 
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: Basic usage of namespaces

2014-12-24 Thread Fluid Dynamics
On Wednesday, December 24, 2014 5:14:01 AM UTC-5, Michael Klishin wrote:
>
> On 24 December 2014 at 12:59:11, Eric Le Goff (ele...@gmail.com 
> ) wrote: 
> > Now my newbie question : 
> > Is there a simpler way to avoid the redundant 2 lines 
> > (require 'myapp.other) 
> > (refer 'myapp.other) 
>
> (require '[myapp.other :refer [foo]]) 
>
> See  http://clojure-doc.org/articles/language/namespaces.html 
>

You can also give it a shorter prefix:

(require '[myapp.other :as ot])

(ot/foo 42)
=> 84

-- 
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] cuerdas 0.1.0: A string manipulation library for clojure and clojurescript.

2014-12-24 Thread Max Gonzih
On Tuesday, December 23, 2014 6:48:18 PM UTC+1, Andrey Antukh wrote:
> Hello everybody.
> 
> 
> I wanted to announce the first release of cuerdas. A string manipulation 
> library for clojure and clojurescript.
> 
> 
> It is mainly based on underscore.string and string.js, but also influenced by 
> lodash.
> 
> 
> Documentation: http://funcool.github.io/cuerdas/latest/
> Github: https://github.com/funcool/cuerdas
> 
> 
> Cheers.
> Andrey
> 
> 
> -- 
> 
> 
> 
> Andrey Antukh - Андрей Антух -  / 
> http://www.niwi.be
> 
> https://github.com/niwibe

Sweet! Very helpful lib. Thank you!

-- 
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: Basic usage of namespaces

2014-12-24 Thread Ashton Kemerling
(use 'myapp.other) is the same as require with a ":refer all" from a users 
perspective, but it's fallen out of favor for :as and :referring individual 
names. 

--Ashton

Sent from my iPhone

> On Dec 24, 2014, at 7:37 AM, Fluid Dynamics  wrote:
> 
>> On Wednesday, December 24, 2014 5:14:01 AM UTC-5, Michael Klishin wrote:
>> On 24 December 2014 at 12:59:11, Eric Le Goff (ele...@gmail.com) wrote: 
>> > Now my newbie question : 
>> > Is there a simpler way to avoid the redundant 2 lines 
>> > (require 'myapp.other) 
>> > (refer 'myapp.other) 
>> 
>> (require '[myapp.other :refer [foo]]) 
>> 
>> See  http://clojure-doc.org/articles/language/namespaces.html
> 
> You can also give it a shorter prefix:
> 
> (require '[myapp.other :as ot])
> 
> (ot/foo 42)
> => 84
> 
> -- 
> 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: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-24 Thread Russell Mull
Things that aren't in cljs.test:

   - with-test
   - run-tests can take a custom environment parameter. Things that 
   required rebinding a var in clj.test are configured with an entry in the 
   environment. 
  - :reporter, instead of rebinding the report function
  - :testing-contexts instead of *testing-contexts*
  - :testing-vars instead of *testing-vars*
   
And that's it. It looks like a nearly complete port. 

- Russell




On Tuesday, December 23, 2014 1:59:45 PM UTC-8, Yehonathan Sharvit wrote:
>
> What is the gap between clojure.test and cljs.test? 
>
> For exmaple: is the `are` macro implemented in cljs.test? 
>
> On Wednesday, 17 December 2014 23:54:09 UTC+2, David Nolen  wrote: 
> > ClojureScript, the Clojure compiler that emits JavaScript source code. 
> > 
> > README and source code: https://github.com/clojure/clojurescript 
> > 
> > New release version: 0.0-2496 
> > 
> > Leiningen dependency information: 
> > 
> > [org.clojure/clojurescript "0.0-2496"] 
> > 
> > The big change in this release is a port of the clojure.test namespace 
> > - cljs.test. 
> > It is largely compatible with clojure.test and implements enough 
> > functionality such 
> > that we could port all of the existing tests to it. It's also featureful 
> enough 
> > to support a ClojureScript port of test.check that is underway. 
> > cljs.test is compatible 
> > with all of the optimization settings provided by the compiler including 
> :none. 
> > 
> > Still cljs.test may not satisfy all the patterns that people have come 
> to expect 
> > from clojure.test so feedback (and enhancement/fix patches) is very 
> welcome. 
> > 
> > On the way we implemented changes to the compiler in order to make 
> > custom testing 
> > frameworks simpler to implement - this includes compiler support for 
> > :test metadata as well 
> > as introducing static vars. 
> > 
> > ClojureScript does not have vars, however there are var patterns that 
> > are largely 
> > static in nature and useful for metaprogramming and REPL interactions. 
> Towards 
> > this end we've implemented the `var` special form and introduced very 
> restricted 
> > functionality - metadata is the primary use case. 
> > 
> > (defn foo []) 
> > (meta #'foo) ;; will return the expected metadata 
> > 
> > cljs.test is implemented on top of this functionality as well as a new 
> namespace 
> > cljs.analyzer.api which I think macro writers will find quite useful. 
> > 
> > Also there's a doc macro now in the cljs.repl namespace that works as 
> expected. 
> > Patches welcome to bring all the useful bits of clojure.repl into 
> cljs.repl. 
> > 
> > ## 0.0-2496 
> > 
> > ### Enhancements 
> > * cljs.test added, mirrors clojure.test 
> > * New cljs.analyzer.api namespace for easier access to analysis info 
> from macros 
> > * New cljs.analyzer.api namespace for easier access to analysis info 
> from macros 
> > * Support :test metadata on vars 
> > * Support static vars 
> > * cljs.source-map for client side source mapping 
> > * expose ClojureScript :warnings build option 
> > * CLJS-909: Add stable api for consumers of compiler data. 
> > 
> > ### Changes 
> > * convert all ClojureScript tests to cljs.test 
> > * add volatile! from Clojure 1.7 
> > * stateful transducers use volatile! 
> > * added `js-debugger` macro, compiles to "debugger;" 
> > * CLJS-892: Improve performance of compare-symbols/compare-keywords 
> > * CLJS-696: remove arguments usage from defrecord constructor 
> > * unroll `partial`, copy & pasted from Clojure core.clj 
> > * optimize clojure.string/join 
> > 
> > ### Fixes 
> > * fix `cljs.nodejs/enable-util-print!`, incorrectly monkey patched 
> > `cjls.core/string-print` instead of setting `cljs.core/*print-fn*` 
> > * cljs.reader bug, '/ incorrectly read 
> > * avoid emitting the same goog.require 
>
>

-- 
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: [ClojureScript] Re: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-24 Thread Yehonathan Sharvit
What about the 'are' macro?

On Wed, Dec 24, 2014 at 7:38 PM, Russell Mull 
wrote:

> Things that aren't in cljs.test:
>- with-test
>- run-tests can take a custom environment parameter. Things that 
>required rebinding a var in clj.test are configured with an entry in the 
>environment. 
>   - :reporter, instead of rebinding the report function
>   - :testing-contexts instead of *testing-contexts*
>   - :testing-vars instead of *testing-vars*
>
> And that's it. It looks like a nearly complete port. 
> - Russell
> On Tuesday, December 23, 2014 1:59:45 PM UTC-8, Yehonathan Sharvit wrote:
>>
>> What is the gap between clojure.test and cljs.test? 
>>
>> For exmaple: is the `are` macro implemented in cljs.test? 
>>
>> On Wednesday, 17 December 2014 23:54:09 UTC+2, David Nolen  wrote: 
>> > ClojureScript, the Clojure compiler that emits JavaScript source code. 
>> > 
>> > README and source code: https://github.com/clojure/clojurescript 
>> > 
>> > New release version: 0.0-2496 
>> > 
>> > Leiningen dependency information: 
>> > 
>> > [org.clojure/clojurescript "0.0-2496"] 
>> > 
>> > The big change in this release is a port of the clojure.test namespace 
>> > - cljs.test. 
>> > It is largely compatible with clojure.test and implements enough 
>> > functionality such 
>> > that we could port all of the existing tests to it. It's also featureful 
>> enough 
>> > to support a ClojureScript port of test.check that is underway. 
>> > cljs.test is compatible 
>> > with all of the optimization settings provided by the compiler including 
>> :none. 
>> > 
>> > Still cljs.test may not satisfy all the patterns that people have come 
>> to expect 
>> > from clojure.test so feedback (and enhancement/fix patches) is very 
>> welcome. 
>> > 
>> > On the way we implemented changes to the compiler in order to make 
>> > custom testing 
>> > frameworks simpler to implement - this includes compiler support for 
>> > :test metadata as well 
>> > as introducing static vars. 
>> > 
>> > ClojureScript does not have vars, however there are var patterns that 
>> > are largely 
>> > static in nature and useful for metaprogramming and REPL interactions. 
>> Towards 
>> > this end we've implemented the `var` special form and introduced very 
>> restricted 
>> > functionality - metadata is the primary use case. 
>> > 
>> > (defn foo []) 
>> > (meta #'foo) ;; will return the expected metadata 
>> > 
>> > cljs.test is implemented on top of this functionality as well as a new 
>> namespace 
>> > cljs.analyzer.api which I think macro writers will find quite useful. 
>> > 
>> > Also there's a doc macro now in the cljs.repl namespace that works as 
>> expected. 
>> > Patches welcome to bring all the useful bits of clojure.repl into 
>> cljs.repl. 
>> > 
>> > ## 0.0-2496 
>> > 
>> > ### Enhancements 
>> > * cljs.test added, mirrors clojure.test 
>> > * New cljs.analyzer.api namespace for easier access to analysis info 
>> from macros 
>> > * New cljs.analyzer.api namespace for easier access to analysis info 
>> from macros 
>> > * Support :test metadata on vars 
>> > * Support static vars 
>> > * cljs.source-map for client side source mapping 
>> > * expose ClojureScript :warnings build option 
>> > * CLJS-909: Add stable api for consumers of compiler data. 
>> > 
>> > ### Changes 
>> > * convert all ClojureScript tests to cljs.test 
>> > * add volatile! from Clojure 1.7 
>> > * stateful transducers use volatile! 
>> > * added `js-debugger` macro, compiles to "debugger;" 
>> > * CLJS-892: Improve performance of compare-symbols/compare-keywords 
>> > * CLJS-696: remove arguments usage from defrecord constructor 
>> > * unroll `partial`, copy & pasted from Clojure core.clj 
>> > * optimize clojure.string/join 
>> > 
>> > ### Fixes 
>> > * fix `cljs.nodejs/enable-util-print!`, incorrectly monkey patched 
>> > `cjls.core/string-print` instead of setting `cljs.core/*print-fn*` 
>> > * cljs.reader bug, '/ incorrectly read 
>> > * avoid emitting the same goog.require 
>>
>>
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "ClojureScript" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojurescript/gnCl0CySSk8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

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

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-24 Thread Russell Mull
Yes, it's there. The things I listed are the only differences I could find.
The separation of macros makes it a little confusing, but it's pretty easy
to find in the source:

 -
https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/test.cljs
 -
https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/test.clj

Russell


On Wed, Dec 24, 2014 at 10:13 AM, Yehonathan Sharvit 
wrote:

> What about the 'are' macro?
>
>
>
> On Wed, Dec 24, 2014 at 7:38 PM, Russell Mull 
> wrote:
>
>>   Things that aren't in cljs.test:
>>
>>- with-test
>>- run-tests can take a custom environment parameter. Things that
>>required rebinding a var in clj.test are configured with an entry in the
>>environment.
>>   - :reporter, instead of rebinding the report function
>>   - :testing-contexts instead of *testing-contexts*
>>   - :testing-vars instead of *testing-vars*
>>
>> And that's it. It looks like a nearly complete port.
>>
>> - Russell
>>
>>
>>
>>
>> On Tuesday, December 23, 2014 1:59:45 PM UTC-8, Yehonathan Sharvit wrote:
>>>
>>> What is the gap between clojure.test and cljs.test?
>>>
>>> For exmaple: is the `are` macro implemented in cljs.test?
>>>
>>> On Wednesday, 17 December 2014 23:54:09 UTC+2, David Nolen  wrote:
>>> > ClojureScript, the Clojure compiler that emits JavaScript source code.
>>> >
>>> > README and source code: https://github.com/clojure/clojurescript
>>> >
>>> > New release version: 0.0-2496
>>> >
>>> > Leiningen dependency information:
>>> >
>>> > [org.clojure/clojurescript "0.0-2496"]
>>> >
>>> > The big change in this release is a port of the clojure.test namespace
>>> > - cljs.test.
>>> > It is largely compatible with clojure.test and implements enough
>>> > functionality such
>>> > that we could port all of the existing tests to it. It's also
>>> featureful enough
>>> > to support a ClojureScript port of test.check that is underway.
>>> > cljs.test is compatible
>>> > with all of the optimization settings provided by the compiler
>>> including :none.
>>> >
>>> > Still cljs.test may not satisfy all the patterns that people have come
>>> to expect
>>> > from clojure.test so feedback (and enhancement/fix patches) is very
>>> welcome.
>>> >
>>> > On the way we implemented changes to the compiler in order to make
>>> > custom testing
>>> > frameworks simpler to implement - this includes compiler support for
>>> > :test metadata as well
>>> > as introducing static vars.
>>> >
>>> > ClojureScript does not have vars, however there are var patterns that
>>> > are largely
>>> > static in nature and useful for metaprogramming and REPL interactions.
>>> Towards
>>> > this end we've implemented the `var` special form and introduced very
>>> restricted
>>> > functionality - metadata is the primary use case.
>>> >
>>> > (defn foo [])
>>> > (meta #'foo) ;; will return the expected metadata
>>> >
>>> > cljs.test is implemented on top of this functionality as well as a new
>>> namespace
>>> > cljs.analyzer.api which I think macro writers will find quite useful.
>>> >
>>> > Also there's a doc macro now in the cljs.repl namespace that works as
>>> expected.
>>> > Patches welcome to bring all the useful bits of clojure.repl into
>>> cljs.repl.
>>> >
>>> > ## 0.0-2496
>>> >
>>> > ### Enhancements
>>> > * cljs.test added, mirrors clojure.test
>>> > * New cljs.analyzer.api namespace for easier access to analysis info
>>> from macros
>>> > * New cljs.analyzer.api namespace for easier access to analysis info
>>> from macros
>>> > * Support :test metadata on vars
>>> > * Support static vars
>>> > * cljs.source-map for client side source mapping
>>> > * expose ClojureScript :warnings build option
>>> > * CLJS-909: Add stable api for consumers of compiler data.
>>> >
>>> > ### Changes
>>> > * convert all ClojureScript tests to cljs.test
>>> > * add volatile! from Clojure 1.7
>>> > * stateful transducers use volatile!
>>> > * added `js-debugger` macro, compiles to "debugger;"
>>> > * CLJS-892: Improve performance of compare-symbols/compare-keywords
>>> > * CLJS-696: remove arguments usage from defrecord constructor
>>> > * unroll `partial`, copy & pasted from Clojure core.clj
>>> > * optimize clojure.string/join
>>> >
>>> > ### Fixes
>>> > * fix `cljs.nodejs/enable-util-print!`, incorrectly monkey patched
>>> > `cjls.core/string-print` instead of setting `cljs.core/*print-fn*`
>>> > * cljs.reader bug, '/ incorrectly read
>>> > * avoid emitting the same goog.require
>>>
>>>  --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "ClojureScript" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/clojurescript/gnCl0CySSk8/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> clojurescript+unsubscr...@googlegroups.com.
>> To post to this group, send email to clojurescr...@google

Re: [ClojureScript] Re: [ANN] cuerdas 0.1.0: A string manipulation library for clojure and clojurescript.

2014-12-24 Thread Erik Price
Note that there is precedent for this in clojure.string/blank?
.
​

On Wed, Dec 24, 2014 at 7:58 AM, Andrey Antukh  wrote:

> Hi!
>
> Thank you very much!
>
> You are right about nil handling, it should be documented and proper
> handled.
>
> But I'm not completely convinced with ruby behavior for that, in many
> other implementations in other languages it is slightly different.
>
> In my opinion that is more proper behavior:
>
> blank? (nil, whitespace chars resolves to true, something else, false)
> empty? (nil and "" (empty string) resolves to true, something else is
> false)
> the purposed whitespace? is synonym of blank?
>
> I'll document and add tests for it in next days.
>
> Again, thanks for the feedback.
>
> Cheers.
> Andrey
>
> 2014-12-24 13:03 GMT+01:00 Sean Johnson :
>
>> Very nice work. I'll be using this!
>>
>> Also, I agree with Noam that there's a fairly common expectation of
>> blank? that started in the Ruby world.
>>
>> Here's my suggestion for what it's worth:
>>
>> blank? - true iff "" or nil
>> empty? - true iff "", false if nil
>> whitespace? true iff "" or only white space, false if nil
>>
>> Cheers,
>> Sean
>>
>> On Tuesday, December 23, 2014 12:48:35 PM UTC-5, Andrey Antukh wrote:
>>>
>>> Hello everybody.
>>>
>>> I wanted to announce the first release of cuerdas. A string manipulation
>>> library for clojure and clojurescript.
>>>
>>> It is mainly based on underscore.string and string.js, but also
>>> influenced by lodash.
>>>
>>> Documentation: http://funcool.github.io/cuerdas/latest/
>>> Github: https://github.com/funcool/cuerdas
>>>
>>> Cheers.
>>> Andrey
>>>
>>> --
>>> Andrey Antukh - Андрей Антух -  / <
>>> ni...@niwi.be>
>>> http://www.niwi.be 
>>> https://github.com/niwibe
>>>
>>  --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojurescript+unsubscr...@googlegroups.com.
>> To post to this group, send email to clojurescr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/clojurescript.
>>
>
>
>
> --
> Andrey Antukh - Андрей Антух -  / <
> n...@niwi.be>
> http://www.niwi.be 
> https://github.com/niwibe
>
> --
> 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: [lein] compile sass?

2014-12-24 Thread Torsten Uhlmann
I haven't really tried chestnut's sass support.
It has an option to create a template application that reads and transforms
sass: https://github.com/plexus/chestnut

Hope that helps,
Torsten.

2014-12-24 0:42 GMT+01:00 Ashton Kemerling :

> Your best bet is probably to ask for the lein-haml-sass plugin to be
> updated with the latest and greatest. A simple update is no reason for a
> fork or rewrite unless if the plugin is simply missing features you need
> (and that can't be added).
>
> --Ashton
>
> Sent from my iPhone
>
> On Dec 23, 2014, at 4:41 PM, stephanos  wrote:
>
> Hey there,
>
> I would love to use the SASS library bourbon.io for my project. Is there
> any way I can use leiningen to compile the scss files to css?
>
> PS: I tried *lein-haml-sass* but there is no bundled version of the sass
> gem after 3.2.x and bourbon requires at least 3.3.
>
>
> Stephan
>
> --
> 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.
>



-- 
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone: +49 3721 273445
Fax: +49 3721 273446
Mobile: +49 151 12412427
Web:http://www.agynamix.de
Author of "Lift Web Applications How-To
"

-- 
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: [lein] compile sass?

2014-12-24 Thread Dom from (paren)
Take a look at Optimus  for asset
compilation, concatenation, minification, etc. If it looks like it would
work well for your use case, then check out optimus-sass
, an asset loader that I wrote for
Optimus. It comes bundled with the Sass gem and allows you to load .sass
and .scss files through Optimus in the same way that you would load .css
files. I use it to compile Bourbon, among other things.

On Wed, Dec 24, 2014 at 11:13 AM, Torsten Uhlmann 
wrote:

> I haven't really tried chestnut's sass support.
> It has an option to create a template application that reads and
> transforms sass: https://github.com/plexus/chestnut
>
> Hope that helps,
> Torsten.
>
> 2014-12-24 0:42 GMT+01:00 Ashton Kemerling :
>
>> Your best bet is probably to ask for the lein-haml-sass plugin to be
>> updated with the latest and greatest. A simple update is no reason for a
>> fork or rewrite unless if the plugin is simply missing features you need
>> (and that can't be added).
>>
>> --Ashton
>>
>> Sent from my iPhone
>>
>> On Dec 23, 2014, at 4:41 PM, stephanos  wrote:
>>
>> Hey there,
>>
>> I would love to use the SASS library bourbon.io for my project. Is there
>> any way I can use leiningen to compile the scss files to css?
>>
>> PS: I tried *lein-haml-sass* but there is no bundled version of the sass
>> gem after 3.2.x and bourbon requires at least 3.3.
>>
>>
>> Stephan
>>
>> --
>> 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.
>>
>
>
>
> --
> AGYNAMIX(R). Passionate Software.
> Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
> Phone: +49 3721 273445
> Fax: +49 3721 273446
> Mobile: +49 151 12412427
> Web:http://www.agynamix.de
> Author of "Lift Web Applications How-To
> "
>
> --
> 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.