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 Jarble (talk | contribs) at 00:39, 11 April 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputer science C‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

Template:Findsourcesnotice

Binary

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]
It should at least containa link to how to do IF-ELSE statements in Wiki markup language, for people who are desperately seeking the information and thought that the best known WIKI might be able to help. Cry. —Preceding unsigned comment added by 142.179.253.216 (talk) 00:07, 26 August 2008 (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]

Lisp cond in its own right, or as type of ifelse?

How about mentioning Lisp's "cond" form, either as a type of conditional statement in its own right, or as an if-then-ifelse- sequence bundled up into a single form? TheHouseOnTheHill (talk) 14:55, 2 October 2008 (UTC)[reply]

It just occurred to me independently that this is a very grave omission. It isn't a special case of if else, but rather a progenitor of the later form. It was described in 1959 by McCarthy in AI Memo 8, "Recursive Functions of Symbolic Expressions and their Computation by Machine.", though McCarthy used formal mathematical notation rather than the S-expressions that later became associated with Lisp.[1]
Let p₁,p₂,...,pk be expressions representing propositions and let e₁,...,ek be arbitrary expressions. The expression [p₁⎯⟶e₁,...pk⎯⟶ek] is called a conditional expression and its value is determined from the values assigned to the variables occuring in it as follows: If the value of p₁ is not defined neither is that of the conditional expression. If p₁ is defined and true the value of the conditional expression is that of e₁ if the latter is defined and otherwise is undefined. If p₁ is defined and false, then the value of [p₁⎯⟶e₁,...,pk⎯⟶ek] is that of [p₂⎯⟶e₂,...pk⎯⟶ek]. Finally if pk is false the value of [pk⎯⟶ek] is undefined.
Not bad for the 1950s! --TS 03:15, 28 April 2010 (UTC)[reply]


Should VHDL be included? 64.134.144.237 (talk) 18:25, 6 September 2012 (UTC)[reply]

Guard vs. conditional

Is there a good reason to discuss Guard (computing) separately from Conditional (programming)? --Abdull (talk) 13:23, 5 October 2010 (UTC)[reply]

I certainly agree that it should be discussed in this article. However, I think the guard article is substantial enough to remain a distinct article, so the same technique as with pattern matching could be used - write a short section here, with a main article link to the Guard article.--greenrd (talk) 20:58, 5 October 2010 (UTC)[reply]

This page is only part of Control flow, no reason to duplicate every paragraph to separate page IMO.

Current content of the Conditional (computer programming) is 70% duplication of Control flow.


For example, we don't have Restart loop (it was covered at Control_flow#Restart_loop) because it is trivial. Ushkin N (talk) 04:55, 22 May 2016 (UTC)[reply]