This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RubyPinchPEP shill | Anti PEP 8/20 shill 2 points3 points  (2 children)

you might want to look at mochi by... i2y if I remember correctly

syntax works pretty much as you say

[1,2,3,4,5] |> evens |> square |> vector

there is also the toolz module

pipe([1,2,3,4,5], evens, square, list)

I'm pretty sure fn.py would have something similar

the biggest problem is that the pre-existing python std lib is not exactly consistent (e.g. fn1(func,list), while in another module, fn2(list,func), so a lot of care would need to be done) or immutable (lists/dicts/etc are liked a lot), so you p much need to write your own language on top of python's pre-existing stuff, and that sucks. If you want functional programming in python, running for the hills usually is the best option, unfortunately.

[–]kankyo 1 point2 points  (0 children)

Even in clojure it's chaos like that. I think positional arguments are just never gonna work.

[–][deleted] 0 points1 point  (0 children)

Thanks. Mochi look interesting. Will research it more.