But I think something like Ruby's block syntax should be doable, and probably you can even pass multiple blocks, with some limitations on which parameters can receive them. Here's another shot at it, just for fun: http://codepad.org/mVigj978
1,374 karma · joined March 4, 2008
YouTube videos: https://www.youtube.com/user/hackerdashery
My twitter feed: http://twitter.com/sahazel
My website: http://awesame.org/
Side projects: http://codepad.org/ http://omgaudio.com/incoherence/
But I think something like Ruby's block syntax should be doable, and probably you can even pass multiple blocks, with some limitations on which parameters can receive them. Here's another shot at it, just for fun: http://codepad.org/mVigj978
def f(x):
def g(x): return 2 * x
def h(x): return 1 + x
return g(h(x))
More interesting was your point that Haskell has anonymous functions and is whitespace delimited. I don't think significant whitespace and anonymous functions have any connection at all. def _forbody(x):
def _ifbody(x):
print x
if x % 2: _ifbody(x)
for x in xrange(10): _forbody(x)Read some Ruby code that uses blocks for an example of how passing anonymous functions can become a very clear and natural idiom. In Ruby, you can write your own simple control flow constructs in the form of functions that take a block -- in fact the idiomatic way to iterate through a collection in Ruby is with a function rather than a built-in control flow construct.
In languages like Lisp and Smalltalk, where functions can naturally take more than one in-line block, you can write any control flow construct yourself.
I don't think either is true -- if you have more flexibility in the syntax, you'll do more with it.
Anyway, I'm kind of sad that people seem to want a straight copy of Ruby's blocks. I'd prefer syntax that allowed passing more than one block to a function, like the C-like syntax I proposed here: http://www.hackerdashery.com/2006/10/code-blocks-and-c-like-...
Because it's the news media's job to tell us about interesting and important things that are happening in the world, regardless of whether the people directly involved want us to know. If you get your facts from the news, you get a distorted picture of how money is being made, and that means that the news has failed you.
Lots of good book recommendations below, folks. Keep scrolling.
I think this article was fine.
If you want to claim that every language is useful and good in its own special way, you may have to accept that COBOL is primarily good at being compatible with old systems based on COBOL, and Pascal is useful mainly for failing to teach computer programming in the 1980s.
A two-week release-process lag is so much worse than it might sound. If you can ship instantly, you can get feedback and make improvements rapidly, over and over. Sure, without a careful release process you might occasionally break things, but when you do you can fix them in minutes rather than weeks. When you insert release-process lag into that cycle, improvements that might have been made in a rapid series of releases over a day or two can take months. Sometimes those improvements just never get made, because no one is motivated to keep working on them for so long.
In software, "stable" often means "unchanging", but only rarely means "high-quality".
Chrome acts more like an OS, in part by delegating many tasks to the OS itself. Firefox does more of what an OS needs to do, because it does all the work of handling those tasks in a simplified way itself, rather than delegating.
x ^ y ^ y ^ x ^ z
= x ^ x ^ y ^ y ^ z
= 0 ^ 0 ^ z
= zMaking this a part of the type system seems a little strange to me. Obviously it's nice to get warnings at compile-time or in the IDE. But I keep trying to imagine how you might make a feature like this useful as a parameter to strings, or a user-defined type, and with functions other than the arithmetic operators.
Personally I think on the order of 2^22 dollars reasonably qualifies as well. Maybe that's because of the standard of living I'm used to. Certainly if you have 2^24 dollars and you don't think you're rich, you have a definition of wealth that ignores a major qualitative difference in what a person can afford to do. Above 2^23 dollars, I think additional wealth begins to put you more in the realm of the low-level aristocracy and rulers than the merely rich.