mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
Change the structure of the .erg
directory
This commit is contained in:
parent
8c6997d3c9
commit
7bc37aa14a
7 changed files with 44 additions and 12 deletions
13
compiler/erg_compiler/lib/std/prelude.er
Normal file
13
compiler/erg_compiler/lib/std/prelude.er
Normal file
|
@ -0,0 +1,13 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue