> "Be explicit and minimalist about dependencies on other packages. > (Prefer the :only option to use and require)."
> The page was last edited on Mar 29, 2011 and ns usage has been > discussed a fair bit since then... this leads to the question:
> Is the item quoted above still the standard for Clojure Libraries?
> Thanks.
> -David
> -- > 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>> "Be explicit and minimalist about dependencies on other packages.
>> (Prefer the :only option to use and require)."
>> The page was last edited on Mar 29, 2011 and ns usage has been discussed
>> a fair bit since then... this leads to the question:
>> Is the item quoted above still the standard for Clojure Libraries?
>> Thanks.
>> -David
>> --
>> 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+unsubscribe@**googlegroups.com<clojure%2Bunsubscribe@googlegroups.c om>
>> For more options, visit this group at
>> http://groups.google.com/**group/clojure?hl=en<http://groups.google.com/group/clojure?hl=en>
> --
> 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+unsubscribe@**googlegroups.com<clojure%2Bunsubscribe@googlegroups.c om>
> For more options, visit this group at
> http://groups.google.com/**group/clojure?hl=en<http://groups.google.com/group/clojure?hl=en>
I am pragmatic and quite lazy, I use require with an alias and use mostly with stuff like
clojure.tools.trace, clojure.pprint where selecting explicit vars brings
no or little value (in my opinion).
You either need most of the public vars or the potential name conflict is a remote
possibility a few light-years away.
I almost never select explicit vars from external name spaces. I find this cumbersome to manage.
With (short) aliases, I get auto expansion of all public vars as soon as I type the /
in CCW (Eclipse plugin). With a little consistency in choosing aliases,
it's then very easy to find out while reading the code where a reference comes from.
I am also older than most of you guys so the less stuff resides in my working memory,
the easier I can cheat with the slowly eroding aging process :)
I leave most of the work to the computer.
Mmmh, maybe I should create a pocket guide for elderly Clojure coders someday...
> > "Be explicit and minimalist about dependencies on other packages. > > (Prefer the :only option to use and require)."
> > The page was last edited on Mar 29, 2011 and ns usage has been discussed a > > fair bit since then... this leads to the question:
> > Is the item quoted above still the standard for Clojure Libraries?
> > Thanks.
> > -David
> -- > 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
On Thursday, November 8, 2012 1:42:26 PM UTC-5, Luc wrote:
> I am pragmatic and quite lazy, I use require with an alias and use mostly > with stuff like > clojure.tools.trace, clojure.pprint where selecting explicit vars brings > no or little value (in my opinion). > You either need most of the public vars or the potential name conflict is > a remote > possibility a few light-years away.
> I almost never select explicit vars from external name spaces. I find this > cumbersome to manage.
> With (short) aliases, I get auto expansion of all public vars as soon as I > type the / > in CCW (Eclipse plugin). With a little consistency in choosing aliases, > it's then very easy to find out while reading the code where a reference > comes from.
> I am also older than most of you guys so the less stuff resides in my > working memory, > the easier I can cheat with the slowly eroding aging process :) > I leave most of the work to the computer.
> Mmmh, maybe I should create a pocket guide for elderly Clojure coders > someday...
> Luc P.
> > Current best practice in my view:
> > For Clojure 1.4+, do not use :use at all. Use :require :refer > > (judiciously). :refer :all is almost never a good idea.
> > For Clojure 1.3 and below, :use :only is strongly encouraged. Bare :use > is > > almost never good.
> > Justin
> > On Thursday, November 8, 2012 11:57:21 AM UTC-5, David McNeil wrote:
> > > "Be explicit and minimalist about dependencies on other packages. > > > (Prefer the :only option to use and require)."
> > > The page was last edited on Mar 29, 2011 and ns usage has been > discussed a > > > fair bit since then... this leads to the question:
> > > Is the item quoted above still the standard for Clojure Libraries?
> > > Thanks. > > > -David
> > -- > > 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<javascript:> > > 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 <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/clojure?hl=en > -- > Softaddicts<lprefo...@softaddicts.ca <javascript:>> sent by ibisMail from > my ipad!
Use is still a short way of including mundane stuff like tools.trace and a few
others. We leave :use .... clojure.tools.trace in place in namespaces once we have done it.
Doing it in the REPL each time we need it while debugging is tedious.
Oh, I must say that I rarely use the Eclipse debugger. Tracing does most of the job.
Removing use would force us to redefine it somehow.
And yes I know how to use a debugger, even non-symbolic ones :)
> Am Donnerstag, 8. November 2012 19:42:26 UTC+1 schrieb Luc:
> > I am pragmatic and quite lazy, I use require with an alias
> inc
> An explicit call to use every now and then on the REPL, but no :use in ns.
> IMHO use and :use can be removed from the language.
> -- > 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> :require :as is always good and generally preferred over :refer or :use
:only. I think we all agree with this, but in reality :use with/without :only is very widely used in a number of real project I've seen on github. :use (especially without :only) makes code reading painful and usually reading time including other's is much longer than writing time. I hope :use is used only for popular library such as clojure.test, etc.
On Friday, November 9, 2012 3:54:38 AM UTC+9, Justin Kramer wrote:
> Sorry, yes, to clarify -- :require :as is always good and generally > preferred over :refer or :use :only.
> Justin
> On Thursday, November 8, 2012 1:42:26 PM UTC-5, Luc wrote:
>> I am pragmatic and quite lazy, I use require with an alias and use mostly >> with stuff like >> clojure.tools.trace, clojure.pprint where selecting explicit vars brings >> no or little value (in my opinion). >> You either need most of the public vars or the potential name conflict is >> a remote >> possibility a few light-years away.
>> I almost never select explicit vars from external name spaces. I find >> this cumbersome to manage.
>> With (short) aliases, I get auto expansion of all public vars as soon as >> I type the / >> in CCW (Eclipse plugin). With a little consistency in choosing aliases, >> it's then very easy to find out while reading the code where a reference >> comes from.
>> I am also older than most of you guys so the less stuff resides in my >> working memory, >> the easier I can cheat with the slowly eroding aging process :) >> I leave most of the work to the computer.
>> Mmmh, maybe I should create a pocket guide for elderly Clojure coders >> someday...
>> Luc P.
>> > Current best practice in my view:
>> > For Clojure 1.4+, do not use :use at all. Use :require :refer >> > (judiciously). :refer :all is almost never a good idea.
>> > For Clojure 1.3 and below, :use :only is strongly encouraged. Bare :use >> is >> > almost never good.
>> > Justin
>> > On Thursday, November 8, 2012 11:57:21 AM UTC-5, David McNeil wrote:
>> > > "Be explicit and minimalist about dependencies on other packages. >> > > (Prefer the :only option to use and require)."
>> > > The page was last edited on Mar 29, 2011 and ns usage has been >> discussed a >> > > fair bit since then... this leads to the question:
>> > > Is the item quoted above still the standard for Clojure Libraries?
>> > > Thanks. >> > > -David
>> > -- >> > 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 >> -- >> Softaddicts<lprefo...@softaddicts.ca> sent by ibisMail from my ipad!
On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <lprefonta...@softaddicts.ca> wrote:
> Oh, I must say that I rarely use the Eclipse debugger. Tracing does most of the job.
> Removing use would force us to redefine it somehow.
(:use clojure.tools.trace) => (:require [clojure.tools.trace :refer :all)
-- Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <lprefonta...@softaddicts.ca> wrote:
>> Removing use would force us to redefine it somehow.
> (:use clojure.tools.trace) => (:require [clojure.tools.trace :refer :all)
*sigh* no paredit in Gmail and I haven't had my coffee yet:
> On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <seancorfi...@gmail.com> wrote:
> > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <lprefonta...@softaddicts.ca> wrote:
> >> Removing use would force us to redefine it somehow.
> > (:use clojure.tools.trace) => (:require [clojure.tools.trace :refer :all)
> *sigh* no paredit in Gmail and I haven't had my coffee yet:
> but I'm sure y'all knew what I meant.
> -- > Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/ > World Singles, LLC. -- http://worldsingles.com/
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
> -- > 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> Yep but still longer to type :) we are in the process of shrinking the
> code base,
> nit expanding it, any bytes count :))
> > On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <seancorfi...@gmail.com>
> wrote:
> > > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <
> lprefonta...@softaddicts.ca> wrote:
> > >> Removing use would force us to redefine it somehow.
> > > (:use clojure.tools.trace) => (:require [clojure.tools.trace :refer
> :all)
> > *sigh* no paredit in Gmail and I haven't had my coffee yet:
> > but I'm sure y'all knew what I meant.
> > --
> > Sean A Corfield -- (904) 302-SEAN
> > An Architect's View -- http://corfield.org/ > > World Singles, LLC. -- http://worldsingles.com/
> > "Perfection is the enemy of the good."
> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > --
> > 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> --
> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> How do you avoid repeating this ? A clojure macro?, IDE support?, ... ?
> On Fri, Nov 9, 2012 at 7:07 PM, Softaddicts <lprefonta...@softaddicts.ca>wrote:
>> Yep but still longer to type :) we are in the process of shrinking the
>> code base,
>> nit expanding it, any bytes count :))
>> > On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <seancorfi...@gmail.com>
>> wrote:
>> > > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <
>> lprefonta...@softaddicts.ca> wrote:
>> > >> Removing use would force us to redefine it somehow.
>> > > (:use clojure.tools.trace) => (:require [clojure.tools.trace :refer
>> :all)
>> > *sigh* no paredit in Gmail and I haven't had my coffee yet:
>> > but I'm sure y'all knew what I meant.
>> > --
>> > Sean A Corfield -- (904) 302-SEAN
>> > An Architect's View -- http://corfield.org/ >> > World Singles, LLC. -- http://worldsingles.com/
>> > "Perfection is the enemy of the good."
>> > -- Gustave Flaubert, French realist novelist (1821-1880)
>> > --
>> > 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+unsubscribe@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/clojure?hl=en
>> --
>> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
>> --
>> 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> > How do you avoid repeating this ? A clojure macro?, IDE support?, ... ?
> > On Fri, Nov 9, 2012 at 7:07 PM, Softaddicts <lprefonta...@softaddicts.ca>wrote:
> >> Yep but still longer to type :) we are in the process of shrinking the
> >> code base,
> >> nit expanding it, any bytes count :))
> >> > On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <seancorfi...@gmail.com>
> >> wrote:
> >> > > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <
> >> lprefonta...@softaddicts.ca> wrote:
> >> > >> Removing use would force us to redefine it somehow.
> >> > > (:use clojure.tools.trace) => (:require [clojure.tools.trace :refer
> >> :all)
> >> > *sigh* no paredit in Gmail and I haven't had my coffee yet:
> >> > but I'm sure y'all knew what I meant.
> >> > --
> >> > Sean A Corfield -- (904) 302-SEAN
> >> > An Architect's View -- http://corfield.org/ > >> > World Singles, LLC. -- http://worldsingles.com/
> >> > "Perfection is the enemy of the good."
> >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> >> > --
> >> > 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+unsubscribe@googlegroups.com
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/clojure?hl=en
> >> --
> >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> >> --
> >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> > >> > but I'm sure y'all knew what I meant.
> > >> > --
> > >> > Sean A Corfield -- (904) 302-SEAN
> > >> > An Architect's View -- http://corfield.org/ > > >> > World Singles, LLC. -- http://worldsingles.com/
> > >> > "Perfection is the enemy of the good."
> > >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > >> > --
> > >> > 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+unsubscribe@googlegroups.com
> > >> > For more options, visit this group at
> > >> > http://groups.google.com/group/clojure?hl=en
> > >> --
> > >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my
> ipad!
> > >> --
> > >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en > --
> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
On Sun, Nov 11, 2012 at 6:02 AM, Softaddicts <lprefonta...@softaddicts.ca>wrote:
> How does that shrink his boilerplate ?
> Why such a long boilerplate ? Do you need the string library everywhere ?
> Why not drop :only ?
oftentimes, I am at the REPL, and I know this particular function in
clojure.set (or clojure,io, or ...) is exactly what I need
I want it at my fingertips, I don't want to break my flow and `require` it.
And when creating a new namespace, I don't know in advance what other
namespaces I will need.
That's why I always paste the same boilerplate when creating a new
namespace.
In Java land, all IDEs have shortcut to import classes at the time it's
needed, maybe that's what I need (in Emacs in my case).
> > >> > but I'm sure y'all knew what I meant.
> > >> > --
> > >> > Sean A Corfield -- (904) 302-SEAN
> > >> > An Architect's View -- http://corfield.org/ > > >> > World Singles, LLC. -- http://worldsingles.com/
> > >> > "Perfection is the enemy of the good."
> > >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > >> > --
> > >> > 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+unsubscribe@googlegroups.com
> > >> > For more options, visit this group at
> > >> > http://groups.google.com/group/clojure?hl=en
> > >> --
> > >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my
> ipad!
> > >> --
> > >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en > --
> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
I just find this puzzling, the "coding standards" emphasizes reducing dependencies.
Now if you add dependencies in your boiler plate that may in fact not be used by the source code
in the current name space, how can a human reader understand your dependencies by reading the top nth lines of your source file ?
This will worsen as your boiler plate expands.
Why not require a utility name space (:use [my-boilerplate]) with a single public uniquely named macro
(zxcv or any adjacent keys on your keyboard that you find easy to type)
to get all that stuff on your behalf in the REPL ?
Include this systematically and just type (zxcv) at the REPL. If you want to avoid the typing while in dev mode,
add (zxcv) in the source code after the (ns) macro. It will require all the other things you need until you are done
with it. No need to type it in the REPL anymore.
Later on you can add the real dependencies in the ns macro. That can be the last step after your dev is done.
It should sum up to a few requires with aliases. The zxcv is still available (requiring twice the same name space
with the same alias has no bad effects) when you go back later at the REPL.
I maintain that once you require a name space, is entirely loaded so the explicit narrowing of function used
looks to me an overkill. Especially if you have an alias in your require call. There's no possible confusion with
an alias and calls are can easily be searched as text strings which all IDEs support.
Denis Labaye <denis.lab...@gmail.com> wrote:
> On Sun, Nov 11, 2012 at 6:02 AM, Softaddicts
> <lprefonta...@softaddicts.ca>wrote:
> > How does that shrink his boilerplate ?
> > Why such a long boilerplate ? Do you need the string library
> > everywhere ? Why not drop :only ?
> oftentimes, I am at the REPL, and I know this particular function in
> clojure.set (or clojure,io, or ...) is exactly what I need
> I want it at my fingertips, I don't want to break my flow and
> `require` it.
> And when creating a new namespace, I don't know in advance what other
> namespaces I will need.
> That's why I always paste the same boilerplate when creating a new
> namespace.
> In Java land, all IDEs have shortcut to import classes at the time
> it's needed, maybe that's what I need (in Emacs in my case).
> > > >> > but I'm sure y'all knew what I meant.
> > > >> > --
> > > >> > Sean A Corfield -- (904) 302-SEAN
> > > >> > An Architect's View -- http://corfield.org/ > > > >> > World Singles, LLC. -- http://worldsingles.com/
> > > >> > "Perfection is the enemy of the good."
> > > >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > > >> > --
> > > >> > 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+unsubscribe@googlegroups.com
> > > >> > For more options, visit this group at
> > > >> > http://groups.google.com/group/clojure?hl=en
> > > >> --
> > > >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from
> > > >> my
> > ipad!
> > > >> --
> > > >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> > > For more options, visit this group at
> > > http://groups.google.com/group/clojure?hl=en > > --
> > Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my
> > ipad!
> > --
> > 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> I just find this puzzling, the "coding standards" emphasizes reducing dependencies.
> Now if you add dependencies in your boiler plate that may in fact not be used by the source code
> in the current name space, how can a human reader understand your dependencies by reading the top nth lines of your source file ?
> This will worsen as your boiler plate expands.
> Why not require a utility name space (:use [my-boilerplate]) with a single public uniquely named macro
> (zxcv or any adjacent keys on your keyboard that you find easy to type)
> to get all that stuff on your behalf in the REPL ?
> Include this systematically and just type (zxcv) at the REPL. If you want to avoid the typing while in dev mode,
> add (zxcv) in the source code after the (ns) macro. It will require all the other things you need until you are done
> with it. No need to type it in the REPL anymore.
> Later on you can add the real dependencies in the ns macro. That can be the last step after your dev is done.
> It should sum up to a few requires with aliases. The zxcv is still available (requiring twice the same name space
> with the same alias has no bad effects) when you go back later at the REPL.
> I maintain that once you require a name space, is entirely loaded so the explicit narrowing of function used
> looks to me an overkill. Especially if you have an alias in your require call. There's no possible confusion with
> an alias and calls are can easily be searched as text strings which all IDEs support.
> Luc P.
> On Sun, 11 Nov 2012 20:44:24 +0100
> Denis Labaye <denis.lab...@gmail.com> wrote:
> > On Sun, Nov 11, 2012 at 6:02 AM, Softaddicts
> > <lprefonta...@softaddicts.ca>wrote:
> > > How does that shrink his boilerplate ?
> > > Why such a long boilerplate ? Do you need the string library
> > > everywhere ? Why not drop :only ?
> > oftentimes, I am at the REPL, and I know this particular function in
> > clojure.set (or clojure,io, or ...) is exactly what I need
> > I want it at my fingertips, I don't want to break my flow and
> > `require` it.
> > And when creating a new namespace, I don't know in advance what other
> > namespaces I will need.
> > That's why I always paste the same boilerplate when creating a new
> > namespace.
> > In Java land, all IDEs have shortcut to import classes at the time
> > it's needed, maybe that's what I need (in Emacs in my case).
> > > > > How do you avoid repeating this ? A clojure macro?, IDE
> > > > > support?, ... ?
> > > > > On Fri, Nov 9, 2012 at 7:07 PM, Softaddicts <
> > > lprefonta...@softaddicts.ca>wrote:
> > > > >> Yep but still longer to type :) we are in the process of
> > > > >> shrinking the code base,
> > > > >> nit expanding it, any bytes count :))
> > > > >> > On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <
> > > seancorfi...@gmail.com>
> > > > >> wrote:
> > > > >> > > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <
> > > > >> lprefonta...@softaddicts.ca> wrote:
> > > > >> > >> Removing use would force us to redefine it somehow.
> > > > >> > > (:use clojure.tools.trace) => (:require
> > > > >> > > [clojure.tools.trace
> > > :refer
> > > > >> :all)
> > > > >> > *sigh* no paredit in Gmail and I haven't had my coffee yet:
> > > > >> > but I'm sure y'all knew what I meant.
> > > > >> > --
> > > > >> > Sean A Corfield -- (904) 302-SEAN
> > > > >> > An Architect's View -- http://corfield.org/ > > > > >> > World Singles, LLC. -- http://worldsingles.com/
> > > > >> > "Perfection is the enemy of the good."
> > > > >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > > > >> > --
> > > > >> > 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+unsubscribe@googlegroups.com
> > > > >> > For more options, visit this group at
> > > > >> > http://groups.google.com/group/clojure?hl=en
> > > > >> --
> > > > >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from
> > > > >> my
> > > ipad!
> > > > >> --
> > > > >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> > > > For more options, visit this group at
> > > > http://groups.google.com/group/clojure?hl=en > > > --
> > > Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my
> > > ipad!
> > > --
> > > 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+unsubscribe@googlegroups.com
> > > For more options, visit this group at
> > > http://groups.google.com/group/clojure?hl=en
> -- > Luc P.
> ================
> The rabid Muppet
> -- > 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
On Sun, Nov 11, 2012 at 10:56 PM, Softaddicts
<lprefonta...@softaddicts.ca>wrote:
> Since you use emacs, why not create a key binding to an expression that
> would get
> evaluated in the REPL ? or to eval the zxcv macro ?
> Luc P.
Luc,
Yes, the solutions you described (Clojure utility macro, or Emacs key
binding) are possible solutions to my "problem", but I was asking, because
I thought I wasn't the only one to have this "issue".
> > I just find this puzzling, the "coding standards" emphasizes reducing
> dependencies.
> > Now if you add dependencies in your boiler plate that may in fact not be
> used by the source code
> > in the current name space, how can a human reader understand your
> dependencies by reading the top nth lines of your source file ?
> > This will worsen as your boiler plate expands.
> > Why not require a utility name space (:use [my-boilerplate]) with a
> single public uniquely named macro
> > (zxcv or any adjacent keys on your keyboard that you find easy to type)
> > to get all that stuff on your behalf in the REPL ?
> > Include this systematically and just type (zxcv) at the REPL. If you
> want to avoid the typing while in dev mode,
> > add (zxcv) in the source code after the (ns) macro. It will require all
> the other things you need until you are done
> > with it. No need to type it in the REPL anymore.
> > Later on you can add the real dependencies in the ns macro. That can be
> the last step after your dev is done.
> > It should sum up to a few requires with aliases. The zxcv is still
> available (requiring twice the same name space
> > with the same alias has no bad effects) when you go back later at the
> REPL.
> > I maintain that once you require a name space, is entirely loaded so the
> explicit narrowing of function used
> > looks to me an overkill. Especially if you have an alias in your require
> call. There's no possible confusion with
> > an alias and calls are can easily be searched as text strings which all
> IDEs support.
> > Luc P.
> > On Sun, 11 Nov 2012 20:44:24 +0100
> > Denis Labaye <denis.lab...@gmail.com> wrote:
> > > On Sun, Nov 11, 2012 at 6:02 AM, Softaddicts
> > > <lprefonta...@softaddicts.ca>wrote:
> > > > How does that shrink his boilerplate ?
> > > > Why such a long boilerplate ? Do you need the string library
> > > > everywhere ? Why not drop :only ?
> > > oftentimes, I am at the REPL, and I know this particular function in
> > > clojure.set (or clojure,io, or ...) is exactly what I need
> > > I want it at my fingertips, I don't want to break my flow and
> > > `require` it.
> > > And when creating a new namespace, I don't know in advance what other
> > > namespaces I will need.
> > > That's why I always paste the same boilerplate when creating a new
> > > namespace.
> > > In Java land, all IDEs have shortcut to import classes at the time
> > > it's needed, maybe that's what I need (in Emacs in my case).
> > > > > > How do you avoid repeating this ? A clojure macro?, IDE
> > > > > > support?, ... ?
> > > > > > On Fri, Nov 9, 2012 at 7:07 PM, Softaddicts <
> > > > lprefonta...@softaddicts.ca>wrote:
> > > > > >> Yep but still longer to type :) we are in the process of
> > > > > >> shrinking the code base,
> > > > > >> nit expanding it, any bytes count :))
> > > > > >> > On Fri, Nov 9, 2012 at 8:28 AM, Sean Corfield <
> > > > seancorfi...@gmail.com>
> > > > > >> wrote:
> > > > > >> > > On Thu, Nov 8, 2012 at 3:19 PM, Softaddicts <
> > > > > >> lprefonta...@softaddicts.ca> wrote:
> > > > > >> > >> Removing use would force us to redefine it somehow.
> > > > > >> > > (:use clojure.tools.trace) => (:require
> > > > > >> > > [clojure.tools.trace
> > > > :refer
> > > > > >> :all)
> > > > > >> > *sigh* no paredit in Gmail and I haven't had my coffee yet:
> > > > > >> > but I'm sure y'all knew what I meant.
> > > > > >> > --
> > > > > >> > Sean A Corfield -- (904) 302-SEAN
> > > > > >> > An Architect's View -- http://corfield.org/ > > > > > >> > World Singles, LLC. -- http://worldsingles.com/
> > > > > >> > "Perfection is the enemy of the good."
> > > > > >> > -- Gustave Flaubert, French realist novelist (1821-1880)
> > > > > >> > --
> > > > > >> > 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+unsubscribe@googlegroups.com
> > > > > >> > For more options, visit this group at
> > > > > >> > http://groups.google.com/group/clojure?hl=en
> > > > > >> --
> > > > > >> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from
> > > > > >> my
> > > > ipad!
> > > > > >> --
> > > > > >> 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+unsubscribe@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 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+unsubscribe@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 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+unsubscribe@googlegroups.com
> > > > > For more options, visit this group at
> > > > > http://groups.google.com/group/clojure?hl=en > > > > --
> > > > Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my
> > > > ipad!
> > > > --
> > > > 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+unsubscribe@googlegroups.com
> > > > For more options, visit this group at
> > > > http://groups.google.com/group/clojure?hl=en
> > --
> > Luc P.
> > ================
> > The rabid Muppet
> > --
> > 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> --
> Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!
> --
> You received this message because you are subscribed to the Google
I can relate to Denis' issue. I find it pretty common to have a common set
of dependencies across every file in a project. Copying and pasting this
header to every file and updating changes manually across every file
doesn't feel like a very robust solution. This is something that has
bothered me as well.
> Mmmh, maybe I should create a pocket guide for elderly Clojure coders someday...
An aside: I'm giving a keynote at the ACCU conference titled "Cheating Decline: Acting now to let you program well for a really long time" I'll be looking for people who can share (general purpose tricks of the aging trade). Contact me if interested.
-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
Writing /Functional Programming for the Object-Oriented Programmer/: https://leanpub.com/fp-oo
(ns higiebus.services.aqueduct
"Implement sinks and risers as abstractions on top of concrete transports."
(:require [higiebus.adaptors.socket :as sock] [higiebus.services.queuemgr :as q])
(:use [higiebus.services.depcy-profiles]))
(basic-service-deps)
There is a bit of information loss but if the dependency profiles are correctly defined
it's probably bearable and not to numerous. I am juggling with the idea of using this in our code base.
Especially when using some service portfolios, we have to spell a litany of dependencies.
Now, how far should I go with this requires some thinking. I can probably represent profiles
as data and add some functions to report what they are made of, provide a single fn
to load profiles by name, allowing to compound them, ...
I'll play with this in the next couple of days.
Luc
On Sun, 11 Nov 2012 14:26:03 -0800
Mark Engelberg <mark.engelb...@gmail.com> wrote:
> I can relate to Denis' issue. I find it pretty common to have a
> common set of dependencies across every file in a project. Copying
> and pasting this header to every file and updating changes manually
> across every file doesn't feel like a very robust solution. This is
> something that has bothered me as well.
<mark.engelb...@gmail.com> wrote:
> I can relate to Denis' issue. I find it pretty common to have a common set
> of dependencies across every file in a project.
Well, I have to say I was puzzled by Denis' post because I definitely
don't have common dependencies across every file. Now hearing you say
the same thing I'm doubly puzzled...
I don't like to have anything imported that I'm not explicitly using
(and I regularly double-check after refactoring to make sure I remove
any redundant imports). Preferences aside, however, I'm genuinely
curious as to the sort of program structure that has the same
dependencies in every namespace. I can see how some of Denis' imports
are useful for the repl - but I tend to just import them as needed or
write them out in full (clojure.pprint/pprint is my most common one) -
but I'm a bit surprised to see set, string, xml, sh and io all being
that common (in every file).
Denis, Mark, could you speak to what sort of things you're using these
for that make it convenient to have them in every namespace?
I tend to have I/O isolated to one or two namespaces, the same goes
for shell operations, and XML operations. Maybe we're working in
different enough fields that our use cases are very different (I
suspect that's true for Mark - not sure what area Denis works in?).
-- Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)