Content deleted Content added
Ritchie333 (talk | contribs) m Removing link(s): Wikipedia:Articles for deletion/V (programming language) (2nd nomination) closed as delete (XFDcloser) |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 21:
Joy is unusual (except for [[function-level programming]] languages and some esoteric ones, such as [[unlambda]]) in its lack of a [[lambda calculus|lambda]] operator, and therefore lack of [[Parameter (computer science)|formal parameters]]. To illustrate this with a common example, here is how the square function might be defined in an [[imperative programming language]] ([[C (programming language)|C]]):
<
int square(int x)
{
return x * x;
}
</syntaxhighlight>
The variable x is a formal parameter which is replaced by the actual value to be squared when the function is called. In a [[functional programming|functional]] language ([[Scheme (programming language)|Scheme]]) the same function could be defined:
<
(define square
(lambda (x)
(* x x)))
</syntaxhighlight>
This is different in many ways, but it still uses the formal parameter x in the same way. In Joy the square function is defined:
|