mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
13 lines
250 B
Python
13 lines
250 B
Python
discard _x = None
|
|
|
|
discard 1
|
|
|
|
# if: |T, U|(Bool, T, U) -> T or U
|
|
cond|T: Type|(c: Bool, then: T, else: T): T =
|
|
if c:
|
|
do then
|
|
do else
|
|
|
|
assert cond(False, 1, 2) == 2
|
|
# assert cond(True, 1, 3) == "a"
|
|
# assert "a" == cond(True, 1, 3)
|