If Type – Talk
Jump to navigation
Jump to search
The article states that the so-called if type is a "helper type". I need a stricter definition of both the "if type" and the concept of "helper type" in general. To help you understand what I'm asking, look at the following:
if ( expression )
As you can see, that is an incomplete if statement. Is the term "if type" meant to refer to the part of an if statement consisting of the reserved word if followed by a boolean expression enclosed in parentheses, as exemplified above? If not, clarify in good, unambiguous english. Killswitch 02:01, 24 March 2007 (CET)
- In the BI comref that I have the If Type is defined exactly the same way as the Wiki defines it.
- If Type to my way of seeing it is perfectly understandable:
- if exitWith code
- The if in the syntax definition represents the fact that a conditional is the first parameter.
- if is the condition, which can be the condition you write that determines when to exit, in this example.
- if: If Type ... in the parameter section says what sort of conditional statement it is.
- I agree that the If Type could probably do with a better definition, but the present definition does point to :the if and then commands to aid in determining what type of condition to use.
- Planck 12:55, 24 March 2007 (CET)
- The if type is quite understandable by both you and I since we're used to programming and scripting. Getting back to the actual question, the term is indeed in need of a better definition. The reason for that is how it's used on the reference pages where it occurs (then,exitWith). It is potentially confusing to newcomers to use the reserved word "if" to represent an "if type condition". The reserved word if and an if type condition are different things. A similar confusing use of reserved words is seen on the then page, where the reserved word else is used to represent the Code or Array that ends an if..then construct.
- A better way of describing the syntax can be seen on the for_do page, where the part that comes before the word do is forCommand, referring to a For_Type. In the end, I'm looking for two things:
- Perhaps we can solve the first one right here? The terms if type and if type condition might be equivalent and refer to a language construct of the following form:
- IfTypeCondition:
- if ( expression )
- IfTypeCondition:
- If that can serve as a definition of the term if type, the article can be improved. On the other hand, on the Talk:Control_Structures page, Suma states that 'there are actually no "Control Structures" in this scripting language, only expressions.' Would that suggest that if type is a term used to describe the result of the evaulation of an "if-expression", not the syntactic form of the "if type condition" as above?
- Killswitch 16:28, 24 March 2007 (CET)