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

Functional programming in Python

Name: Anonymous 2008-04-27 5:16

I really like functional, it's what Python should have been to start with. Too bad Guido is taking the language in the complete wrong direction.
If I had the inclination, I'd make a fork of Python, get rid of the FIOC, classes, and all that other crap, make print etc. into real functions, and turn it into a real functional programming language.

Oh, and:
print(eval((lambda: '\n'.join(map(reduce(compose, (''.join, partial(starmap,
apply), partial(flip(zip), map(c, (compose(*map(itemgetter, map(int, oct(1))
)), itemgetter(2), compose(*map(itemgetter, map(int, repr(11))))))), repeat,
partial(partial, flip(apply)), c)), sorted(izip(imap(randrange, repeat(int(a
, 36))), chain(starmap(map, zip(map(partial(partial, flip(mod)), 'aa b i u '
's o spoiler code sup sub'.split()), repeat('[%s] [/%s]'.split()))), c('> 0'
'&2;3+'.partition(''.join(imap(compose(chr, partial(xor, 229)), starmap(add,
izip(*imap(partial(imap, ord), (a, b)))))))[::2])), repeat(reduce(add, imap(
partial(getitem, reduce(add, imap(chr, starmap(add, izip(chain(imap(compose(
partial(flip(sub), 108), ord), '+kquuv'), repeat(mod(reduce(add, map(ord, b)
), div(int(a, 36), 4197516)))), imap(ord, compose(partial(imap, itemgetter(0
)), groupby)(sorted(reduce(add,(a, b)))))))))), map(int, '%d' * 0x6 % tuple(
map(compose(partial(flip(sub), 42), ord), (reduce(add, map(reduce(compose, (
chr, partial(add, 0x2f), partial(apply, sub))), zip(*map(tuple, map(partial(
map, ord), (b, 'c Sti-')))))))))))))))))).func_code, (lambda n, g = dict(zip
('abc', ('bbcode', 'satori', lambda *c: c))): (map(g.update, ((__import__(m)
).__dict__ for m in n)), g)[1])('random functional operator itertools'.split
())))

Name: Anonymous 2008-04-27 6:29

>>2
And that's the one good thing that's coming out of py3k. Guido's still hellbent on making OO the one and only way to do most things, so you have to write all sorts of lambda a: a.something() crud if you want to use functional constructs like map(). Sure, list comprehensions and generator expressions work sometimes, but what if you want to parallelize? With the traditional map(func, list) you can just replace the map. Not so with list comprehensions; the mapping has been moved behind the curtain.

Really, all I want is Haskell without all the excessive punctuation, Lisp without all the screwy function names... Python without all the OO-anvils weighing it down.

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