コード例 #1
0
    @Override
    public int compare(LispPtr e1, LispPtr e2) {
      try {
        if (LispStandard.InternalStrictTotalOrder(_env, e1, e2)) return -1;

        if (LispStandard.InternalEquals(_env, e1, e2)) return 0;

      } catch (Exception e) {
        // this shouldn't happen, right?
        System.exit(255);
      }

      return 1;
    }
コード例 #2
0
 static LispObject New(LispEnvironment aEnvironment, String aString) throws Exception {
   LispObject self;
   if (LispStandard.IsNumber(aString, true)) // check if aString is a number (int or float)
   {
     /// construct a number from a decimal string representation (also create a number object)
     self = new LispNumber(aString, aEnvironment.Precision());
   } else {
     self = new LispAtom(aEnvironment.HashTable().LookUp(aString));
   }
   return self;
 }