[Cmake] Strange
Ken Martin
ken . martin at kitware . com
Fri, 9 Aug 2002 13:48:07 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_00AD_01C23FAB.6417E400
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Yes I believe the arguments to ELSE and ENDIF could be made optional. Same
for the ENDFOREACH command. Making them required does force people to
document their files. In C/C++ long if statements are easier to read if they
are written as:
if (win32)
{
}
else // win32
{
} // win32
The current syntax forces people to do this. I can relax this syntax and let
people do
IF (WIN32)
GOOBER()
ELSE () # WIN32
GOOBER()
ENDIF () # WIN32
but then the comments can get out of sync with the actual IF. The current
syntax makes sure they stay consistent. I'm open to discussion although my
leaning would be to leave them as required.
Thanks
Ken
Given the correction to the ELSE command, is there any chance that the
arguments to ELSE
and ENDIF can be eliminated. It is confusing to people to see an IF and
an ELSE with the
same condition (arguments).
Jim
------=_NextPart_000_00AD_01C23FAB.6417E400
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4916.2300" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>Yes I =
believe the=20
arguments to ELSE and ENDIF could be made optional. Same for the =
ENDFOREACH=20
command. Making them required does force people to document their files. =
In=20
C/C++ long if statements are easier to read if they are written=20
as:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>if=20
(win32)</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
{</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
}</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>else =
//=20
win32</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
{</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
} //=20
win32</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>The =
current syntax=20
forces people to do this. I can relax this syntax and let people=20
do</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>IF=20
(WIN32)</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
GOOBER()</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>ELSE =
() #=20
WIN32</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002> =
GOOBER()</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>ENDIF =
() #=20
WIN32</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D639034217-09082002>but =
then the=20
comments can get out of sync with the actual IF. The current syntax =
makes=20
sure they stay consistent. I'm open to discussion although my leaning =
would be=20
to leave them as required.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D639034217-09082002>Ken</SPAN></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px =
solid; MARGIN-RIGHT: 0px">
<DIV><SPAN class=3D937431217-09082002><FONT color=3D#0000ff =
size=3D2>Given the=20
correction to the ELSE command, is there any chance that the arguments =
to=20
ELSE</FONT></SPAN></DIV>
<DIV><SPAN class=3D937431217-09082002><FONT color=3D#0000ff =
size=3D2>and ENDIF can=20
be eliminated. It is confusing to people to see an IF and =
an ELSE=20
with the</FONT></SPAN></DIV>
<DIV><SPAN class=3D937431217-09082002><FONT color=3D#0000ff =
size=3D2>same condition=20
(arguments).</FONT></SPAN></DIV>
<DIV><SPAN class=3D937431217-09082002><FONT color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D937431217-09082002><FONT color=3D#0000ff><FONT =
size=3D2>Jim<SPAN=20
class=3D639034217-09082002><FONT face=3DArial=20
color=3D#000000> </FONT></SPAN></FONT></FONT></SPAN><SPAN=20
class=3D937431217-09082002><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
=
class=3D639034217-09082002> </SPAN></FONT></FONT></SPAN></DIV></BLOC=
KQUOTE></BODY></HTML>
------=_NextPart_000_00AD_01C23FAB.6417E400--