Rebmu, 6 characters.
X|[x]x
Rebmu is a Rebol dialect for Code Golfing. It does not have its own parser, but confines itself to Rebol's rules. It has what are called "A-Functions, B-Functions, etc". So if you were to write:
Xa|[pA]x"Hi"
Runs of capital letters are used to indicate a declaration. (So ABCdefGHI is [abc: def ghi]
while abcDEFghi
becomes [abc def ghi]
). Thus the above would be processed into:
x: a| [p a]
x "Hi"
An "A-function" implicitly takes one parameter, understood to be named a
. p
is for print. (A "B-function" b|
takes two parameters, a and b.) So that would become equivalent Rebol:
x: function [a] [print a]
x "Hi"
...and print out "Hi".
(Note: To help work around naming overlaps and intersections with global variables, the second half of the alphabet creates things like "Y-functions" which take parameters named Z and Y, etc. An X-Function takes Z Y X, etc.)
But just a single unadorned pipe character is used to define a zero parameter function. So the equivalent Rebol for the simple StackOverflow generator would create a function object with no parameters, assign it to x, have it call x and then it's followed by the root invocation.
x: function [] [x]
x
def s{def t=s;t}
? – Prince John Wesley Jan 4 '13 at 15:10