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

Side by Side Diff: sky/specs/script.md

Issue 919693007: Specs: Implement the Dispatcher classes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add zone support Created 5 years, 10 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
« no previous file with comments | « sky/specs/events.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Sky Script Language 1 Sky Script Language
2 =================== 2 ===================
3 3
4 The Sky script language is Dart. 4 The Sky script language is Dart.
5 5
6 The way that Sky integrates the module system with its script language 6 The way that Sky integrates the module system with its script language
7 is described in [modules.md](modules.md). 7 is described in [modules.md](modules.md).
8 8
9 When an method defined as ``external`` receives an argument, it must 9 When an method defined as ``external`` receives an argument, it must
10 type-check it, and, if the argument's value is the wrong type, then it 10 type-check it, and, if the argument's value is the wrong type, then it
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 to a superclass' constructor, wherein the subclass' constructor has 98 to a superclass' constructor, wherein the subclass' constructor has
99 the same arguments as the superclass' constructor and does nothing 99 the same arguments as the superclass' constructor and does nothing
100 but invoke that superclass' constructor with the same arguments. The 100 but invoke that superclass' constructor with the same arguments. The
101 syntax for defining this is, within the class body for a class 101 syntax for defining this is, within the class body for a class
102 called ClassName: 102 called ClassName:
103 103
104 ```dart 104 ```dart
105 ClassName = SuperclassName; 105 ClassName = SuperclassName;
106 ClassName.namedConstructor = SuperclassName.otherNamedConstructor; 106 ClassName.namedConstructor = SuperclassName.otherNamedConstructor;
107 ``` 107 ```
108
109 * It is assumed that the standard library includes something that
110 matches this pattern:
111
112 ```dart
113 class DispatcherController<T> {
114 Dispatcher<T> _dispatcher;
115 Dispatcher<T> get dispatcher => _dispatcher;
116
117 void add(T data) {
118 // ...
119 }
120 }
121 typedef bool Filter<T>(T t);
122 typedef void Handler<T>(T t);
123 class Dispatcher<T> {
124 Dispatcher<T> where(Filter<T> filter) { /*...*/ return this; }
125 void listen(Handler<T> handler) { /* ... */ }
126 }
127 class ExceptionListException<T> extends Exception with IterableMixin<T> {
128 List<T> _exceptions;
129 void add(T exception) {
130 if (_exceptions == null)
131 _exceptions = new List<T>();
132 _exceptions.add(exception);
133 }
134 int get length => _exceptions == null ? 0 : _exceptions.length;
135 Iterator<T> iterator() => _exceptions.iterator();
136 }
137 ```
OLDNEW
« no previous file with comments | « sky/specs/events.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698