Zulip Chat Archive

Stream: lean4

Topic: ternary operator


Matthew Ballard (Mar 15 2023 at 23:29):

I remember some discussion of the condition ? doX : doY syntax but now I cannot locate it. Am I mistaken?

Eric Wieser (Mar 15 2023 at 23:35):

In lean3 it existed as do tt \l condition | doY, doX...

Adam Topaz (Mar 16 2023 at 00:57):

Are you just looking for pythonesquejavascriptesque syntax for if _ then _ else _?

Adam Topaz (Mar 16 2023 at 01:27):

notation t ? p : n => if t then p else n should get you essentially all the way there.

Matthew Ballard (Mar 16 2023 at 01:38):

Thanks but I thought it was already somewhere in core. I might have been mistaken

Adam Topaz (Mar 16 2023 at 01:43):

I don't recall seeing it in lean.


Last updated: Dec 20 2023 at 11:08 UTC