diff options
Diffstat (limited to 'ipl/procs/prockind.icn')
-rw-r--r-- | ipl/procs/prockind.icn | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ipl/procs/prockind.icn b/ipl/procs/prockind.icn new file mode 100644 index 0000000..b64daa8 --- /dev/null +++ b/ipl/procs/prockind.icn @@ -0,0 +1,40 @@ +############################################################################ +# +# File: prockind.icn +# +# Subject: Procedure to indicate kind of procedure +# +# Author: Ralph E. Griswold +# +# Date: January 4, 1994 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# prockind(p) produces a code for the kind of the procedure p as follows: +# +# "p" (declared) procedure +# "f" (built-in) function +# "o" operator +# "c" record constructor +# +# It fails if p is not of type procedure. +# +############################################################################ + +procedure prockind(p) + + if type(p) ~== "procedure" then fail + + image(p) ? { + if find("procedure") then return "p" + if find("record constructor") then return "c" + ="function " + if upto(&letters) then return "f" else return "o" + } + +end + |