How do you get source file information out of a syntax object?

Also, I am guessing from how you worded your response that the
solution you have in mind is a procedure. Is it actually syntax that
acts like a first class procedure?

On Thu, Apr 30, 2009 at 1:28 PM, Abdulaziz Ghuloum <[email protected]> wrote:
>
> On Apr 30, 2009, at 1:11 AM, Ramana Kumar wrote:
>
>> Actually if I'm going to be defining my own macro, I usually just do
>> (define-syntax carn (syntax-rules () ((_ n e) (let ((p e)) (if (pair?
>> p) (car p) (error 'n "not a pair" p))))))
>> and pass an identifier to carn... and then I can get rid of the check
>> by adding another line to the macro... but it doesn't look as nice as
>> just using car
>
> This doesn't show the file position; your carn does not work like
> the first-class car; and it requires two subforms while car takes
> one argument.  The solution I have in mind does all of that.
>
> Aziz,,,
>

Reply via email to