Name:
Anonymous
2011-03-29 16:02
# START HAXING ANII
ops = {'add': '+', 'sub': '-', 'mul': '*', 'div': '/',
'mod': '%', 'pow': '**', 'lshift': '<<',
'rshift': '>>', 'and': '&', 'xor': '^', 'or': '|',
'lt': '<', 'le': '<=', 'eq': '==', 'ne': '!=',
'gt': '>', 'ge': '>='}
form = ''' def __{0}__(self, x):
if isinstance(x, Section):
return lambda y, z: y {1} z
return lambda y: y {1} x
def __r{0}__(self, x): return lambda y: x {1} y'''
defi = ['class Section:']
for k, v in ops.items():
defi.append(form.format(k, v))
exec '\n'.join(defi); _ = Section()
# END HAXING ANII
square = (_ ** 2)
negate = (0 - _)
print square(3), negate(6) # 9, -6
print map(5 * _, [1,4,9,16]) # [5, 20, 45, 80]
print reduce(_ * _, range(1, 10)) # 362880
Also, I'll make this compatible with Pipe one day. One word, the forced indentation of Haskell, thread over.
Name:
Anonymous
2011-03-29 16:08
Hey shitbag.
The plural of "anus" is "ani".
GFYS.
Name:
>>1
2011-03-29 16:14
Guess it already is compatible:
f = (_ | take_while(_ < 50))
f(range(100)) | add | stdout # 1225
>>2
G
HMA
Name:
Anonymous
2011-03-29 16:27
Again, this is just same lame substitute for a real functional language.
Name:
Anonymous
2011-03-29 16:29
>>1
One word, the forced indentation of Haskell, thread over.
Haskell already have its indentation forced, optionally.
Name:
BLACK HITLER
2011-03-30 3:51
░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
glory BLACK AFRIKA
HEIL NIGGERS.
HEIL BLACK AFRIKA.
NIG HEIL BLACK HITLER!