xa*@xahlee.org a ?? http://xahlee.org/ this is of interest to me, because i wanted to illustrate functionalprograming, and Python''s short-coming of it. (if you go to wikipediaand read the article on Python, it will proudly say that Pythonsupports functional programing. A huge fucking lie. (more fantasticfucking lies in the Perl article. And it is impossible to correct them,because there is an army of ignorant morons, usually militant too, notshy to do justice for humanity with heartiness.) ) In functional programing proper, the following loop for example wouldbe a single line. Why? because in fp, one is focused on the input &output and less on the details how it is done. So here, one simplyreads the comment there and that''d be it. The one-line code would be inthe form of impPaths = f(impPaths), where f is a function made on thespot. So, in fp the source code tends to take the form of paragraphs ofalgorithmic units, as opposed one million lines of code filling thepage. I would have, written the following in a one-line. But in Python thisis impossible. (if possible, probably something so unusual andunreadable) .... Here we may want to make a note on what does it mean to say that aprograming language supports functional programing. The FP style,basically means that one writes pure functions and apply them toexpressions. That is, subroutines whose behavior are purely that ofinput and output. (i.e. so-called without side-effects) But if oneprograms in FP style, certain patterns of coding emerges. For example,a lambda construct, sequencing of functions, assigning and moving offunctions, application of functions etc, and such languages naturallydeveloped many features in that direction such as types, macros, manyspecialized loop constructs (recursion, nesting) and many otherfeatures that goes by abstruse names...etc. so here, if we judge Python (or Perl), why should we say it supportsfunctional programing? Simply because it is possible to definesubroutines without side-effects? What else, really, functionallanguage features does Python support? Can we really say, that afunctional programing coming to Python will find it reasonably supportshis FP coding style? I would like to see the a??also support functional programinga??removed in the wikipedia Python article.( http://en.wikipedia.org/wiki/Python_...mming_language ) (Perl the language, can arguably be said to support some functionalprograming. (those Schwatchzian etc Transform for example, is a epitomeof functional programing.) However, Perl does not supportObject-Oriented programing.) The Perl article is filled with more egregious lies. (In the past year)I''ve tried to mend the article about every 3 months or so, tentativelyon obvious and technical and non-controversial items that''s purelypropaganda but got denied by the Perl fuckfaces. I have written a fullpage of criticism but the human animal fuckers handily censored it too.If you think i have a point, please add this link to the Perl page''sexternal links. http://xahlee.org/UnixResource_dir/perlr.html (book review andcriticism on Perl & community) Xah xa*@xahlee.orga?? http://xahlee.org/ 这篇关于写一个loopin一行;处理文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 09:11