Hacker News new | ask | show | jobs
by anewaccountname 6309 days ago
Python already has a solution for callbacks:

    @reg_callback(button.onclick)
    def callback():
        do_stuff()
1 comments

Whilst this is more pythonic I personally prefer Javascripts use of lambdas as more than a means of expression. More like a way of life for the language :-) And that is IMHO what makes it functionally closer to Scheme. Just looking at the way one defines lambdas in Javascript and their use throughout the language is a thing of beauty.