Flat-schmat!
Kenny Tilton
ktilton at nyc.rr.com
Sun Oct 5 12:29:40 EDT 2003
A.M. Kuchling wrote:
> On Sun, 05 Oct 2003 12:27:47 GMT,
> Kenny Tilton <ktilton at nyc.rr.com> wrote:
>
>>Python (I gather from what I read here) /deliberately/ interferes in my
>>attempts to conform my code to the problem at hand, because the
>>designers have decreed "flat is better". Python rips a tool from my
>>hands without asking if, in some cases (I would say most) it might be
>>the right tool (where an algorithm has a tree-like structure).
>
>
> Oh, for Pete's sake... Python is perfectly capable of manipulating tree
> structures, and claiming it "rips a tool from my hand" is simply silly.
Well then I am glad I did not say it! :)
I am talking about coding up an algorithm, not manipulating a tree of
data. An example is:
(my-function ;; takes three parameters, which follow
(this-function x yz) ;; p1
(case x (:left 1)(:right -1)) ;;p2
(if (some-other-function 'z)
42
'norwegian-blue)) ;; p3
where my-function gets passed the first two computations plus either 42
or 'norwegian-blue, ie, the value returned by the IF form.
Looks simple to me. But IIUC (I may not!) in Python IF is a statement,
so that would not work too well. I need an artificial extra statement to
satisfy an artifical rule.
kenny
More information about the Python-list
mailing list