1 Ht DP Teachpacks
2 Ht DC Teachpacks
On this page:
atom?
annotation?
end-annotation
write-file
Version: 4.0.2

 

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.

(end-annotation x)  Annotation

  x : 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