Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whoa. So much for the principle of least surprise!


In practice, Io does follow the principle of least surprise. By default, blocks aren't activatable and methods are.


I'm talking about a higher meta-level: to me, it's surprising that the language semantics of what it means to simply type an identifier of a function change based upon the runtime state of the program. This seems crazy to me, it's like A New Kind of Side Effect I'd never seen before.


This is called late binding, and it allows you more flexibility and productivity if you're willing to accept fewer constraints.

Its actually quite powerful and allows some things that make Io a joy to work with. Memoization for instance:

    foo := method(foo = performSomeBigCalculation)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: