code: function anchor() {
    var args = mlutil.asArray.apply(null, arguments);
    switch(args.length) {
    case 0:
      throw new Error('no milestone or lower bound for anchor');
    case 1:
      throw new Error('no lower bound for anchor');
    case 2:
      return new AnchorDef(args[0], args[1], null, null);
    case 3:
      throw new Error('must specify comparison with both lower and upper bounds for anchor');
    case 4:
      return new AnchorDef(args[0], args[1], args[2], args[3]);
    default:
      throw new Error('too many parameters for anchor: '+args.length);
    }
  }
docs: The specification for computing a datetime boundary or range as returned by
  the {@link queryBuilder#anchor} function to pass to the {@link queryBuilder#bucket} function.
  @typedef {object} queryBuilder.AnchorParam
  @since 1.0
   
  Defines a numeric or datetime range of for aggregating value frequencies
  as part of a {@link queryBuilder#facet} calculation. To compute both lower and upper bounds
  relative to the same anchor, you can as a convenience return both bounds and the comparison
  from a single call to an {@link queryBuilder#anchor} function.
  @method
  @since 1.0
  @memberof queryBuilder#
  @param {string} milestone - the temporal milestone from the enumeration
  now|start-of-day|start-of-month|start-of-year
  @param {string} lower - a boundary as a duration offset relative to the temporal milestone
  such as -P1Y for one year in the past, -P2D for two days in the past, and so on; formally,
  an xs:duration, xs:yearMonthDuration, or xs:dayTimeDuration value
  @param {string} [comparison] - the constant '<' separating the lower and upper bounds; if the
  comparison is provided, the preceding offset must establish the lower bound and the following offset
  must establish the upper bound
  @param {string} [upper] - the upper boundary as a duration offset relative to the temporal milestone
  @returns {queryBuilder.AnchorParam} specification for a {@link queryBuilder#bucket}
  as part of a facet calculation