Next: iklib reader misc, Previous: iklib reader chars, Up: iklib reader [Index]
The Scheme source code reader allows us to annotate source code read from a textual input with informations about the position of an expression in the input. For example:
(import (vicare)) (define port (open-string-input-port "(list var)")) (define datum (get-annotated-datum port)) (pretty-print datum) -| #[reader-annotation expression=#<omitted> stripped=(list var) textual-position=#[record: &source-position port-id="*string-input-port*" byte=0 character=0 line=1 column=1]]
The following bindings are exported by the library (vicare)
.
Like get-datum
, but rather than returning a datum return a hierarchy of
<reader-annotation>
objects with the same hierarchy of the datum and embedding the datum
itself.
Return #t
if obj is an <reader-annotation>
object, else return
#f
.
Return a list, vector, identifier, what–have–you that may contain further annotations.
Return the same symbolic expression of the expression
field with no annotations.
Return a condition object of type &source-position
representing the position of the
expression in the source code.
Return a pair whose car is the port identifier and whose cdr is the offset of the first character of the source expression in the textual input.