To all of you that helps out with the important tak of improving the Pike documentation (three, or so, people): The code/tt markup is now as follows.
General computer-stuff should be marked with @tt, e.g. @tt{--help@}, @tt{/bin/sh@}, @tt{POST@}.
Code expressions in flowing text should be marked with @expr, e.g. @expr{7@}, @expr{"POST"@}, @expr{i=i++;@}. Code expressions may be broken into several lines, as can @tt, but we have the possibility to break the expressions between tokens instead of at white spaces.
Code snippets should be marked with @code, e.g. @code int i=4; i=i++; @endcode
@expr{i=i++;@}.
`i=i++' is an expression, but `i=i++;' is a statement. Am I wrong? ^
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-04-03 22:51: Subject: Autodoc
To all of you that helps out with the important tak of improving the Pike documentation (three, or so, people): The code/tt markup is now as follows.
General computer-stuff should be marked with @tt, e.g. @tt{--help@}, @tt{/bin/sh@}, @tt{POST@}.
Code expressions in flowing text should be marked with @expr, e.g. @expr{7@}, @expr{"POST"@}, @expr{i=i++;@}. Code expressions may be broken into several lines, as can @tt, but we have the possibility to break the expressions between tokens instead of at white spaces.
Code snippets should be marked with @code, e.g. @code int i=4; i=i++; @endcode
/ Martin Nilsson (har bott i google)
Nope. Try
mixed x = for(int i=0; i<3; i++) { };
and see how well it doesn't work. :-) An expression can be made into a statement by putting a ';' after it, but a statement can not be made into an expression (unless you count using `lambda', `catch' or `gauge'.)
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-04-03 23:15: Subject: Autodoc
Isn't statements expressions?
/ Martin Nilsson (har bott i google)
i=i++ is an expression. Every expression can also be a statement. i=i++; is an expression-statement followed by a semicolon.
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-04-03 22:53: Subject: Autodoc
@expr{i=i++;@}.
`i=i++' is an expression, but `i=i++;' is a statement. Am I wrong? ^
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
The way I read the grammar, the ';' is part of the statement in 'i=i++;'. 'i=i++' matches the nonterminal 'unused2' and the ';' matches the nonterminal 'optional_block', and together they form 'statement_with_semicolon' according to the production
statement_with_semicolon: unused2 optional_block
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-04-05 01:24: Subject: Autodoc
i=i++ is an expression. Every expression can also be a statement. i=i++; is an expression-statement followed by a semicolon.
/ Fredrik (Naranek) Hubinette (Real Build Master)
pike-devel@lists.lysator.liu.se