Having finished function syntax I'm moving on to comments. The problem with comments in C-style syntax is that they don't nest. D tries to fix this by adding nestable comments /+ +/ but this means that D has 6 different ways to do comments. D's article on documentation shows all the variations on these themes.
/* C-style block comment */ /** C-style documentation */ /+ D nesting block comment +/ /++ D nesting documentation +/ // C-style line comment /// C-style line documentation
Python doesn't have multi-line comments at all, but the behavior can be replicated with multi-line strings. Unfortunately these are always going to be documentation, so there's no way to comment out a function without generating confusing documentation.
# Python comment """ unevaluated multi-line python string serves as documentation """
What if there were just two ways to denote comments, without nesting problems or extraneous characters. What Python (and Haskell) gets wrong is that multi-line comments are important and easy with a whitespace-delimited language.
# Delight comment continues on multiple lines just by using indentation! #. Delight documentation comment Just uses one extra character. x = 5 # Of course it works inline too
Let me know what you think!