On Thu, Apr 19, 2012 at 10:15 PM, Devin Jeanpierre
<jeanpierr...@gmail.com> wrote:
> Why don't you allow nested multiline comments? Many languages (e.g.
> ML, Scheme, Haskell, etc.) allow you to nest multi-line comments. It's
> mostly the C family of languages that refuse to do this, AFAIK.

Allowing nesting or not allowing nesting is a design choice. If you
write code that looks for the string /* or */ in a REXX program, you
need to be careful in case it mis-nests (the usual recommendation is
to use "/"||"*" instead of "/*" as a single literal). It makes no
difference which way you choose, there's always issues to deal with.

> Least importantly: Why are multiline comments line-oriented? Why not
> inline, like with the C-style /* ... */ comments? This doesn't seem
> like a "proper" multiline comment.

That thought was to avoid the complaint that you can easily lose the
comment markers somewhere other than clearly at the beginning of the
line. By demanding that they delimit entire lines, we avoid this. Of
course, Python could choose to support /* */ comments instead/as well.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to