anchor.diff:          print >>f, "    r = hal_export_funct(buf, (void(*)(void *inst, long))%s, inst, %s, 0, comp_id);" % (
               to_c(name), int(fp))
           print >>f, "    if(r != 0) return r;"
  -    print >>f, "    inst->_next = first_inst;"
  -    print >>f, "    first_inst = inst;"
  +    print >>f, "    if(last_inst) last_inst->_next = inst;"
  +    print >>f, "    last_inst = inst;"
  +    print >>f, "    if(!first_inst) first_inst = inst;"
       print >>f, "    return 0;"
       print >>f, "}"
   
  
positive.code:         print >>f, "#include <stdlib.h>"
  
      print >>f, "struct state *inst=0;"
      print >>f, "struct state *first_inst=0;"
      
      print >>f
      for name, fp in functions:
  
negative.code:         print >>f, ".SH FUNCTIONS"
          for _, name, fp, doc in finddocs('funct'):
              print >>f, ".TP"
              if not options.get("singleton"):
                  print >>f, "\\fB%s\\fR" % to_hal_man_unnumbered("all")
                  print >>f, ".TQ"
              print >>f, "\\fB%s\\fR" % to_hal_man(name),
              if fp:
                  print >>f, "(uses floating-point)"
  