17 lines
453 B
Text
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') =>
|