Comments (9)
I am unsure. If a user is faced with this error message they might really need this help to identify the respective calls, and so far I did not think of a better way. Do you?
I assume it bother you in the context of tests? Happy to accept a PR that adds an option to omit them, similar to pp.mvars
, that people writing tests with these can turn on.
from lean4.
I assume it bother you in the context of tests?
Yes. When writing code to test output messages, the test code must be modified frequently each time the file is changed.
from lean4.
Got it. What is your use case for testing failing function definitions? The lean test suite itself, or some other project?
You could also test it indirectly: use guard_msgs to hide the error text, and then afterwards check that the function is not fully constructed (e.g. no .eq_def
lemma)
from lean4.
I'm writing Lean reference book (https://lean-ja.github.io/lean-by-example/, Japanese) and I use #guard_msgs
to show examples including errors without actual error.
from lean4.
You could also test it indirectly: use guard_msgs to hide the error text, and then afterwards check that the function is not fully constructed (e.g. no
.eq_def
lemma)
oh nice! it is interesting
#guard_msgs (drop all) in
def alternate {α : Type} (xs ys : List α) : List α :=
match xs, ys with
| [], ys => ys
| x :: xs, ys => x :: alternate ys xs
/-
alternate [1, 2] [3, 4]
-/
#reduce alternate [1, 2] [3, 4]
from lean4.
I'm writing Lean reference book (https://lean-ja.github.io/lean-by-example/, Japanese) and I use
#guard_msgs
to show examples including errors without actual error.
That's great work, thanks! But hopefully you understand that this is a special case and shouldn't guide the error message phrasing.
Are you unblocked by the drop all
trick? Can we close this then?
from lean4.
Are you unblocked by the
drop all
trick?
No. I would be happy to be able to display the error message itself, so I would still be happy if there was a way to remove the specific line number from the error message.
from lean4.
But hopefully you understand that this is a special case and shouldn't guide the error message phrasing.
Ok this is reasonable. You can close this as not planned.
I may be able to achieve what I want to do in the future by using verso or some other method.
from lean4.
This is plausible - in Verso, it would be fairly easy to write a program that checked Lean messages for equality modulo substrings that look like source positions and/or metavariable names, so the error in the book matches what users will see but it doesn't need updating quite so often.
from lean4.
Related Issues (20)
- structural recursion fails in the equation compiler HOT 26
- Consider making WorkspaceClientCapabilities.applyEdit field Optionable
- libStd.a file not found running `nix develop` through flake template HOT 2
- `termination_by?` code action unergonomic for mutual recursion
- Two functions with the same name in a `where` block don't cause an error
- unknown free variable: _kernel_fresh.1210 HOT 2
- RFC: try-this widget: multiple replacemens, alternative text in InfoView
- Language server does not report error in incremental `cases`/`induction`
- Failure of exhaustiveness checker when matching on `Exception` HOT 3
- ppSpace in `elab`/`macro` is ignored before constructor dot notation HOT 1
- `extern_lib` targets from dependencies aren't loaded when compiling lean files
- possible bug in `IO.FS.lines`
- `induction_eliminator` and `cases_eliminator` only key on the head symbol
- "Try this" suggestion includes trailing comments
- simp unfolds local def through projection
- `simp?` may unresolve simp name to current theorem name, making the theorem recursive HOT 2
- `lean --stdin --run` ignores the first trailing argument
- `lean-action` template for `lake new/init` HOT 1
- Metavariables in `have`'s type should not leak into body
- simp doesn't rewrite in definitions because of unassigned metavariables HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lean4.