Hi,

I want to get source location of a macro form and played a little with
syntax-source.
This should then print out something.

(define-syntax <+>
  (lambda (x)
    (syntax-case x ()
      ((o a b)
       (pk (syntax-source x))
       #'(+ a b)))))

(<+> 1 2)


In trying to use the location of x resulted in the  toplevel form location
and not the <+> form in a more complex example.
and using  #'o or #'a or #'b in stead of x on syntax-source form will lead
to pk prints out #f.

So the question is if it is possible to get a more exact location
information of the (<+> 1 2)
and in that case how?

Anyway a brief discussion how source and meta information is transported in
the guile macro framework would be
interesting.

Regards
Stefan

Reply via email to