1,842 karma · joined June 23, 2007
split (left, right) x = if x<p then (x:left, right), else (left, x:right) qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (p:xs) = qsort lesser ++ [p] ++ qsort greater
where
lesser = filter (< p) xs
greater = filter (>= p) xs
I know nothing about Haskell but I don't think this code implements
the original quicksort algorithm which sorts the input in-place.
Moreover the two-pass of filter over the list and the concatenations
cause unnecessary overhead. Thus, even if the sample code is simple
and elegant, a real-world implementation would surely be a bit longer
than the given example.Interestingly, I've also read SICP in parallel -- currently reading the last chapter -- and there's some overlap in the topics treated in the two books. I'm also walking through CLRS and TAOCP at the moment, albeit reading the latter with a slower pace compared to the former.
On the non-technical side, I'm reading ``Drawing with the right side of the brain'' by Betty Edwards. I've picked up this book since I've decided to resume drawing one year ago. I highly recommend it if you struggle to draw a realistic rendering of a real life object or a landscape.
export GIT_PS1_SHOWDIRTYSTATE=yes
export GIT_PS1_SHOWUNTRACKEDFILES=yesIt's implemented in bash but I use it with almost no modification with the Korn shell.
So when he finally released it, some lispers were disappointed because they've been waiting for something really disruptive. And it backfired as most of the time, the harshest critics comes from your disappointed sympathizers.
That being said, I don't hang that much on IRC so I have no real back-story supporting this.
mplayer mms://171.67.219.228/see/ainlpcs224n/cs224n-lecture01.wmvMy take is that even if it's easier to screw things up in C, that doesn't mean that if you program in a higher level language, you'd automatically produce elegant code.
The United States, Canada, Australia, and New Zealand obviously turned out quite well largely modeling British systems of common law, trade, treaty, military organization, and government.
and
The African countries were much better under British Rule than non-British rule.
I'll ignore the fact that you're trying to mix together countries that have been independent for centuries with other ones which only acquired it roughly 50 years ago.
What I don't understand is your circular reasoning. If the rule under the British empire was that great, shouldn't the US and Canada be in a much worse state right now compared to that golden age? This seems to contradict your thesis.
And lastly, you seem to forget that most of the conflicts in Africa are due to the artificial borders imposed by colonialism. Some tribes like the Tutsi are spread across Rwanda, Burundi and Eastern Democratic of the Congo. Bring in the fact that most of these countries were governed by dictators largely supported by the former rulers and you'll see a cleaner picture of the situation.
Egypt? Incredibly wealthy under the British, not so much under self-governance.
You seem to forget that Egypt has a history of more than thousands years and was a superpower long before the British empire even existed. And after that, there was Persian, Greek, Roman, Arab and Ottoman occupation. Thus comparing the country's wealth during and just after the British colonialism is reductive. How about trying to do the same comparison throughout these periods and see under which one Egypt was at its peak?
Maybe you're right and there's some hidden potential behind all of this. But the cynic in me just imagines 4chan members drooling at the prospect of ruining a show with shocking images and videos.
So why not create syntax that catches 99% of the cases for which you intend the language to be used and abolish the ability to create further syntax?
Although it's possible to create new syntax in Common Lisp via reader macros -- I don't think lispers recommend to extend the syntax. But when you miss a language feature, instead of fighting against the language, you could implement it. I don't remember exactly who said it in one the SICP video lecture, Harold Abelson or Gerald Sussman, but he said something like
Lisp is not good at solving a particular problem. What Lisp is good at is extending the language to solve a class of problems.
The problem with syntax is that it's difficult to use correctly with macros. It's no wonder that most introduction books to C warns against the pitfalls of using macros. Even the simple ones could bite you if you're not careful. Consider:
#define DOUBLE(x) (2*x) /* should be (2*(x)) */
#define MAX(a, b) ((a) < (b) ? (b): (a))
Even the last one is not immune against multiple evaluation problems
if you try to evaluate MAX(a++, b). In Lisp you could avoid this by
using gensym and local bindings. That being said, C macros and Lisp macros are
completely different beasts. And I recommend reading ``On Lisp'' for
advanced use of Lisp macros.Seibel: I think Larry Wall described it as bowl of oatmeal with fingernail clippings in it.
Deutsch: Well, my description of Perl is something that looks like it came out of the wrong end of a dog. I think Larry Wall has a lot of nerve talking about language design -- Perl is an abomination as a language. But let's not go there. (...)