Skip to content
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 exception types, and a sentinel keyword argument #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gustaphe
Copy link
Collaborator

Discussion material for #307
(I may have gone overboard with the error types)

Two concepts to solve the problem of Pluto+Symbolics breaking. Both requires a little intervention at the call site:

  1. Use try/catch to guard for LatexifyExceptions, and return something else completely
  2. Use the sentinel keyword to make latexify return something

I think I prefer 2, it means everything but the offending type, for instance, gets latexified sensibly. So

julia> struct HasNoRecipe end
julia> latexify([1, "x", HasNoRecipe()]; sentinel="\\mathrm{NA}")
L"\begin{equation}
\left[
\begin{array}{c}
1 \\
x \\
\mathrm{NA} \\
\end{array}
\right]
\end{equation}
"

Not married to any of it, nor the name "sentinel".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant