[DGD]typechecking=2

Kevin Carpenter kevinc at monrou.com
Sun Oct 10 22:13:08 CEST 1999


With typechecking=2 in my configuration file, some previously used code
now compile bombs with a "incompatible types for equality (string, int)"
message.

Specifically, the code fragment:

string who_called() {
   string prev_name;
   prev_name = previous_program(1);
   if (prev_name == 0) prev_name = driver_name;
   return prev_name;

Dies at the "if" statement. 

previous_program() is the kfun, which is documented to return a string or 0.

Changing the equate to "prev_name == nil" works.

Likewise, problems exist if find_object() and other kfuns that are documented
to return 0 for code fragments like:

object call_object(string objname) {
   object rc;

   rc = find_object(objname);
   if (rc == 0) rc = compile_object(objname);
   return rc;
}

Again, changing the equate to nil passes the compilation check.

The question is:  do these kfuns really return nil?  With typechecking=2,
zero and nil are different, right?

-- 
Kevin Carpenter
Kevin's Home Page: http://www.monrou.com/kevinc
(Expressing his comments from home in St. Louis, where this message originated)

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list