Re: How to check Clojure spec's for macros?
That helps a lot, thanks! On Mon, Jan 15, 2018 at 10:54 AM Alex Millerwrote: > stest/check does not work with spec'ed macros. In general, most macros > emit code (in the form of data) and in my experience it's usually either > not possible or more effort than it's worth to write :ret or :fn specs for > macros, so in practice I have not found this to be needed. > > stest/instrument also doesn't work with macros, although this is somewhat > replaced by always checking the args on macros during macroexpansion. > > > On Monday, January 15, 2018 at 2:44:01 AM UTC-6, Dylon Edwards wrote: >> >> For spec'd functions, you may check them automatically with >> clojure.test.check.alpha/check. Is there something similar for spec'd >> macros? I can always use test.check to generate unit testing parameters >> for macros, but is there a way to get that for free with Clojure spec? >> >> Regards, >> Dylon >> > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/RxnwKcha0cE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to check Clojure spec's for macros?
stest/check does not work with spec'ed macros. In general, most macros emit code (in the form of data) and in my experience it's usually either not possible or more effort than it's worth to write :ret or :fn specs for macros, so in practice I have not found this to be needed. stest/instrument also doesn't work with macros, although this is somewhat replaced by always checking the args on macros during macroexpansion. On Monday, January 15, 2018 at 2:44:01 AM UTC-6, Dylon Edwards wrote: > > For spec'd functions, you may check them automatically with > clojure.test.check.alpha/check. Is there something similar for spec'd > macros? I can always use test.check to generate unit testing parameters > for macros, but is there a way to get that for free with Clojure spec? > > Regards, > Dylon > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to check Clojure spec's for macros?
With macros I believe you get compile time check, ie, static checking. This is because the input to a macro is availaible at compile time, so spec just validates it on macro-expanssion. You can use test.check to instrument a generative test to test the expanded code too if you want. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to check Clojure spec's for macros?
By clojure.test.check.alpha, I meant clojure.spec.test.alpha. If there's not a way to check macros now, is the feature planned? On Monday, January 15, 2018 at 12:44:01 AM UTC-8, Dylon Edwards wrote: > > For spec'd functions, you may check them automatically with > clojure.test.check.alpha/check. Is there something similar for spec'd > macros? I can always use test.check to generate unit testing parameters > for macros, but is there a way to get that for free with Clojure spec? > > Regards, > Dylon > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to check Clojure spec's for macros?
For spec'd functions, you may check them automatically with clojure.test.check.alpha/check. Is there something similar for spec'd macros? I can always use test.check to generate unit testing parameters for macros, but is there a way to get that for free with Clojure spec? Regards, Dylon -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.