This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
We do not have mornings on Sundays here in Norway
today parsing clojure using spec/conform
with clojure.core.specs.alpha
specs seems quite nice and very simple … @borkdude or @dominicm … why am I wrong?
also, depends what you want. whitespace preservation doesn't work with pure s-expressions for example
Bear in mind that Spec isn't optimized for parsing so it may not be a very efficient way of "parsing".
performance can also be a condideration (it might be faster to manually process the s-expr, depends on what you're doing)
@seancorfield wasn't that more specifically about text (string) parsing though?
main point for me is that it’s very little code / learning curve to get a lot of data about the current ns
clojure itself runs these specs during macro-expansion (but afaik only for validation, the data itself isn't used for anything in the compiler, since that all pre-dates spec).
Right, yeah, it's just a matter of scale -- how much code are you parsing and how much do you care about performance.