Permalink
Browse files

beh, lost changes from the office.

  • Loading branch information...
1 parent 4e31c29 commit ea9b905e1ad63beb281f4055e7aa34cd46580553 @maxtaco committed with Jan 9, 2012
Showing with 2 additions and 74 deletions.
  1. +1 −0 documentation/coffee/tame_inc.coffee
  2. +1 −74 index.html
View
1 documentation/coffee/tame_inc.coffee
@@ -0,0 +1 @@
+tameRequire(window)
View
75 index.html
@@ -490,80 +490,7 @@
<span id ="tame" class = "bookmark"></span>
<b class="header">Tame Basics</b>
</p>
- <div class='code'><pre class="idle">
-delay = (n, v, cb) -&gt;
- await setTimeout defer(), n
- alert v
- cb
-
-await
- delay 4, &quot;dog&quot;, defer()
- delay 8, &quot;cat&quot;, defer()
-await delay 2, &quot;bird&quot;, defer()
-
-</pre><pre class="idle"><span class="Storage">var</span> delay, tame, __tame_deferrals, __tame_k,
- __slice <span class="Keyword">=</span> <span class="LibraryClassType">Array</span>.<span class="LibraryConstant">prototype</span>.slice,
- _this <span class="Keyword">=</span> <span class="Variable">this</span>;
-
-
-tame <span class="Keyword">=</span> {
- Deferrals: (<span class="Storage">function</span>() {
-
- <span class="Storage">function</span> <span class="FunctionName">_Class</span>(<span class="FunctionArgument">_arg</span>) {
- <span class="Variable">this</span>.continuation <span class="Keyword">=</span> _arg;
- <span class="Variable">this</span>.count <span class="Keyword">=</span> <span class="Number">1</span>;
- <span class="Variable">this</span>.ret <span class="Keyword">=</span> <span class="BuiltInConstant">null</span>;
- }
-
- <span class="LibraryClassType">_Class</span>.<span class="LibraryConstant">prototype</span>.<span class="FunctionName">_fulfill</span> = <span class="Storage">function</span>() {
- <span class="Keyword">if</span> (<span class="Keyword">!</span><span class="Keyword">--</span><span class="Variable">this</span>.count) <span class="Keyword">return</span> <span class="Variable">this</span>.continuation(<span class="Variable">this</span>.ret);
- };
-
- <span class="LibraryClassType">_Class</span>.<span class="LibraryConstant">prototype</span>.<span class="FunctionName">defer</span> = <span class="Storage">function</span>(<span class="FunctionArgument">defer_params</span>) {
- <span class="Storage">var</span> _this <span class="Keyword">=</span> <span class="Variable">this</span>;
- <span class="Keyword">++</span><span class="Variable">this</span>.count;
- <span class="Keyword">return</span> <span class="Storage">function</span>() {
- <span class="Storage">var</span> inner_params, _ref;
- inner_params <span class="Keyword">=</span> <span class="Number">1</span> <span class="Keyword">&lt;=</span> arguments.<span class="LibraryConstant">length</span> ? __slice.<span class="LibraryFunction">call</span>(arguments, <span class="Number">0</span>) : [];
- <span class="Keyword">if</span> (defer_params <span class="Keyword">!</span><span class="Keyword">=</span> <span class="BuiltInConstant">null</span>) {
- <span class="Keyword">if</span> ((_ref <span class="Keyword">=</span> defer_params.assign_fn) <span class="Keyword">!</span><span class="Keyword">=</span> <span class="BuiltInConstant">null</span>) {
- _ref.<span class="LibraryFunction">apply</span>(<span class="BuiltInConstant">null</span>, inner_params);
- }
- }
- <span class="Keyword">return</span> _this._fulfill();
- };
- };
-
- <span class="Keyword">return</span> _Class;
-
- })()
-}
-<span class="FunctionName">__tame_k</span> = <span class="Storage">function</span>() {};
-
-<span class="FunctionName">delay</span> = <span class="Storage">function</span>(<span class="FunctionArgument">n, v, cb</span>) {
- <span class="Storage">var</span> __tame_deferrals,
- _this <span class="Keyword">=</span> <span class="Variable">this</span>;
- (<span class="Storage">function</span>(__tame_k) {
- __tame_deferrals <span class="Keyword">=</span> <span class="Keyword">new</span> <span class="TypeName">tame.Deferrals</span>(__tame_k);
- <span class="LibraryFunction">setTimeout</span>(__tame_deferrals.<span class="LibraryConstant">defer</span>({}), n);
- __tame_deferrals._fulfill();
- })(<span class="Storage">function</span>() {
- <span class="LibraryFunction">alert</span>(v);
- <span class="Keyword">return</span> cb;
- });
-};
-
-(<span class="Storage">function</span>(__tame_k) {
- __tame_deferrals <span class="Keyword">=</span> <span class="Keyword">new</span> <span class="TypeName">tame.Deferrals</span>(__tame_k);
- delay(<span class="Number">4</span>, <span class="String"><span class="String">&quot;</span>dog<span class="String">&quot;</span></span>, __tame_deferrals.<span class="LibraryConstant">defer</span>({}));
- delay(<span class="Number">8</span>, <span class="String"><span class="String">&quot;</span>cat<span class="String">&quot;</span></span>, __tame_deferrals.<span class="LibraryConstant">defer</span>({}));
- __tame_deferrals._fulfill();
-})(<span class="Storage">function</span>() {
- __tame_deferrals <span class="Keyword">=</span> <span class="Keyword">new</span> <span class="TypeName">tame.Deferrals</span>(__tame_k);
- delay(<span class="Number">2</span>, <span class="String"><span class="String">&quot;</span>bird<span class="String">&quot;</span></span>, __tame_deferrals.<span class="LibraryConstant">defer</span>({}));
- __tame_deferrals._fulfill();
-});
-</pre><script>window.example2 = "\ndelay = (n, v, cb) ->\n await setTimeout defer(), n\n alert v\n cb\n\nawait\n delay 4, \"dog\", defer()\n delay 8, \"cat\", defer()\nawait delay 2, \"bird\", defer()\n\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example2);'>load</div><br class='clear' /></div>
+
<p>
<span id="literals" class="bookmark"></span>

0 comments on commit ea9b905

Please sign in to comment.