8.16.0.1
Sorts the fully expanded definitions and expressions in
stxs
topologically such that definitions occur before corresponding references. The
sort is stable, meaning that where possible the elements are left in the same
order as they occur in
stxs. When
cycles-ok? is
#true, mutually recursive definitions are kept in their original order
with respect to each other. When
cycles-ok? is
#false,
sort-kernel-syntax reports an error if
stxs contains mutually
recursive definitions.
Example:
|
'(#<syntax:eval:1:0 (define-values (flatten/append) (#%plain-lambda (x tail) (if (#%plain-app empty? x) tail (if (#%plain-app cons? x) (#%plain-app flatten/append (#%plain-app first x) (#%plain-app flatten/append (#%plain-app rest x) tail)) (#%plain-app cons x tail)))))> #<syntax:eval:1:0 (define-values (flatten) (#%plain-lambda (x) (#%plain-app flatten/append x (quote ()))))> #<syntax:eval:1:0 (#%plain-app flatten (#%plain-app list 2 (#%plain-app list 2 3) 4))>) |
Returns the list of unique names defined by the fully expanded expression or
definition
stx. If
among is a list, the result is restricted
to names that are
free-identifier=? to elements of
among.
Examples:
|
'(#<syntax:eval:2:0 flatten>) |
|
'() |
|
'() |
Returns the list of unique names referred to by the fully expanded expression
or definition
stx, not including built-in special forms or names
defined by or locally bound within
stx. If
among is a list,
the result is restricted to names that are
free-identifier=? to
elements of
among.
Examples:
|
'(#<syntax:eval:5:0 flatten/append>) |
|
'(#<syntax:eval:6:0 empty?> #<syntax:eval:6:0 cons?> #<syntax:eval:6:0 first> #<syntax:eval:6:0 rest> #<syntax:eval:6:0 cons>) |
|
'(#<syntax:eval:7:0 flatten>) |