Documents


docs.ss

The teachpack docs.ss provides three operations:
  • atom? : SchemeValue -> bool
    which determines whether or not a Scheme value is a number, a symbol, or a string;
    Note: This notion of atom is different from that in the compat.ss library.
  • annotation? : SchemeValue -> bool
    which determines whether or not a Scheme symbol is a document annotation;
  • end-annotation : annotation -> annotation
    which consumes an annotation and produces a matching ending; and
  • write-file : (list-of atom) [string]-> void
    which consumes a list of annotated symbols and prints them out as a "file"; it returns nothing. if the string argument is present, it is interpreted as a file name: the words are written to this file; if the file exists, it is deleted
  • Sample session: set teachpack to docs.ss and execute:

    > (annotation? 0)
    #f
    > (annotation? ')
    #t
    > (end-annotation 0)
    end-annotation: not an annotation: 0
    > (write-file (list 'a 'b))
    a b