Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-11 Thread Bruno Kim Medeiros Cesar
Thanks for that link, I loved this tutorial! On Saturday, August 10, 2013 3:13:52 PM UTC-3, Jacob Goodson wrote: Here is where I started... http://www.lisperati.com/clojure-spels/casting.html I personally disagree about being so timid with macros, however, I do not code Clojure with a

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-10 Thread Mikera
On Friday, 9 August 2013 21:50:13 UTC+8, Jace Bennett wrote: Thanks again, Mike. That's really helpful. I'll take a look at the core.matrix stuff to try and understand implementation and motivation better. What games did you make? I'd love to check them out. One is Ironclad - a steampunk

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-10 Thread icamts
Try these in a REPL user= (ns-map *ns*) user= (keys (ns-map *ns*)) user= (vals (ns-map *ns*)) user= (map meta (vals (ns-map *ns*))) user= (ns proof) proof= (defn ^:my-x-comp func1 [] (prn func1 executed)) proof= (filter #(:my-x-comp (meta %)) (vals (ns-map *ns*))) proof= ((first (filter

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-10 Thread Jacob Goodson
Here is where I started... http://www.lisperati.com/clojure-spels/casting.html I personally disagree about being so timid with macros, however, I do not code Clojure with a team of other people =P. The one thing you will find about Clojure is that it slaps a limit on the types of macros you

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Mikera
On Friday, 9 August 2013 03:58:40 UTC+8, Jace Bennett wrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? Not exactly your use case, but I've written probably the two most complex games so far in Clojure... games have

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Mikera
On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Jace Bennett
Thanks again, Mike. That's really helpful. I'll take a look at the core.matrix stuff to try and understand implementation and motivation better. What games did you make? I'd love to check them out. Jace On Fri, Aug 9, 2013 at 4:10 AM, Mikera mike.r.anderson...@gmail.com wrote: On Friday, 9

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Jonathan Fischer Friberg
I agree! :) On Fri, Aug 9, 2013 at 10:10 AM, Mikera mike.r.anderson...@gmail.comwrote: On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Jace Bennett
Obviously I've encountered the advice no macros unless you know you need them before. And I even sort of know the syntax and what they do. I don't think that's my problem. I think I've lived a life without macros. I mean, clearly dynamic-functional and even OOP styles are perfectly capable of

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Andrew Stine
For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as most of the goods ones are already part of

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Lee Spector
On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread icamts
Hi Jace, this is my first answer in this group. Maybe I'm at the same point you are, except my background is in Java, so I just want to share what I understood in the hope to expand your question for the comunity. I found myself to use a lot of code generation in Java to have the glue among

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Andrew Stine
The difficulty with On Lisp when applied to Clojure is that the specific macros On Lisp demonstrates either depend on state, which Clojure avoids, or are already present in Clojure core. (if-let is a big one in my book.) Some of them also run into conflicts with Clojure implicit gensyming. I

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Jace Bennett
Thanks everyone. Good stuff. I have Let over Lambda, but I didn't glean what I wanted from it (or probably even what it wanted from me). I'll pick up On Lisp. I didn't realize it was focused on macros. Also, I think Luca has given me a clue. I used code gen techniques long before I started using

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Marcus Magnusson
I remember this talk to be very informative, I'm sure you'll find it useful: http://www.infoq.com/presentations/Clojure-Namespaces-Vars-Symbols Den lördagen den 10:e augusti 2013 kl. 00:21:02 UTC+2 skrev Jace Bennett: Out of curiousity, where do the defs go? Could one iterate over all the

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-08 Thread Mikera
I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-08 Thread Jace Bennett
Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-08 Thread Jonathan Fischer Friberg
I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.benn...@gmail.com wrote: Thanks, Mike.

Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-07 Thread Jace Bennett
Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped