MCPcopy Index your code
hub / github.com/clojure/clojure / AFunction

Class AFunction

src/jvm/clojure/lang/AFunction.java:18–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16import java.util.Comparator;
17
18public abstract class AFunction extends AFn implements IObj, Comparator, Fn, Serializable {
19
20private static final long serialVersionUID = 4469383498184457675L;
21
22public volatile MethodImplCache __methodImplCache;
23
24public IPersistentMap meta(){
25 return null;
26}
27
28public IObj withMeta(final IPersistentMap meta){
29 if(meta == null)
30 return this;
31 return new RestFn(){
32 protected Object doInvoke(Object args) {
33 return AFunction.this.applyTo((ISeq) args);
34 }
35
36 public IPersistentMap meta(){
37 return meta;
38 }
39
40 public IObj withMeta(IPersistentMap newMeta){
41 if(meta == newMeta)
42 return this;
43 return AFunction.this.withMeta(newMeta);
44 }
45
46 public int getRequiredArity(){
47 return 0;
48 }
49 };
50}
51
52public int compare(Object o1, Object o2){
53 Object o = invoke(o1, o2);
54
55 if(o instanceof Boolean)
56 {
57 if(RT.booleanCast(o))
58 return -1;
59 return RT.booleanCast(invoke(o2,o1))? 1 : 0;
60 }
61
62 Number n = (Number) o;
63 return n.intValue();
64}
65}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected