Hacker News new | ask | show | jobs
by babarock 4747 days ago
Technically, in Python nothing prevents you from writing something like:

    foo = lambda x: x*2 
If only that lambda statements are limited (by design?) to only a single return expression.

As far as Hy goes, lambdas won't have this limitation.

2 comments

I totally write code like this all the time, when I need a quick one-liner that I don't really care about. A little more then a technicality.
Totally. Hy will even auto-expand a lambda to a function if it's not sane Pythonically :)