Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: packages/petitparser/lib/src/lisp/cons.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 part of petitparser.lisp;
2
3 /// The basic data structure of LISP.
4 class Cons {
5
6 /// The head of the cons.
7 dynamic head;
8
9 /// The tail of the cons.
10 dynamic tail;
11
12 /// Constructs a cons.
13 Cons(this.head, this.tail);
14
15 @override
16 bool operator ==(other) {
17 return other is Cons && head == other.head && tail == other.tail;
18 }
19
20 @override
21 int get hashCode => 31 * head.hashCode + tail.hashCode;
22
23 @override
24 String toString() {
25 var buffer = new StringBuffer();
26 buffer.write('(');
27 var current = this;
28 while (current is Cons) {
29 buffer.write(current.head.toString());
30 current = current.tail;
31 if (current != null) {
32 buffer.write(' ');
33 }
34 }
35 if (current != null) {
36 buffer.write('. ');
37 buffer.write(current);
38 }
39 buffer.write(')');
40 return buffer.toString();
41 }
42 }
OLDNEW
« no previous file with comments | « packages/petitparser/lib/src/json/parser.dart ('k') | packages/petitparser/lib/src/lisp/environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698