On Friday, 15 November 2013 13:12:29 UTC-7, Jay Fields wrote:
>
> Better to have the ability when you desire it, than not to have it -
> if you're willing to put up with other people (ab)using that power at
> times.
>
+1, with one caveat.
If you have a rule of thumb like "introduce an abstrac
One more point that no one has emphasized: Lisps allow code to write code.
Sometimes the way to provide an abstraction or generalization of a pattern
is by writing a code-writer. Macros provide a convenient way of using that
capability.
(On a project years ago, for every Java class of kind X
The first rule of macro club is "Don't write macros."
Macros are powerful, but they should be considered the last avenue of
attack. Often macros are a slim wrapper around an API made out of
functions, and there just to provide some syntax sugar.
Libraries that use macros more extensively, like co
On Fri, Nov 15, 2013 at 3:30 PM, Brian Craft wrote:
> I've heard people doing contract work in ruby swearing when
> they encounter another DSL: it kills their productivity.
>
those same people wouldn't have Ruby contracting work if it weren't
for metaprogramming...
--
--
You received this mess
On Friday, November 15, 2013 12:10:59 PM UTC-8, Karsten Schmidt wrote:
>
> To me macros & DSLs are just an instance/extension of the DRY principle
> and not that much different to using functions (albeit with more syntactic
> freedom, e.g. by supplying a body expression to be wrapped or transfo
I've worked extensively in Java, Ruby, and Clojure, so I have plenty
of experience with having and not having meta-programming and macros.
In my opinion meta-programming and macros are not black art, they are
simply part of the language. If someone chooses to do something that
isn't easy to underst
To me macros & DSLs are just an instance/extension of the DRY principle and
not that much different to using functions (albeit with more syntactic
freedom, e.g. by supplying a body expression to be wrapped or transformed
into something more complex). Of course there's the potential loss of
control