01: package gnu.kawa.functions;
02:
03: import gnu.expr.Language;
04:
05: /** Implement the standard Scheme procedure <tt>equal?</tt>
06: * and the Lisp <tt>equal</tt>. */
07:
08: public class IsEqual extends gnu.mapping.Procedure2 {
09: Language language;
10:
11: public IsEqual(Language language, String name) {
12: this .language = language;
13: setName(name);
14: }
15:
16: public static boolean apply(Object arg1, Object arg2) {
17: return arg1 == arg2 || (arg1 != null && arg1.equals(arg2));
18: }
19:
20: public Object apply2(Object arg1, Object arg2) {
21: return language.booleanObject(apply(arg1, arg2));
22: }
23:
24: }
|