1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00
semantic/semantic-python/test/fixtures/4-01-lambda-literals.py
Patrick Thomson e137f4c68b Compile Python lambdas.
Lambdas are so hilariously crippled in Python that they're
significantly easier to compile than functions. Indeed, the resulting
core looks much like a function definition, without a `rec` binding.
2019-12-13 12:14:04 -05:00

5 lines
199 B
Python

# CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }}
const = lambda x, y: x
y = const(True, True)
z = const(False, False)