machine-readable function type signature syntax
elements separated by ->
input -> output
elements separated by a single space:
a b c -> d
elements separated by a slash: /
a b/c/d -> e a port/string/integer -> e
elements separated by a colon: :
a b:c:d -> e
data-types always come first. data-type:helpful-alternative-name:another-alternative-name
a port:input-port:source -> e
enclosed in square brackets: []
a [b c] -> d
none or many consecutive occurences of an element.
element followed by a space character and three dots: ...
a b ... c ... -> d
identifier followed by a space character and two colons: ::
name :: a b -> c
a function signature enclosed with curly brackets: {
}
unlimited nesting
{a ->} procedure:{a ... -> list:b} hashtable:{key -> value}
using scheme read syntax
(a (b c))
#(a #(b c))
(integer #(char ...))
two colons followed by a newline, optionally followed by one or multiple input elements per line separated by newlines, a line with only a ->
, optionally followed by output element separated by newlines, ending with end-of-string or two successive newline characters
:: a b -> c line outside of signature
list any [symbol:exclusive/inclusive] -> (list:left list:right)
procedure:{any -> boolean} procedure:{list:matched-elements -> list:replacements} list:source -> list
:: procedure:{alist:header procedure:fold-lines:{string:line any:result procedure:next:{any:result -> any} -> any} result -> any} procedure:{header port result ->} any port [string] -> any
sph-lib includes a reader and writer