1
2
3
4
5
6
7
8
9
10class Symbol extends Atom {
11
12 protected final
13 String name;
14
15
16
17 public
18 Symbol(String name) {
19 this.name = name;
20 }
21
22
23
24
25
26 public
27 SExpr isEqual(SExpr e2) {
28
29 if ( this == e2 )
30 return
31 t;
32
33 if ( ! ( e2 instanceof Symbol ) )
34 return
35 nil;
36
37 if ( name.equals( ((Symbol)e2).name ) )
38 return
39 t;
40
41 return
42 nil;
43 }
44
45
46
47 public
48 String toString() {
49 return
50 name;
51 }
52}