(no subject)

Chermside, Michael mchermside at ingdirect.com
Tue Feb 18 10:25:44 EST 2003


[discussion of how  if(cond,A,B)  form with lazy evaluation resembles
 a function call but has different semantics]

Daniel Silva writes:
> what's wrong with it looking like a function if the docs specify it as a 
> special form?

Well, in my mind, what's wrong is that it will confuse people who
are trying to read it. It will LOOK like a function call, in _most_
cases it will BEHAVE like a function call, so programmers will come
to treat it like a function call. But then they'll do something
just slightly differently and it won't be one.

Have you ever worked with complicated C macros? Since they look like
function invocation, people tend to think of them as if they WERE
functions. But the semantics is (not so subtly) different, and sooner
or later, that trips up every C programmer.

-- Michael Chermside





More information about the Python-list mailing list