docs: function bucket() {
    var args = mlutil.asArray.apply(null, arguments);
    switch(args.length) {
    case 0:
      throw new Error('must specify name, comparison, and bound for bucket');
    case 1:
      throw new Error('must specify comparison and bound for bucket');
    case 2:
      if (args[1] instanceof AnchorDef) {
        return new ComputedBucketDef(args[0], args[1], null);
      }
      throw new Error('must specify one anchor with upper and lower bounds or separate lower and upper bounds for bucket');
    case 3:
      if (args[1] === '<') {
        if (args[2] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], null, args[2]);
        }
        return new BucketDef(args[0], null, args[2]);
      } else if (args[1] === '>') {
        if (args[2] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], args[2], null);
        }
        return new BucketDef(args[0], args[2], null);
      } else if (args[2] === '<') {
        if (args[1] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], args[1], null);
        }
        return new BucketDef(args[0], args[1], null);
      } else if (args[2] === '>') {
        if (args[1] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], null, args[1]);
        }
        return new BucketDef(args[0], null, args[1]);
      }
      throw new Error('missing comparison between lower and upper bounds of bucket');
    case 4:
      if (args[2] === '<') {
        if (args[1] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], args[1], args[3]);
        }
        return new BucketDef(args[0], args[1], args[3]);
      } else if (args[2] === '>') {
        if (args[1] instanceof AnchorDef) {
          return new ComputedBucketDef(args[0], args[3], args[1]);
        }
        return new BucketDef(args[0], args[3], args[1]);
      }
      throw new Error('invalid comparison between lower and upper bounds of bucket: '+mlutil.identify(args[2], true));
    default:
      throw new Error('too many parameters for bucket: '+args.length);
    }
  }