My newbie annoyances so far

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sun Apr 29 07:55:25 EDT 2007


Steven D'Aprano wrote:

> There are bad programmers in every language, but RPL conditional
> blocks aren't the cause of them. Once you learn how RPL works, if
> statements work consistently and obviously (although maybe not to
> programmers who don't get RP notation).

ACK. What made me anwswer wasn't RPL (after all I use an RPN
calculator ;) ), but the statement that it were "more logic" than
Python's "classic" infix logic.
 
> In RPL, there are no expressions. RPL programs are constructed
> from data and commands, not expressions. So you shouldn't think of
> 
> <garbage can full> if <fetch out garbage> [else <don't>]
> 
> as an expression. Think of it as a block, equivalent to the
> Python:
> 
> if garbage_can_full:
>     fetch
>     out
>     garbage
> else:
>     don't
> 
> except that you can write it as a single line. Newlines in RPL are
> just another sort of whitespace, with no special significance.
> 
> If the else clause is missing, then nothing is executed and
> processing simply continues past the end of the block.

That made it clear, thanks.
 
Regards,


Björn 

-- 
BOFH excuse #439:

Hot Java has gone cold




More information about the Python-list mailing list