Earlier quoted context omitted.
Python has closures, it just doesn't have a very convenient anonymous function syntax. I can't say I miss function () { .. } very often though.
I like Python's scoping rules but declaring functions inline is a lot nicer and nicer-looking than defining functions starting with underscores.
"I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
81–90 of 183 posts
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#82Earlier quoted context omitted.
Python has closures, it just doesn't have a very convenient anonymous function syntax. I can't say I miss function () { .. } very often though.
AFAIU Python's closure have been incomplete for a long time. I think they've become true, complete closures after the addition of the nonlocal keyword on 3.0 Please correct me if I'm mistaken. This all comes from a cursory research on the subject.
def outer ():
counter = [0]
def inner ():
counter[0] += 1
return counter[0]
return innerRe: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#83Earlier quoted context omitted.
> What is it with people liking a specific language What is it with shaming people for preferring a specific language where it is applicable? For some reason I can like a brand of electric drill, and I can believe in using a nailgun, but I am not allowed to like a specific language without someone coming along to scold me. If you don't ever develop opinions about tools and how to use them, are you really engaged or a…
What is it with people missing the point so many times in a row? Hence why I said "learn how you can use languages together and for the right purpose"—but I don't believe it should be the primary focus. When you buy a drill, the main purpose is to make holes in things. When you buy a nailgun, the main purpose is to stick things together. One might do it better, one might do it faster, and yes, it's useful to know tho…
I suspect many things and have many theories, but I'd be happy if someone concisely summarized different possible causes of such a behaviour of amateur programmers (and/or photographers). My "they're just noobs" doesn't cut it, because it may well be a description of effect and not the cause (I suspect it is).
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#84Earlier quoted context omitted.
"Today there is an unhealthy concentration on language and efficiency and NOT on how things fit together and protocols." -- Joe, two paragraphs below the point we're discussing.
I think you're being a little unfair there because he's talking about an " unhealthy concentration". Using a lower level language instead of a shell script for high performance scripts isn't unhealthy as it's not a case of just saving a negligible number of clock cycles. The difference I'm talking about like travelling to the moon and back just to buy a pint of milk. Case in point: no sane person would rewrite Apache…
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#85To me, this list is great except for one small thing. - C - Prolog - Erlang - Smalltalk - Javascript - Hakell / ML /OCaml - LISP/Scheme/Clojure Javascript?! Over Ruby or Python or Lua? What is it with people liking Javascript. I really don't get it. What can I do that is so beautiful or mindbending that I can't do in python? From my experience there is only two reasons to learn Javascript: to be able to build web app…
Argh. How could you read this post and still miss the point so badly? It is not about languages, it is about ideas . And the fact that you need years to master each of these languages because of ideas they are built upon, not because of such trivial things as syntax. I strongly suspect that Joe would be equally comfortable with this list was C substituted with Go, Smalltalk substituted with Io or JavaScript substitut…
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#86To me, this list is great except for one small thing. - C - Prolog - Erlang - Smalltalk - Javascript - Hakell / ML /OCaml - LISP/Scheme/Clojure Javascript?! Over Ruby or Python or Lua? What is it with people liking Javascript. I really don't get it. What can I do that is so beautiful or mindbending that I can't do in python? From my experience there is only two reasons to learn Javascript: to be able to build web app…
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#87Earlier quoted context omitted.
AFAIU Python's closure have been incomplete for a long time. I think they've become true, complete closures after the addition of the nonlocal keyword on 3.0 Please correct me if I'm mistaken. This all comes from a cursory research on the subject.
To my eyes they always were true and complete, but you had to play the minor trick of using mutable data to get them. Here is an example of what I mean that has worked forever. def outer (): counter = [0] def inner (): counter[0] += 1 return counter[0] return inner
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#88Earlier quoted context omitted.
I think you're being a little unfair there because he's talking about an " unhealthy concentration". Using a lower level language instead of a shell script for high performance scripts isn't unhealthy as it's not a case of just saving a negligible number of clock cycles. The difference I'm talking about like travelling to the moon and back just to buy a pint of milk. Case in point: no sane person would rewrite Apache…
I think you're reading a bit much into my intent from a comment that is really just a quote from the article.
So if I am reading too much into your post, then what was the intent?
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#89Earlier quoted context omitted.
He doesn't mean literally the "|" in bash, he means the general concept.
In a sense, it's the same thing. He's talking about the concept of fitting things together and refers to Unix pipes (in fact the example he gave was literally a string of piped POSIX commands ready for dumping into $SHELL). My point was that this concept doesn't scale well. As a productivity tool, pipes are invaluable. But you wouldn't want to write a performance critical routine using them. At the end of the day (an…
I can't really see much difference between grep | sed |awk somestuff.txt and (awk(sed(grep(somestuff.txt))).
Or are you suggesting that function composition is not the right approach? In which case, I disagree, but I would like some more insight into your thought process on this.
Re: "I couldn't really learn Erlang, 'cos it didn't exist, so I invented it"
#90Earlier quoted context omitted.
He doesn't mean literally the "|" in bash, he means the general concept.
In a sense, it's the same thing. He's talking about the concept of fitting things together and refers to Unix pipes (in fact the example he gave was literally a string of piped POSIX commands ready for dumping into $SHELL). My point was that this concept doesn't scale well. As a productivity tool, pipes are invaluable. But you wouldn't want to write a performance critical routine using them. At the end of the day (an…