Re: Mixing syntax-rule and indentifier-syntax

2012-01-18 Thread Andy Wingo
On Wed 18 Jan 2012 00:26, Tobias Brandt writes: >> 0. I'm sure there is another way, but my mind blanks at the moment > > After you got me started, I was able to simplify and generalize it a bit. > (-> is a GOOPS generic accessor I defined elsewhere. It works with > vectors, arrays, strings, etc

Re: Mixing syntax-rule and indentifier-syntax

2012-01-17 Thread Tobias Brandt
> 0. I'm sure there is another way, but my mind blanks at the moment After you got me started, I was able to simplify and generalize it a bit. (-> is a GOOPS generic accessor I defined elsewhere. It works with vectors, arrays, strings, etc ...) (define-syntax with-accessors  (lambda (stx)    (synt

Re: Mixing syntax-rule and indentifier-syntax

2012-01-17 Thread Ian Price
Tobias Brandt writes: > Hi, > > is it possible to define a macro that does one thing when > it's in operator position and another when it's not? It depends what you mean by that. If you mean operator-position/set! position/ variable position, then that is id-syntax. If you mean something like (d

Re: Mixing syntax-rule and indentifier-syntax

2012-01-17 Thread Andy Wingo
On Tue 17 Jan 2012 00:11, Tobias Brandt writes: > I want to define a macro `with-vectors` that transforms this: > > (with-vectors (v) > (v 0) > (set! (v 0) 'foo) > (some-procedure v)) We currently don't have good support in the expander for variable transformers that take arguments.

Mixing syntax-rule and indentifier-syntax

2012-01-16 Thread Tobias Brandt
Hi, is it possible to define a macro that does one thing when it's in operator position and another when it's not? I want to define a macro `with-vectors` that transforms this: (with-vectors (v) (v 0) (set! (v 0) 'foo) (some-procedure v)) into this: (begin (vector-ref v 0)