Jump to content

Talk:Conditional (computer programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dmeranda (talk | contribs) at 15:23, 5 July 2007 (Ada elsif and the dangling-else problem). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

It would be great if this article mentioned, briefly, how this is done in binary. Nothing major, but I think a small discussion about operators and how the AND, NOT, and OR operators work to evaluate and If...Then statement. Sir Isaac Lime 16:36, 19 July 2006 (UTC)[reply]

If statements in Wiki markup language.

This page should also include examples of IF statements in the Wiki markup language. Robert Elliott 07:09, 28 January 2007 (UTC)[reply]

That would be self reference, which would violate NPOV. If we did that, we'd have to include statements in all languages. A dab link could however be used to direct the reader to a page in the WP: namespace. Richard001 20:17, 3 February 2007 (UTC)[reply]

Ada elsif and the dangling-else problem

The article mentions else-if constructs without covering the dangling-else problem, even though C/C++ is shown in examples & the cross reference and it can occur in those languages. Also, in section Conditional_statement#Else_If_parts the assertion is made that elseif, in Ada, is simply syntactic sugar for else followed by if, which is incorrect. A brief description of the the dangling-else problem and how the Ada syntax avoids it can be found here. Does anyone object to adding material on dangling-else and correcting the assertion on Ada syntax? Tslavens 23:13, 3 July 2007 (UTC)[reply]

There already is an entire article on Dangling else; this article should definitely either link to it, or perhaps a merge may make sense. As for as the Ada example goes, the 'elseif' is in fact just syntactic sugar, but not as its described; the description needs fixed. Also note that other languages, like Python, have an 'elif' which is needed because of the lack of curly-braces or other means to delimit a sequence-of-statements, but it certainly does not suffer from a dangling-else problem....so there may be different motivations for an else-if than just the Ada case. - Dmeranda 15:23, 5 July 2007 (UTC)[reply]