* @param options
   * @return Demon
   */
  public static Demon defineDemon(String name, Cons options) {
    { Demon demon = Demon.newDemon();
      PropertyList plist = PropertyList.newPropertyList();
      Cons conslist = Stella.NIL;
      Demon olddemon = null;
      boolean activateP = false;

      { Stella_Object item = null;
        Cons iter000 = options;
        Cons collect000 = null;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          item = iter000.value;
          if (collect000 == null) {
            {
              collect000 = Cons.cons(item, Stella.NIL);
              if (conslist == Stella.NIL) {
                conslist = collect000;
              }
              else {
                Cons.addConsToEndOfConsList(conslist, collect000);
              }
            }
          }
          else {
            {
              collect000.rest = Cons.cons(item, Stella.NIL);
              collect000 = collect000.rest;
            }
          }
        }
      }
      plist.thePlist = conslist;
      demon.demonName = name;
      activateP = plist.removeAt(Stella.KWD_ACTIVATEp) == Stella.TRUE_WRAPPER;
      if (Demon.incorporateDemonOptionsP(demon, plist)) {
        { 
          olddemon = Stella.lookupDemon(name);
          if (olddemon != null) {
            Demon.deactivateDemon(olddemon);
            olddemon.free();
          }
        }
        Stella.$DEMONS_TABLE$.insertAt(demon.demonName, demon);
        if (activateP) {
          Demon.activateDemon(demon);
        }
        return (demon);
      }
      demon.free();
      return (null);
    }
  }