Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • What is the syntax for tags?
    • Keywords, like #:tag form
      • One character longer
      • Slightly easier to parse
    • Symbols, like #tag form
      • One character shorter
      • Slightly harder to parse
      • Ambiguous with record constructors?
        • Not if we assume that: 
          • 1) record names always contain a dot
            • Which they must, because deftypes occur in namespaces
          • 2) user-defined tags are always namespace-qualified
          • 3) built-in tags do not contain a dot
  • What happens when the reader encounters a tag for which no function is defined?
    • Error ?(YES)
    • Return form unchanged?
    • Return form with extra metadata?
      • Only possible if form supports metadata, ignore otherwise?
  • How to associate tags with reader functions?
    • file containing mapping from tags to Vars
      • "magic" file name gets loaded before other files
      • doesn't load any code directly
      • If 2 JARs on classpath have a magic file, who wins?
        • throw an exception
    • map stored in dynamic var
      • thread-local binding for each source file
        • created in Compiler.load and Compiler.compile

      • can be set! within a source file
      • can be rebound when invoking the reader at runtime

...