Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ITT we code in our own fictional languages.

Name: Anonymous 2008-08-23 20:31


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: Anonymous 2008-08-23 20:52

Here's my implementation of >>1. It's the forced indentation of code, without statements and a couple tweaks. I call this language "Understatement", and I fap to it every night. No such thing as public or private access, and I'm guesssing what die does there.

say = print

Thing = class (object):
    __init__ = lambda self, pub:
        self.pub = pub
    hai = lambda: #Static method if no self
        lambda: say('Hai.')
    die = lambda: die() #Note: this hangs, but doesn't run out of stack space

Thing.hai = lambda: pass

str.makeAwesome = lambda self: self = "Awesome!"
str.__int__ = lambda: 5

Thing.hai()()
str('Hai!') == 'Hai'
say('Lol'.makeAwesome())
say(int("Num") + 5)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List