Re: a little syntax goes a long way??

From: jeffc (nobody_at_nowhere.com)
Date: 06/01/04


Date: Tue, 1 Jun 2004 10:09:59 -0400


"cppaddict" <hello@hello.com> wrote in message
news:leknb09j38co8bed7f4emdes33ad6kqq9m@4ax.com...
> It struck me as odd today that while class definitions require a
> semi-colon at the end, function definitions do not. I was curious if
> this small syntactic difference represents a larger conceptual
> difference between these two language constructs.

I think the "conceptual difference" lies in the meaning of "definition".
Classes are kind of funny when it comes to the meaning of "definition".
When you declare a function, you use a semicolon at the end. When you
define a function, you don't. But the "definition" of a function is really
an "implementation". Note that when you actually implement the class, you
need no semicolon. So a class "definition" is really more of a
"declaration", hence the need for the semicolon.



Relevant Pages

  • Re: DeLillo: comma
    ... colon might be too formal? ... Many authors avoid the semi-colon as if it was smallpox infested key ... A Swedish friend describes the semicolon as "ett njutningsmedel för ...
    (alt.usage.english)
  • Re: Print with no line feed
    ... what my help file says: ... Multiple expressions can be separated with either a space or a semicolon. ... I don't think it's at all clear that the semi-colon accomplishes what the OP ... you will see a semi-colon after the Print statement ...
    (microsoft.public.excel.programming)
  • Re: Simple question regarding the use of ;
    ... some variations in the way people use the semi-colon. ... compound statement is enclosed by '' and contains zero or more ... simple or compound statement; there is no need for a ';' to terminate a ... Otherwise you could say the last statement in a block doesn't need a terminating semicolon because the} does that job too. ...
    (comp.lang.c)
  • Re: Languages (moved from another thread)
    ... I am referring to VB 2010 in which the line end/line continue has changed from the nice easy Enter ends, Underscore continues to semicolon ends, Send continues. ... they have different key words and different syntax. ... once have I had to terminate a statement with a semi-colon. ... I know for a fact that VB.Net wipes the floor with VB6. ...
    (comp.databases.pick)
  • Re: passing arguments
    ... The latter, it is my understanding, is the reason he posts as Dr. John instead of just John. ... When asked to provide "typical" code where the lack of a semicolon caused an error when the semicolon removed it, I got one example and Richard couldn't remember the full context. ... there are places that adding a semi-colon to the end of a line will cause errors where the lack of that semi-colon isn't an error. ...
    (comp.lang.javascript)