I can't figure out how to use s/either or s/conditional as part of the input list. Would like to do something like this:
(s/defn parse-int :- s/Int
[input :- ; either s/Int or s/Str]
; if s/Int
input
; if s/Str
(read-string input)
))
(sc/defn parse-int :- sc/Str
[input :- (sc/cond-pre sc/Int sc/Str)]
(if (string? input) "a string" "not a string"))
(parse-int 34545) ; "not a string"
(parse-int "34545") ; "a string"
You could also use either
, but it is deprecated.