Zulip Chat Archive

Stream: lean4

Topic: until is a keyword?


Colin Gordon (Jul 21 2022 at 13:57):

I've just found an interesting quirk in Lean 4.0.0 m4:

inductive foo where
| unti

is totally fine, a boring type equivalent to unit. But if I complete "unti" to "until":

inductive foo where
| until

I get an error: "until" is underlined (VSCode Lean 4 mode) with the message "expected identifier". So I guess "until" is a reserved keyword? I can't find any docs on what it might be for; is it just reserved for future use?

Not a big deal (I just won't use 'until' as a constructor name), but it took me a minute to figure out why Lean wasn't happy with my inductive definition of LTL formulas, and now I'm curious about what the future (or current?) use case might be.

Sébastien Michelland (Jul 21 2022 at 14:01):

It's an extension of do notation which is part of the repeat ... until loop.

Colin Gordon (Jul 21 2022 at 14:02):

ah, of course! thanks

Jannis Limperg (Jul 21 2022 at 14:02):

Heh, I didn't know this existed. In general, you can use keywords as identifiers if you write «until».

Jannis Limperg (Jul 21 2022 at 14:04):

Btw m4 is very outdated; if you have problems with it, you may want to try a recent nightly. The nightlies tend to be reasonably stable as well.


Last updated: Dec 20 2023 at 11:08 UTC