public object Apply(Interpreter i, Pair args, Environment env) { string s1 = (string)List.First(args); string s2 = (string)List.Second(args); return(Boolean.Create(s1 == s2)); }
public object Apply(Interpreter i, Pair args, Environment env) { long len = List.Length(args); if (len < 2) { throw new System.Exception("= expects at least 2 arguments"); } else { long currentInt = (long)args.Head; Pair currentPair = (Pair)args.Tail; while (currentPair != Pair.EmptyList) { long nextInt = (long)List.First(currentPair); if (currentInt != nextInt) { return(Boolean.Create(false)); } currentPair = (Pair)currentPair.Tail; } return(Boolean.Create(true)); } }
public object Apply(Interpreter i, Pair args, Environment env) { Symbol s = (Symbol)List.First(args); Symbol prop = (Symbol)List.Second(args); return((s.Properties.Contains(prop)) ? s.Properties[prop] : Boolean.Create(false)); }
public object Apply(Interpreter i, Pair args, Environment env) { object o1 = List.First(args); object o2 = List.Second(args); return(Boolean.Create( (o1 is long && o2 is long) ? (long)o1 == (long)o2 : (o1 is Character && o2 is Character) ? (Character)o1 == (Character)o2 : o1 == o2 )); }
public object Apply(Interpreter i, Pair args, Environment env) { object n1 = List.First(args); object n2 = List.Second(args); if (n1 is long && n2 is long) { long i1 = (long)n1; long i2 = (long)n2; return(Boolean.Create(i1 < i2)); } throw new System.Exception("Unrecognized <"); }
public object Apply(Interpreter i, Pair args, Environment env) { return(Boolean.Create(List.First(args) is Character)); }
public object Apply(Interpreter i, Pair args, Environment env) { Symbol s = (Symbol)List.First(args); return(Boolean.Create(s.IsGenSym())); }
public object Apply(Interpreter i, Pair args, Environment env) { int n = (int)List.First(args); return(Boolean.Create(n == 0)); }
public object Apply(Interpreter i, Pair args, Environment env) { object o = List.First(args); return(Boolean.Create(o != Pair.EmptyList && o is Pair)); }
public object Apply(Interpreter i, Pair args, Environment env) { return(Boolean.Create(List.First(args) == Pair.EmptyList)); }
public object Apply(Interpreter i, Pair args, Environment env) { object o = List.First(args); return(Boolean.Create(o == Boolean.TRUE || o == Boolean.FALSE)); }
public object Apply(Interpreter i, Pair args, Environment env) { return(Boolean.Create(List.First(args) == List.Second(args))); }