func say($s) { echo $s, "\n"; }
class :open Thing {
var :pub=r :priv=rw $thing;
func :pub :pure hai() {
return func () { say "Hai."; }
}
func :priv die() { die(); }
}
class :open Thing {
func hai() {}
}
class :open String {
func :pub :uses=$var makeAwesome() {
$var = "Awesome!"; # Or somesuch.
}
func __toInt() {
return 5;
}
}
Thing::hai()();
(new String("Hai!") == "Hai")
say "Lol"->makeAwesome(); # "Awesome!"
say "Num" + 5; # "10"
Name:
Anonymous2008-08-25 11:23
Due to Haskell's lazy evaluation, make_sound only sounds if there's any human listening, just like if a tree falls in the forest, and no one hears it, it doesn't make any sound¹.
¹: Bullshit, though. The Universe is deterministic and objects exist without the need for the disgustingly anthropocentric observative/conscious bullshite; it's just observation what's not perfect, because it runs from within the system.