public static StorageSlot defineExternalSlotFromParseTree(Cons parsetree) {
    if (Cons.badArgumentRangeP(parsetree, 2, Stella.NULL_INTEGER)) {
      return (null);
    }
    if ((!Stella_Object.symbolP(parsetree.rest.value)) ||
        ((!Stella_Object.symbolP(parsetree.rest.rest.value)) ||
         (!(((parsetree.nthRest(3).length()) % 2) == 0)))) {
      { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

        try {
          Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
          Stella.signalTranslationError();
          if (!(Stella.suppressWarningsP())) {
            Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
            {
              Stella.STANDARD_ERROR.nativeStream.println();
              Stella.STANDARD_ERROR.nativeStream.println(" Illegal external slot definition: `" + Stella_Object.deUglifyParseTree(parsetree) + "'.");
            }
;
          }

        } finally {
          Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
        }
      }
      return (null);
    }
    { Symbol classname = ((Symbol)(parsetree.rest.value));
      Surrogate owner = Stella_Object.typify(classname);
      Stella_Class ownerclass = ((Stella_Class)(owner.surrogateValue));
      StorageSlot slot = null;
      Cons options = parsetree.nthRest(3);
      Module marker = Stella.$STELLA_MODULE$;
      boolean abstractP = false;

      if (ownerclass == null) {
        { Object old$PrintreadablyP$001 = Stella.$PRINTREADABLYp$.get();

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            Stella.signalTranslationError();
            if (!(Stella.suppressWarningsP())) {
              Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
              {
                Stella.STANDARD_ERROR.nativeStream.println();
                Stella.STANDARD_ERROR.nativeStream.println(" Can't define a slot on the non-existent class `" + Stella_Object.deUglifyParseTree(classname) + "'.");
              }
;
            }

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$001);
          }
        }
        return (null);
      }
      while (!(options == Stella.NIL)) {
        { Stella_Object option = options.value;
          Stella_Object value = options.rest.value;

          if (Stella.$UNSUPPORTED_EXTERNAL_SLOT_OPTIONS$.memberP(option)) {
            if ((!(option == Stella.KWD_ALLOCATION)) ||
                (!(value == Stella.KWD_DYNAMIC))) {
              { Object old$PrintreadablyP$002 = Stella.$PRINTREADABLYp$.get();

                try {
                  Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                  Stella.signalTranslationWarning();
                  if (!(Stella.suppressWarningsP())) {
                    Stella.printErrorContext(">> WARNING: ", Stella.STANDARD_WARNING);
                    {
                      Stella.STANDARD_WARNING.nativeStream.println();
                      Stella.STANDARD_WARNING.nativeStream.println(" Skipping slot option `" + Stella_Object.deUglifyParseTree(option) + "' which is unsupported on external slots.");
                    }
;
                  }

                } finally {
                  Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$002);
                }
              }
            }
            options.firstSetter(marker);
            if (value != null) {
              options.secondSetter(marker);
            }
          }
          if (((option == Stella.KWD_ABSTRACTp) &&
              (value == Stella.SYM_STELLA_TRUE)) ||
              (option == Stella.KWD_RENAMES)) {
            abstractP = true;
          }
        }
        options = options.rest.rest;
      }
      if ((!abstractP) &&
          (ownerclass.classFinalizedP &&
           (!Surrogate.subtypeOfP(owner, Stella.SGT_STELLA_DYNAMIC_SLOTS_MIXIN)))) {
        { Object old$PrintreadablyP$003 = Stella.$PRINTREADABLYp$.get();

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            Stella.signalTranslationError();
            if (!(Stella.suppressWarningsP())) {
              Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
              {
                Stella.STANDARD_ERROR.nativeStream.println();
                Stella.STANDARD_ERROR.nativeStream.println(" Can't define a non-abstract external slot on class `" + Stella_Object.deUglifyParseTree(classname) + "',");
                Stella.STANDARD_ERROR.nativeStream.println(" since it does not inherit DYNAMIC-SLOTS-MIXIN.");
              }
;
            }

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$003);
          }
        }
        return (null);
      }
      parsetree = parsetree.remove(marker);
      if (!(abstractP)) {
        parsetree = parsetree.concatenate(Cons.list$(Cons.cons(Stella.KWD_ALLOCATION, Cons.cons(Stella.KWD_DYNAMIC, Cons.cons(Stella.NIL, Stella.NIL)))), Stella.NIL);
      }
      slot = Cons.defineStorageSlotFromParseTree(parsetree.rest.rest, owner);
      if (slot != null) {
        Slot.attachSlotToOwner(slot);
      }
      return (slot);
    }
  }