Re: Confusing interplay between macros and metadata

2011-11-09 Thread Tassilo Horn
"Marshall T. Vandegrift" writes: Hi Marshall, >> I'm facing the same issue. I have this macro for java interop: >> >> (defmacro with-traversal-context >> [[g tc] & body] >> `(let [old-tc# (.getTraversalContext ^Graph ~g)] >> (try >>(.setTraversalContext ^Graph ~g ^TraversalCont

Re: Confusing interplay between macros and metadata

2011-11-09 Thread Marshall T. Vandegrift
Tassilo Horn writes: > I'm facing the same issue. I have this macro for java interop: > > (defmacro with-traversal-context > [[g tc] & body] > `(let [old-tc# (.getTraversalContext ^Graph ~g)] > (try >(.setTraversalContext ^Graph ~g ^TraversalContext ~tc) >~@body >

Re: Confusing interplay between macros and metadata

2011-11-08 Thread Tassilo Horn
Alan Malloy writes: Hi Alan, > I want to typehint the return value of f, so I put metadata on the > form representing a call to it. But if a macro gets involved, there's > an "intervening" form that ignores its metadata and returns a new list > of '(f 10) with no metadata. Thus the compiler has

Re: Confusing interplay between macros and metadata

2011-10-26 Thread Alan Malloy
On Oct 25, 2:27 am, "Marshall T. Vandegrift" wrote: > Alan Malloy writes: > > It seems to me that it would be nice to have macros automatically > > include, on their result forms, the metadata from their input > > &form. Of course, macros may wish to add metadata as well, so the two > > maps shou

Re: Confusing interplay between macros and metadata

2011-10-25 Thread Marshall T. Vandegrift
Alan Malloy writes: > It seems to me that it would be nice to have macros automatically > include, on their result forms, the metadata from their input > &form. Of course, macros may wish to add metadata as well, so the two > maps should probably be merged. However, there are certainly some > pro

Re: Confusing interplay between macros and metadata

2011-10-24 Thread Alan Malloy
That would be relevant if I were talking about losing metadata on arguments to the macro, say like (call .length ^String (identity "test")). But I'm talking about metadata on &form - syntax-quote never sees that at all, so there's nothing for it to lose. On Oct 24, 12:50 pm, Kevin Downey wrote: >

Re: Confusing interplay between macros and metadata

2011-10-24 Thread Kevin Downey
syntax quote effectively does that it, it rewrites your forms as a series of calls to various sequence functions like concat and in the shuffling it loses metadata. On Mon, Oct 24, 2011 at 12:43 PM, Alan Malloy wrote: > I'm not sure I buy that. If I write my macro as (defmacro call [f arg] > (lis

Re: Confusing interplay between macros and metadata

2011-10-24 Thread Alan Malloy
I'm not sure I buy that. If I write my macro as (defmacro call [f arg] (list f arg)), which I did consider doing for this post, the same thing happens. Perhaps you could explain what you mean? On Oct 24, 12:37 pm, Kevin Downey wrote: > it's not a macro issue, it's a syntax quote issue > > > > > >

Re: Confusing interplay between macros and metadata

2011-10-24 Thread Kevin Downey
it's not a macro issue, it's a syntax quote issue On Mon, Oct 24, 2011 at 11:54 AM, Alan Malloy wrote: > I'm struggling with a basic feature of how macros behave. I understand > how the > problem arises, and I can cobble together my own fix in the specific > places > where it's causing me trouble

Confusing interplay between macros and metadata

2011-10-24 Thread Alan Malloy
I'm struggling with a basic feature of how macros behave. I understand how the problem arises, and I can cobble together my own fix in the specific places where it's causing me trouble, but it seems like a prettier, more general solution would be desirable. Below is a brief transcript demonstrating