define-sobj
define/  sobj
sobj
8.12

define-sobj🔗ℹ

Sorawee Porncharoenwase <sorawee.pwase@gmail.com>

 (require define-sobj) package: define-sobj

This library provides a macro define/sobj, which is similar to define, but it has an access to syntax objects for the function call, via the variable sobj. In return, the function must be used in the first-order fashion.

syntax

(define/sobj function-header body ...+)

Examples:
> (define/sobj (test x)
    (list x sobj))
> (test 42)

'(42 #<syntax:eval:3:0 (test 42)>)

> (test 7)

'(7 #<syntax:eval:4:0 (test 7)>)

syntax

sobj

Recognized specially within forms like define/sobj. A sobj form out of context is a syntax error.