lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading material?


From: Nicolas Sceaux
Subject: Re: reading material?
Date: Mon, 22 Mar 2004 21:30:11 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Mon, 22 Mar 2004 12:51:12 -0600, Douglas a dit : 

 >> (define (iterate func k)
 >> "Produce the function x -> FUNC(FUNC .. (x) .. ) "
 >> (if (> k 0)
 >> (lambda (x) (func ((iterate func (1- k)) x)))
 >> (lambda (x) x)))
 >> 
 >> (define to-6th-power (iterate sqr 3))
 >> 
 >> If you're suitably masochistic, then you could come up with a C++
 >> solution, but I doubt it would be natural or elegant. Besides, I don't
 >> appreciate masochism when it comes to programming.

 > The C++ solution is both natural and elegant.  Two example solutions follow, 
 > the
 > first not using templates, the second using templates.

 > [snip code]

hm... "both natural and elegant"...
Are you realizing that writing classes for everything is not natural,
nor eleguant? Other programming paradigms do exist, and are notably
more natural and eleguant for that particular problem.
Your examples are very bright indeed, but a full page of C++ code against
5 lines of scheme code, is not very demonstrative.

nicolas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]