On this page:
atom?
annotation?
end-annotation
write-file

1.9 Manipulating Simple HTML Documents: "docs.ss"

The teachpack provides three operations for creating simple “HTML” documents:

Annotation An Annotation is a symbol that starts with “<” and ends in “>”. An end annotation is one that starts with “</”.

(atom? x)  boolean?
  x : any/c
Determines whether or not a Scheme value is a number, a symbol, or a string.

(annotation? x)  boolean?
  x : any/c
Determines whether or not a Scheme symbol is a document annotation.

Consumes an annotation and produces a matching ending annotation.

(write-file l)  true
  l : (list-of atom)
Consumes a list of symbols and annotations and prints them out as a "file".

Sample session: set teachpack to “docs.ss”> and click RUN:
  > (annotation? 0)
  false
  > (annotation? '<bold>)
  true
  > (end-annotation 0)
  end-annotation: not an annotation: 0
  > (write-file (list 'a 'b))
  a b