public static Slot defineStellaSlot(Symbol name, Surrogate owner, Surrogate basetype, Cons typespecifier, KeywordKeyValueList options) {
    { StorageSlot slot = StorageSlot.newStorageSlot();

      slot.slotName = name;
      slot.slotOwner = owner;
      slot.slotBaseType = basetype;
      if (!(typespecifier == Stella.NIL)) {
        KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_TYPE_SPECIFIER, ((CompoundTypeSpecifier)(typespecifier.yieldTypeSpecifier())), null);
      }
      { Keyword key = null;
        Stella_Object value = null;
        KvListIterator iter000 = ((KvListIterator)(options.allocateIterator()));

        while (iter000.nextP()) {
          key = ((Keyword)(iter000.key));
          value = iter000.value;
          if (key == Stella.KWD_PUBLICp) {
            slot.slotPublicP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_REQUIREDp) {
            slot.slotRequiredP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_COMPONENTp) {
            slot.slotComponentP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_READ_ONLYp) {
            slot.slotReadOnlyP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_ACTIVEp) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_STORED_ACTIVEp, ((BooleanWrapper)(value)), null);
          }
          else if (key == Stella.KWD_CONTEXT_SENSITIVEp) {
            slot.slotContextSensitiveP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_HARDWIREDp) {
            slot.slotHardwiredP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_ABSTRACTp) {
            slot.abstractP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
          }
          else if (key == Stella.KWD_ALLOCATION) {
            if (value == Stella.KWD_CLASS) {
              {
                Stella.STANDARD_WARNING.nativeStream.println("Warning: In definition of slot `" + slot + "': ':class' allocation is unsupported right now.");
                Stella.STANDARD_WARNING.nativeStream.println(" Maybe use ':hardwired? TRUE' for read-only slots.");
              }
;
            }
            else {
              KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_ALLOCATION, ((Keyword)(value)), null);
            }
          }
          else if (key == Stella.KWD_INITIALLY) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_INITIAL_VALUE, value, null);
          }
          else if (key == Stella.KWD_DEFAULT) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_DEFAULT_EXPRESSION, value, null);
          }
          else if (key == Stella.KWD_READER) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_READER, ((Symbol)(value)), null);
          }
          else if (key == Stella.KWD_WRITER) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_WRITER, ((Symbol)(value)), null);
          }
          else if (key == Stella.KWD_INVERSE) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_INVERSE, ((Symbol)(value)), null);
          }
          else if (key == Stella.KWD_RENAMES) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_RENAMES, ((Symbol)(value)), null);
          }
          else if (key == Stella.KWD_DOCUMENTATION) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_DOCUMENTATION, StringWrapper.wrapString(((StringWrapper)(value)).wrapperValue), Stella.NULL_STRING_WRAPPER);
          }
          else if (key == Stella.KWD_PROPERTIES) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_PROPERTIES, ((List)(value)), null);
          }
          else if (key == Stella.KWD_META_ATTRIBUTES) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_META_ATTRIBUTES, ((KeyValueList)(value)), null);
          }
          else if (key == Stella.KWD_OPTION_KEYWORD) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_OPTION_KEYWORD, ((Keyword)(value)), null);
          }
          else if (key == Stella.KWD_OPTION_HANDLER) {
            KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_OPTION_HANDLER, ((Symbol)(value)), null);
          }
          else {
            if (!(Stella_Object.runOptionHandlerP(slot, key, value))) {
              { Object old$PrintreadablyP$000 = 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 invalid slot option `" + Stella_Object.deUglifyParseTree(key) + "'");
                      Stella.STANDARD_WARNING.nativeStream.println("in the definition of slot `" + Symbol.internSymbolInModule(owner.symbolName, ((Module)(owner.homeContext)), true) + "'.`" + Stella_Object.deUglifyParseTree(name) + "'.");
                    }
;
                  }

                } finally {
                  Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
                }
              }
            }
          }
        }
      }
      if ((slot.slotAllocation() == null) &&
          (basetype == Stella.SGT_STELLA_BOOLEAN)) {
        KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_ALLOCATION, Stella.KWD_BIT, null);
      }
      return (slot);
    }
  }