public void writeSymbol(CycSymbol cycSymbol)
                   throws IOException {
    if (trace == API_TRACE_DETAILED) {
      Log.current.println("writeSymbol = " + cycSymbol);
    }

    if (cycSymbol.isKeyword()) {
      writeKeyword(cycSymbol);

      return;
    }

    if (cycSymbol.equals(CycObjectFactory.nil)) {
      if (trace == API_TRACE_DETAILED) {
        Log.current.println("writing CFASL_NIL");
      }

      write(CFASL_NIL);
    }
    else {
      write(CFASL_SYMBOL);
      writeString(cycSymbol.toCanonicalString());
    }
  }