Vitsy, 4 bytes
This language feature is newer than this question, but not made for this question.
iG`Z i Grab input. Since there is no input, it pushes -1 to the stack. G Get the class name of the referenced class. -1 refers to the current class. ` Read the file under the name of the stack's contents and push all of it to the stack. Z Output everything in the stack.
As of November 24, class commands allow for referencing other programs accessible by disk, or 'classes'. Normally, it'd be used something like this:
00k ;use;u someothervitsyfile
Where I execute the 0th line (the first line) of the 0th index of the uses list ('someothervitsyfile'). I can get its name with G
like so:
0GZ ;use;u someothervitsyfile
And, if I have the name, I can get its contents like so:
0G`Z ;use;u someothervitsyfile
But the special cases of this are -2
and -1
, where -2
references the superclass (as defined by ;ext;e) and -1
references the current class.
So, to get the name of the current class, I use -1
, get its name, and, with its name being the only thing in the stack, I pull its contents with `.
Very fancy.
You cannot try this online, as it has been disabled to prevent reading server files.