Common Lisp Unbound Variable -
is possible use uninitialized variable function argument? assignment, have use clos write semantic network system, , professor included test function test our output, , 1 of them specifies:
(print (def-concept human))
,
which implies passing argument human function def-concept. when running test function, cannot away error (in allegro cl):
error: attempt take value of unbound variable
human'.`
as first function in test, there no initializing of variables before this. there way around passing uninitialized variable argument of function?
thanks in advance.
it not possible use unitialized value function argument in regular common lisp function call. common lisp uses eager evaluation: argument expressions reduced values before function call takes place.
i suspect maybe don't understand structure of homework assignment.
if def-concept
function expects value, , human
not defined, cannot test function.
perhaps expected define variable human
, load file containing (print (def-concept human))
.
just because there nothing prior form in same file doesn't mean no prior evaluation possible. other files can loaded before file, or forms evaluated in listener.
Comments
Post a Comment