Next: , Previous: , Up: expander clauses   [Index]


15.5.2 Syntax clauses utilities

Function: syntax-clauses-unwrap clauses
Function: syntax-clauses-unwrap clauses synner

Scan the syntax object clauses expecting it to represent a list of clauses; return a new syntax object representing clauses fully unwrapped. The function synner is invoked if the structure of clauses is invalid.

Function: syntax-clauses-filter keywords unwrapped-clauses

Given a fully unwrapped syntax object unwrapped-clauses holding a list of clauses (for example the return value of syntax-clauses-unwrap) select the ones having ?identifier being free-identifier=? to an identifier in the list keywords and return the selected clauses in a fully unwrapped syntax object holding the list of them; return null if no matching clause is found.

Function: syntax-clauses-remove keywords unwrapped-clauses

Given a fully unwrapped syntax object unwrapped-clauses holding a list of clauses (for example the return value of syntax-clauses-unwrap) remove the ones having ?identifier being free-identifier=? to an identifier in the list keywords and return the selected clauses in a fully unwrapped syntax object holding the list of them; return null if no matching clause is found.

Function: syntax-clauses-partition keywords unwrapped-clauses

Given a fully unwrapped syntax object unwrapped-clauses holding a list of clauses (for example the return value of syntax-clauses-unwrap) partition it into: a list of clauses having ?identifier being free-identifier=? to an identifier in the list keywords, a list of non–matching clauses. Return the two lists.

This function can be used to check that a list of clauses only contains clauses with selected identifiers.

Function: syntax-clauses-collapse unwrapped-clauses

Given a fully unwrapped syntax object holding a list of clauses (for example the return value of syntax-clauses-unwrap): collapse the clauses having equal ?identifier into a single clause and return the resulting unwrapped syntax object. Example:

(syntax-clauses-collapse ((#'fields #'a #'b #'c)
                          (#'fields #'d #'e #'f)))
⇒ ((#'fields #'a #'b #'c #'d #'e #'f))

Next: , Previous: , Up: expander clauses   [Index]