You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have quite a few of these guys, sometimes with slightly different text:
@assertisdefined(@__MODULE__, :Polyhedra) "this function requires the package 'Polyhedra'"
I propose to outsource them to a central function to make the code simpler.
Maybe we should even write a macro, e.g., @required (@require is already taken by Requires).
The text was updated successfully, but these errors were encountered:
Yes, a macro @requires_polyhedra, or @requires(:Polyhedra) that displays a message similar to "this function needs the package 'Polyhedra'; do 'using Polyhedra'" and then try again would centralize those messages in one place.
I prefer to have a generic macro, as in your second proposal. Polyhedra is not the only optional package.
Actually, this makes me realize that we generally want to support a list of packages 👍
We have quite a few of these guys, sometimes with slightly different text:
I propose to outsource them to a central function to make the code simpler.
Maybe we should even write a macro, e.g.,
@required
(@require
is already taken byRequires
).The text was updated successfully, but these errors were encountered: