Exemple #1
0
 @Subroutine(value = "string-match")
 public static LispObject stringMatch(
     Environment environment, LispString regexp, LispString string, @Optional LispInteger start) {
   int from = 0;
   if (start != null) {
     from = start.getData();
     if (from < 0 || from >= string.size())
       throw new ArgumentOutOfRange(string.toString(), start.toString());
   }
   LispSymbol s = environment.find("case-fold-search");
   int r =
       string.match(
           environment, regexp, from, (s != null && !s.getValue().equals(LispSymbol.ourNil)));
   if (r == -1) return LispSymbol.ourNil;
   return new LispInteger(r);
 }
Exemple #2
0
 @Subroutine("string-equal")
 public static LispSymbol stringEqual(LispObject one, LispObject two) {
   String s1 = getDataOrName(one);
   String s2 = getDataOrName(two);
   return LispSymbol.bool(s1.equals(s2));
 }