News for hackers. Stuff that matters.
Re:Ruby is not a callable orientated language by richcollins on Sunday February 21, 2010 @11:43AM (#1140753)
Io presents an interesting alternative. There are only Blocks (functions with assignable scope). Blocks have an activatable slot. If you set it to true, the block is activated when an object receives a message that looks up the slot with the block. If false, it returns the block.

    sayHello := block(“hello” println)
    sayHello //returns the block
    sayHello setIsActivatable(true)
    sayHello //prints “hello”
    getSlot(“sayHello”) //returns the block
http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.h...
Re:Ruby is not a callable orientated language by gfodor on Sunday February 21, 2010 @01:25PM (#1140975)
Whoa. So much for the principle of least surprise!
Re:Ruby is not a callable orientated language by richcollins on Sunday February 21, 2010 @05:09PM (#1141334)
In practice, Io does follow the principle of least surprise. By default, blocks aren't activatable and methods are.
Re:Ruby is not a callable orientated language by gfodor on Monday February 22, 2010 @12:35AM (#1142019)
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.
Re:Ruby is not a callable orientated language by richcollins on Thursday February 25, 2010 @12:53AM (#1150110)
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)
Re:Ruby is not a callable orientated language by awt on Sunday February 21, 2010 @01:26PM (#1140978)
Io rocks :)