*** premature send ***

Ya know, I've never seen that before but I like it!

I have previously noticed (by accident) that you can have "naked"
expressions in a file/namespace (i.e. not inside of a def/defn).  For
example, I use a statement like this:

(ns ...
  (:require [tupelo.core :refer [spyx]] ...
(spyx *clojure-version*)


at the top of my main testing namespace tst.tupelo.core to get:

*clojure-version* => {:major 1, :minor 8, :incremental 0, :qualifier
"alpha4"}


printed at the top of every test run.  Another favorite is:

(ns ...

  (:require [schema.core :as s] ...

; Prismatic Schema type definitions
(s/set-fn-validation! true)


to control Prismatic Schema in each namespace.

I have also used other naked expressions (in both test and regular
files/namespaces) as a kind of free-form scratchpad when experimenting with
new code (since I can type so much faster in the editor than the repl).

Thanks for the suggestion,
Alan


On Tue, Aug 25, 2015 at 2:19 PM, Alan Thompson <clooj...@gmail.com> wrote:

> Ya know, I've never seen that before but I like it!
>
> I have noticed that you can have "naked" expressions in a file (i.e. not
> inside of a def/defn).  For example, I use a statement like this:
>
> (require '[tupelo.core :refer [spyx]])
> (spyx *clojure-version*)
>
> at the top of my main testing namespace tst.tupelo.core to get:
>
> *clojure-version* => {:major 1, :minor 8, :incremental 0, :qualifier
> "alpha4"}
>
> printed
>
>
> Alan
>
> On Tue, Aug 25, 2015 at 12:06 AM, Kurt Sys <kurt....@gmail.com> wrote:
>
>> I'm refering to a few posts in an old thread:
>> https://groups.google.com/d/msg/clojure/r_ym-h53f1E/RzUdb5oYeX4J
>>
>> What really puzzles me is that it doesn't seem to be generally
>>> regarded as idiomatic Clojure style to just use top-level (let)s for
>>> your "private" globals.
>>
>>
>> So, here's the question: what's considered best practice in Clojure (what
>> is idiomatic in Clojure): using private (namespace-scoped) globals
>> variables or one big let over all (or at least, most) defns in a namespace?
>> And why :)?
>>
>> --
>> 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.

Reply via email to