Any relation can be represented as a function, for example as its
characteristic function.  But this function is not the same as the
original relation.

Describing functions as a special case of relations is important in
math, because it shows that functions is no deeper than sets.

Mathematical functions in computer science are sometimes called pure
functions: they always give the same result for the same arguments,
and have no side effects. Knowing a function is a pure function means
that it can be memoized and lazily evaluted.

Functions like ? are not pure functions: they depend on some state
which is hidden in the sense that it does not appear in the function
arguments.  Input functions are even worse unless you assume that the
input is supplied with the program, and so can be regarded as part of
the program state.  This makes sense for batch jobs but not
interactive programs.

Best wishes,

John

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to