|
387 | 387 | keys->specs #(c/or (k->s %) %) |
388 | 388 | id (random-uuid)] |
389 | 389 | (reify |
390 | | - IFn |
391 | | - (-invoke [this x] (valid? this x)) |
392 | 390 | Spec |
393 | 391 | (conform* [_ m] |
394 | 392 | (if (keys-pred m) |
|
471 | 469 | (named? pred) (cond-> (the-spec pred) gfn (with-gen gfn)) |
472 | 470 | :else |
473 | 471 | (reify |
474 | | - IFn |
475 | | - (-invoke [this x] (valid? this x)) |
476 | 472 | Spec |
477 | 473 | (conform* [_ x] (dt pred x form cpred?)) |
478 | 474 | (unform* [_ x] (if cpred? |
|
503 | 499 | #(assoc %1 retag %2) |
504 | 500 | retag)] |
505 | 501 | (reify |
506 | | - IFn |
507 | | - (-invoke [this x] (valid? this x)) |
508 | 502 | Spec |
509 | 503 | (conform* [_ x] (if-let [pred (predx x)] |
510 | 504 | (dt pred x form) |
|
543 | 537 | ([forms preds] (tuple-impl forms preds nil)) |
544 | 538 | ([forms preds gfn] |
545 | 539 | (reify |
546 | | - IFn |
547 | | - (-invoke [this x] (valid? this x)) |
548 | 540 | Spec |
549 | 541 | (conform* [_ x] |
550 | 542 | (if-not (c/and (vector? x) |
|
616 | 608 | (tagged-ret [(keys i) ret])))) |
617 | 609 | ::invalid)))] |
618 | 610 | (reify |
619 | | - IFn |
620 | | - (-invoke [this x] (valid? this x)) |
621 | 611 | Spec |
622 | 612 | (conform* [_ x] (cform x)) |
623 | 613 | (unform* [_ [k x]] (unform (kps k) x)) |
|
669 | 659 | "Do not call this directly, use 'and'" |
670 | 660 | [forms preds gfn] |
671 | 661 | (reify |
672 | | - IFn |
673 | | - (-invoke [this x] (valid? this x)) |
674 | 662 | Spec |
675 | 663 | (conform* [_ x] (and-preds x preds forms)) |
676 | 664 | (unform* [_ x] (reduce #(unform %2 %1) x (reverse preds))) |
|
999 | 987 | "Do not call this directly, use 'spec' with a regex op argument" |
1000 | 988 | [re gfn] |
1001 | 989 | (reify |
1002 | | - IFn |
1003 | | - (-invoke [this x] (valid? this x)) |
1004 | 990 | Spec |
1005 | 991 | (conform* [_ x] |
1006 | 992 | (if (c/or (nil? x) (coll? x)) |
|
1046 | 1032 | [argspec aform retspec rform fnspec fform gfn] |
1047 | 1033 | (let [specs {:args argspec :ret retspec :fn fnspec}] |
1048 | 1034 | (reify |
1049 | | - IFn |
1050 | | - (-invoke [this x] (valid? this x)) |
1051 | 1035 | ILookup |
1052 | 1036 | (-lookup [this k] (get specs k)) |
1053 | 1037 | (-lookup [_ k not-found] (get specs k not-found)) |
|
0 commit comments