Standard library referenceModules
i/syntax
Source syntax values for compile-time programs and tests.
Syntax
Syntax = Opaque Node
A node of syntax. Int and Float are the built-in types; the other
members share a type constructor with another member, so each is its own
type (syntax three §2.8).
Node = ( TypeView
TypeView = (TypeHandle) Name
Name = (String) Discard
Discard = (String) Up
Up = (String) Symbol
Symbol = (String) Text
Text = (String) Round
Round = (List(Syntax)) Square
Square = (List(Syntax)) Curly
Curly = (List(Syntax)) Bits
Bits = (List(Syntax)) Quote
Quote = (Syntax) Unquote
Unquote = (Syntax) Splice
Splice = (Syntax) TypeHandle
TypeHandle = Opaque Position
Position = ImportItem PatternItem
PatternItem = () ValueItem
ValueItem = () TypeItem
TypeItem = () ImportItem
ImportItem = () ExportItem
ExportItem = () Item
Item = () Attribute
Attribute = () Type
Type = () FunctionResult
FunctionResult = () Expression
Expression = () Statement
Statement = () Pattern
Pattern = () Segment
Segment = () Format
Format = () SyntaxError
SyntaxError = (message = String, at = Syntax) Definitions
Definitions = (definition = (Syntax) <- (Fail(SyntaxError)) -> Syntax) definition
Asks the installed definition service for a type’s written definition.
definition = (of : Syntax) <- (service : Definitions) -> Syntax { node
Gives the node without changing the scopes of its children.
node = (syntax : Syntax) -> Node { make
make = (node : Node, like : Syntax) -> Syntax { same_code
Compares datums without comparing source locations or scopes.
same_code = (a : Syntax, b : Syntax) -> Bool { raw_same_code(a, b) } show
Writes a datum in Lisp form on one line.
show = (syntax : Syntax) -> String { raw_show(syntax) } show_as
Writes syntax in the normal surface at the requested position.
show_as = (syntax : Syntax, position : Position) -> String { Items
Items = ( Diagnostics
Diagnostics = (note = (String) -> Nil) Types
Types = ( Truth
Frozen type observations supplied only to typed macro implementations.
Truth = Yes | No | NotKnown Yes
Yes = () No
No = () NotKnown
NotKnown = () type_of
type_of = (s : Syntax) <- (types : Types) -> Syntax { types.type_of(s) } signature
signature = () <- (types : Types) -> Syntax { types.signature() } subtype
subtype = (a : Syntax, b : Syntax) <- (types : Types) -> Truth { members
members = (s : Syntax) <- (types : Types) -> List(Syntax) { types.members(s) }