erg/compiler/erg_compiler/lib/std/_erg_control.py
Shunsuke Shibayama 9b1457b695 Fix #265
2022-12-01 23:02:06 +09:00

21 lines
353 B
Python

def if__(cond, then, else_=lambda: None):
if cond:
return then()
else:
return else_()
def for__(iterable, body):
for i in iterable:
body(i)
def while__(cond_block, body):
while cond_block():
body()
def with__(obj, body):
obj.__enter__()
body(e)
obj.__exit__()
def discard__(obj):
pass