-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ifn? schema #416
Add ifn? schema #416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,6 +331,22 @@ Using regular expressions: | |
; => false | ||
``` | ||
|
||
`ifn?` accepts any value that implements Clojure(Script)'s IFn: | ||
|
||
```clj | ||
(m/validate ifn? :keyword) | ||
; => true | ||
|
||
(m/validate ifn? []) | ||
; => true | ||
|
||
(m/validate ifn? {}) | ||
; => true | ||
|
||
(s/validate ifn? 123) | ||
; => false | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure of the best place to add this information. Hope it's okay. |
||
## Serializable Functions | ||
|
||
Enabling serializable function schemas requires [sci](https://github.com/borkdude/sci) as external dependency. If | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ | |
(defmethod accept 'sequential? [_ _ _ _] :sequential) | ||
(defmethod accept 'ratio? [_ _ _ _] :int) ;;?? | ||
(defmethod accept 'bytes? [_ _ _ _] :char-sequence) ;;?? | ||
(defmethod accept 'ifn? [_ _ _ _] :ifn) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please align all the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've moved any |
||
|
||
(defmethod accept :> [_ _ _ _] :number) ;;?? | ||
(defmethod accept :>= [_ _ _ _] :number) ;;?? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure what to put here so guessed this would be a minor version bump rather than just a patch.
The date comes across as quite presumptuous of me, and can absolutely be changed! 🙈