TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
> ...
> Also, in some languages, functions are recursive - you can use a
> function in an expression that is an argument for the same function. I
> don't think you can do that with routines, though I've been wrong
> before. This, of course, is language dependent.
> If I were you, I'd refer to the function without the parens. Our written
> style calls for capitalizing language elements named in sentences, but
> this is up to you. ...
> |Len Olszewski
Len-
It is not recursion when the value of a function invocation is the argument
(or parameter) of another invocation of the same function. For example,
frthrt = sqrt(sqrt(x))
This is just nested calls to the function. Of course, you cannot do this
with a subroutine because it does not return a value to use as an argument.
The _Dictionary of Computing_ defines recursion as "the process of defining
or expressing a function, procedure, language construct, or the solution to
a problem in terms of itself..." So both functions and procedures can be
recursive. For example:
function factorial(i)
if i > 1 then
return i * factorial(i - 1)
else
return 1
procedure printlist(list)
print item(list)
if next(list) <> null then
printlist(next(list))
return
The function says, "If the argument is greater than one, return the product
of the argument and the function called on one less than the argument.
Other wise, return one."
The procedure says, "Print the current item on the list. If there are more
items on the list, print the rest of the list."
Of course, the examples aren't in any particular language, but recursion is
available in many.
Regarding "capitalizing language elements," at least one popular language
(the C programming language) is case-sensitive, so this is not generally
possible. (I prefer using boldface to distinguish keywords, names of
functions, and the like, but some writers I have worked with think this
puts too much bold on a typical page and makes it harder to read. I
disagree.)
-Fred
--
INTERNET: fred -at- boole -dot- com PHONE: (408) 524-3292 FAX: (408) 730-0558
USPS: Fred Jacobson / Boole & Babbage / 510 Oakmead Pkwy / Sunnyvale CA 94086