develooper Front page | perl.perl6.language | Postings from May 2007

Re[2]: explicit line termination with ";": why?

Thread Previous | Thread Next
From:
Andrew Shitov
Date:
May 14, 2007 14:42
Subject:
Re[2]: explicit line termination with ";": why?
Message ID:
158071263.20070515014205@shitov.ru
> Aankhen wrote:

> Speaking of JavaScript, any experienced JavaScript programmer will
> tell you that while semi-colons are in fact optional, you should
> always treat them as mandatory, to avoid subtle errors creeping into
> your code.

We should also note that the idea of omitting ';' is not as simple as
<"\n" always means ";\n">. In mentioned JavaScript language one can
do this:

<script>
var
x
=
123
alert
(
x
)
</script>

and that will work!

";\n" can almost always be converted into "\n" but not vice versa.


--
Andrew Shitov
______________________________________________________________________
andy@shitov.ru | http://www.shitov.ru


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About