Anonymous user
Function prototype: Difference between revisions
→{{header|REXX}}: added the REXX computer programming language.
(→{{header|REXX}}: added the REXX computer programming language.) |
|||
Line 844:
(: two-args (Integer Integer -> Any))
(define (two-args a b) (void))</lang>
=={{header|REXX}}==
In the REXX language, there is no difference between functions and
subroutines, <big> ''except that'' </big> functions
''must'' return a value, even if that value is a
"null" (empty string).
In REXX, if a function doesn't return a value,
a ''syntax'' condition is raised.
REXX has no need of pre─allocating a prototype (such as required
arguments and the like) for functions or subroutines, but there
are facilities (in the form of BIFs) to assist the REXX programmer to easily
determine the number of arguments passed (if any), and perform
(and/or enforce) any necessary argument passing (including
the ''type'' of values or variables passed), and
also including checking for omitted arguments. In effect, the
relaxation of requirements/rules for function or subroutine invocations has
been moved from the compile stage (for REXX, the parsing/interpretive) stage)
to the execution stage.
<small>Note: REXX is an interpretive language. </small>
<br><br>
=={{header|SNOBOL4}}==
|