Re: Need help to understand a macro

2010-03-19 Thread Andreas Rottmann
Andy Wingo writes: > Hi, > > On Fri 19 Mar 2010 09:57, Josef Wolf writes: > >> (show-expansion (defstruct tree height girth age leaf-shape leaf-color)) > > (macroexpand '(defstruct ...)) > > You might want to surround that with (pretty-print ...) from (ice-9 > pretty-print). > >> Of course this

Re: Need help to understand a macro

2010-03-19 Thread Andy Wingo
Hi, On Fri 19 Mar 2010 09:57, Josef Wolf writes: > (show-expansion (defstruct tree height girth age leaf-shape leaf-color)) (macroexpand '(defstruct ...)) You might want to surround that with (pretty-print ...) from (ice-9 pretty-print). > Of course this is possible. After all, code is data

Re: Need help to understand a macro

2010-03-19 Thread Ken Raeburn
On Mar 19, 2010, at 04:57, Josef Wolf wrote: > My next question is more related to the defstruct macro. > In line 11, defstruct stores the default initializers into the vv vector: > > (if (pair? f) (cadr f) '(if #f #f))) > > So if the field is a pair, the initializer is stored in vv. That's eas

Need help to understand a macro

2010-03-19 Thread Josef Wolf
Hello, I am trying to understand the defstruct macro from the "teach yourself scheme in fixnum days" tutorial, which can be found in chapter 9 at http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-11.html#node_chap_9 My first question is of a more generic type. For a better understanding