anchor.diff:               ,@body))))))
   
   (defun %expand-wild-path (directories index file-name)
  +  "The brains of `expand-wild-path'."
     (let (next as-directory-p)
       (cond
         ((>= index (length directories))
  
positive.code:         path))))
  
  (defun directory-contents-iterator (dir-ptr)
    (make-iterator ()
      (tagbody
       again
  
negative.code: 
  (defstruct (string-fragment
               (:constructor %make-string-fragment))
    "This struct represents a part of a word.
  
  `string-fragment-string' stores the characters associated with this
  fragment.
  
  `string-fragment-quoted' is a boolean value indicating whether the
  characters should be treated as though they were quoted.  This impacts
  how the characters are interpreted in some expansion contexts.  For
  example, a #\~ appearing in a quoted string fragment will not expand
  to the user's home directory.
  
  `string-fragment-literal' is a boolean value indicating whether the
  characters should be treated as though they were typed by the user
  directly.  Tokens like `shcl/core/lexer:variable-expansion-word'
  should expand to non-literal string fragments.  Tokens like
  `shcl/core/lexer:if-word' should expand to a literal string fragment."
    string
    quoted
    literal)
  
  (defun make-string-fragment (string &key quoted literal)
    "Create a `string-fragment'."
    (%make-string-fragment :string string :quoted quoted :literal literal))
  
  (defparameter *split-fields* t
    "Non-nil if field splitting should be performed after expansion
  takes place.
  
  Methods on the `expand' generic function should not emit word boundary
  markers (see `+soft-word-boundary+' and `+hard-word-boundary+') in
  their expansions when this variable is bound to nil.  When this
  variable is non-nil, methods on `expand' are permitted to split their
  expanded strings into multiple strings by inserting word boundary
  markers into their return value.  If appropriate, they are encouraged
  to use the `split' function to do this.")
  
  (defconstant +soft-word-boundary+ '+soft-word-boundary+
    "A weaker version of `+hard-word-boundary+'.
  
  Unlike `+hard-word-boundary+', this marker only introduces a new field
  in specific circumstances.
  - Soft boundaries at the beginning or end of a fragment sequence have
    no effect.
  - Consecutive soft boundaries can be coalesced into a single soft
    boundary.
  - If a soft word boundary is next to a hard word boundary, then the
    soft word boundary can be removed from the fragment sequence without
    changing the end result.")
  (defconstant +hard-word-boundary+ '+hard-word-boundary+
    "A marker indicating that a new field has begun.
  
  When fragments are being joined together, a hard word boundary will
  always introduce a new field, even if there are no fragments on one
  side of the boundary.  As a result,
  - Hard boundaries at the beginning or end of a fragment sequence
    introduce an empty field.
  - Consecutive hard boundaries introduce empty a sequence of empty
    fields.")
  
  (defun soft-word-boundary-p (thing)
    "Returns non-nil iff the given object is a soft word boundary."
    (eq +soft-word-boundary+ thing))
  
  (defun hard-word-boundary-p (thing)
    "Returns non-nil iff the given object is a hard word boundary."
    (eq +hard-word-boundary+ thing))
  
  (defun word-boundary-p (thing)
    "Returns non-nil iff the given object is a word boundary."
    (or (soft-word-boundary-p thing)
        (hard-word-boundary-p thing)))
  
  (defgeneric alias-name (thing)
    (:documentation
     "Returns the alias that the given object might name.
  
  If the given object can not name an alias, then this function returns
  nil.  You do not need to confirm that there is actually an alias
  associated with the name you return.
  
  For example, instances of `shcl/core/lexer:variable-expansion-word'
  cannot name an alias (because POSIX says so), so this generic function
  should return nil for objects of that type.  On the other hand, a
  `shcl/core/lexer:simple-word' token can be involved in alias
  expansion.  So, this function should return the string contents of a
  `shcl/core/lexer:simple-word' token."))
  (defmethod alias-name ((thing string))
    ;; This method is provided for testing convenience
    thing)
  (defmethod alias-name ((thing simple-word))
    (simple-word-text thing))
  (defmethod alias-name ((thing token))
    nil)
  
  (defparameter *aliases* (fset:empty-map)
    "This maps alias names (strings) to `alias' structs.
  
  Every entry in this map represents an alias definition in the current
  shell execution environment.")
  
  (defstruct alias
    "A struct describing the expansion behavior of an alias."
    words
    continue-expansion)
  
  (defun set-alias (name words &key continue-expansion-p)
    "Establish an alias in the current shell execution environment.
  
  `name' is the string name for the alias.  `words' are the tokens that
  should replace use of the given alias.  If `continue-expansion-p' is
  nil, then use of this alias prevents further alias expansion in the
  current command."
    (setf (fset:lookup *aliases* name)
          (make-alias :words (fset:convert 'fset:seq words)
                      :continue-expansion (not (not continue-expansion-p))))
    (values))
  
  (defun unalias (name)
    "Remove the named alias from the current shell execution
  environment.
  
  `name' should be a string."
    (setf *aliases* (fset:less *aliases* name)))
  
  (defun expand-aliases (tokens)
    "Perform alias expansion on the given token sequence."
    (unless (typep tokens 'fset:seq)
      (setf tokens (fset:convert 'fset:seq tokens)))
  
  