RosettaCodeData/Task/Introspection/Pop11/introspection-2.pop11
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

17 lines
453 B
Text

;;; We do main task in a procedure
define check_and_call(x, y);
lvars wx=consword(x), wy=consword(y);
if identprops(wx) = 0 and isprocedure(valof(wx))
and identprops(wy) = 0 then
return(valof(wx)(valof(wy)));
else
return("failed");
endif;
enddefine;
;;; Prints failed because bloop is undefined
check_and_call('abs' , 'bloop') =>
;;; Define bloop
vars bloop = -5;
;;; Now prints 5
check_and_call('abs' , 'bloop') =>