functions versus statements (from WIKI)
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
I'm in the middle of writing the tutorial and I'm dealing with the embarrasment of explaining the double prints in the console. Soon I will be trying to explain why print is now a function and why it returns what it prints as a return value. Frankly I have no idea why it returns anything and I really don't have any idea why it is a function. I know Guido wants Python print to change to a function and this is the current "in thing" to do. I have some vague idea one may want to print in a list comprehension but I doubt I'd ever do that. The more I work on the Prothon language definition the more I feel we should concentrate on strengthening statements like adding the switch statement and we should concentrate less on functions like the conditional expression "if c then a else b". The indentation of the language forces us into short readable statements, not long accumlated series of functions. Right now I could easily be talked into removing print-as-a-function (but keep the sep and eol arguments). Note: Since this was written I removed the return values from the print function to fix the double prints. This is not necessarily a long-term solution.