cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

if-function

ValeryOchkov
24-Ruby IV

if-function

The If-function works not correct:

Val

http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
8 REPLIES 8

The differences in "if" is that one is in italics which makes it a variable and the other in in normal font which makes it a function.

On 8/25/2009 11:53:54 AM, Derbigdog wrote:
>The differences in "if" is
>that one is in italics which
>makes it a variable and the
>other in in normal font which
>makes it a function.
And what about others functions?!

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

On 8/25/2009 1:06:38 PM, VFO wrote:
>On 8/25/2009 11:53:54 AM, Derbigdog
>wrote:
>>The differences in "if" is
>>that one is in italics which
>>makes it a variable and the
>>other in in normal font which
>>makes it a function.
>And what about others functions?!
>
>Val
>http://twt.mpei.ac.ru/ochkov/v_ochkov.ht
>m

Tom is correct it is a keyword, and that also uses a different font (keywords are bold) than a variable (italics) to distinguish it.

This was discussed in another thread in this section. If, despite some documentation that suggests otherwise, is not a function (never has been, can't be) but a keyword. MC' insists on having it so labeled for it to be recognized.
__________________
� � � � Tom Gutman

On 8/25/2009 4:31:58 PM, Tom_Gutman wrote:
>This was discussed in another
>thread in this section. If,
>despite some documentation
>that suggests otherwise, is
>not a function (never has
>been, can't be) but a keyword.
>MC' insists on having it so
>labeled for it to be
>recognized.
>__________________
>� � � � Tom Gutman
What is in Mathcad Prime a difference between function and keyword?
I know one keyword in Mathcad 14 - Given.
I think if in Mathcad is classic function - the if function has arguments (3) and returns a value (1 or 0).
What is it the "function" until? It does not work by keyword lable or functions?! Try please.
I have tried to realize the bisection method roots finding in Mathcad Prime. See
http://twt.mpei.ac.ru/ochkov/Mathcad_12/6_01_Until.png
Without programming we can use if and until functions for creating some algorithms.

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

A function takes some number of values as arguments. As such, all of the expressions representing arguments to a function are evaluated before the function is invoked. That is not the case for if.

If is recognized by MC' as a keyword (LISP concept of special form) and the arguments are the unevaluated expressions, with the rules for evaluation of the arguments specific to the specific special form. For if, only one of the last two arguments is evaluated, depending on the value of the evaluated first argument.

root is another special form (the arguments are left unevaluated and the first argument is evaluated within root within the context of a value set by root for the second operand). It shows the same behaviour as if, being recognized only if the keyword style is applied.
__________________
� � � � Tom Gutman

On 8/26/2009 3:54:15 AM, Tom_Gutman wrote:

>A function takes some number
>of values as arguments. As
>such, all of the expressions
>representing arguments to a
>function are evaluated before
>the function is invoked. That
>is not the case for if.
>
>If is recognized by MC' as a
>keyword (LISP concept of
>special form) and the
>arguments are the unevaluated
>expressions, with the rules
>for evaluation of the
>arguments specific to the
>specific special form. For
>if, only one of the last two
>arguments is evaluated,
>depending on the value of the
>evaluated first argument.
>
>root is another special form
>(the arguments are left
>unevaluated and the first
>argument is evaluated within
>root within the context of a
>value set by root for the
>second operand). It shows the
>same behaviour as if, being
>recognized only if the keyword
>style is applied.
>__________________
>� � � � Tom Gutman

OK! But I do not understand why simple MC' user must know it and take into it by a worksheet creating.
For example:
a - none or variable
kg - none or unit
e - none or constant
sin - none or function
ORIGIN - none or system
find - none or kew word (why not function)
if - ONLY kew word. It was my origin question!

And second question - I think variable, unit, constant, function and system lable is enough for Mathcad Prime 1.0.

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

May be if (and same others) is not a function, not a keyword but an operator?


Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
Announcements

Top Tags