Skip to content

Commit 45764e6

Browse files
committed
.topics/Syntax: Document new function chaining, remove old inheritance mess
1 parent 9a0b950 commit 45764e6

File tree

3 files changed

+27
-37
lines changed

3 files changed

+27
-37
lines changed

.topics/Syntax.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ print("Hello World!");
227227
io["write"]("Hello World!\n");
228228
```
229229

230+
Function calls can also be chained on one another.
231+
232+
```fuse
233+
Object():method();
234+
Try(x):catch(IOError, handle_io_error);
235+
File("output.log"):with(\file-> {
236+
file:write("Message!");
237+
});
238+
```
239+
230240
### Assignment and Destructuring
231241

232242
#### Valid Names
@@ -513,21 +523,6 @@ class ExampleClass extends Object {
513523
(ExampleClass()):print() -- <ExampleClass(){example.fuse#1}> => ExampleClass()
514524
```
515525

516-
If a certain method is needed somewhere in the inheritance chain, it can be
517-
accessed before the method call by using angle brackets surrounding the class
518-
for which to call the method. If there is only one instance of the method, it
519-
is not required to use this format to call the method.
520-
521-
```fuse
522-
class ExampleClass extends Object {
523-
example_method()=> print("hi!")
524-
}
525-
class ExampleClassToo extends ExampleClass {
526-
example_method()=> print("hello!");
527-
}
528-
(ExampleClassToo()):example_method<ExampleClass>(); -- hi!
529-
```
530-
531526
### Interfaces
532527

533528
Interfaces are a basic extension onto classes that essentially ensure that a
@@ -556,7 +551,7 @@ again to avoid errors.
556551
```fuse
557552
class UseDirAndPrint extends UseDir implements IScope {
558553
__init(dir)=> {
559-
self:__init<UseDir>(self); -- initialize in extended class
554+
self.__super.__init(self);
560555
print(dir);
561556
}
562557
}

docs/topics/FusionScript.md.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ <h3>Building</h3>
250250
</div> <!-- id="main" -->
251251
<div id="about">
252252
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
253-
<i style="float:right;">Last updated 2017-05-08 14:30:27 </i>
253+
<i style="float:right;">Last updated 2017-05-08 19:58:29 </i>
254254
</div> <!-- id="about" -->
255255
</div> <!-- id="container" -->
256256
</body>

docs/topics/Syntax.md.html

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@ <h3>Function Calls</h3>
328328
</pre>
329329

330330

331+
<p>Function calls can also be chained on one another.</p>
332+
333+
334+
<pre>
335+
Object():method();
336+
Try(x):catch(IOError, handle_io_error);
337+
File(<span class="string">"output.log"</span>):with(\file-&gt; {
338+
file:write(<span class="string">"Message!"</span>);
339+
});
340+
</pre>
341+
342+
331343
<h3>Assignment and Destructuring</h3>
332344

333345
<h4>Valid Names</h4>
@@ -655,23 +667,6 @@ <h2>Class Definitions</h2>
655667
</pre>
656668

657669

658-
<p>If a certain method is needed somewhere in the inheritance chain, it can be
659-
accessed before the method call by using angle brackets surrounding the class
660-
for which to call the method. If there is only one instance of the method, it
661-
is not required to use this format to call the method.</p>
662-
663-
664-
<pre>
665-
class ExampleClass extends Object {
666-
example_method()=&gt; <span class="global">print</span>(<span class="string">"hi!"</span>)
667-
}
668-
class ExampleClassToo extends ExampleClass {
669-
example_method()=&gt; <span class="global">print</span>(<span class="string">"hello!"</span>);
670-
}
671-
(ExampleClassToo()):example_method&lt;ExampleClass&gt;(); <span class="comment">-- hi!</span>
672-
</pre>
673-
674-
675670
<h3>Interfaces</h3>
676671

677672
<p>Interfaces are a basic extension onto classes that essentially ensure that a
@@ -703,8 +698,8 @@ <h3>Interfaces</h3>
703698
<pre>
704699
class UseDirAndPrint extends UseDir implements IScope {
705700
__init(dir)=&gt; {
706-
self:__init&lt;UseDir&gt;(self); <span class="comment">-- initialize in extended class
707-
</span> <span class="global">print</span>(dir);
701+
self.__super.__init(self);
702+
<span class="global">print</span>(dir);
708703
}
709704
}
710705
</pre>
@@ -715,7 +710,7 @@ <h3>Interfaces</h3>
715710
</div> <!-- id="main" -->
716711
<div id="about">
717712
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
718-
<i style="float:right;">Last updated 2017-05-07 19:28:08 </i>
713+
<i style="float:right;">Last updated 2017-05-08 19:59:06 </i>
719714
</div> <!-- id="about" -->
720715
</div> <!-- id="container" -->
721716
</body>

0 commit comments

Comments
 (0)