diff --git a/documentation/coffee/existence.coffee b/documentation/coffee/existence.coffee index d4405e38..1cc6725c 100644 --- a/documentation/coffee/existence.coffee +++ b/documentation/coffee/existence.coffee @@ -1,6 +1,8 @@ solipsism = true if mind? and not world? -speed ?= 140 +speed ?= 75 + +footprints = yeti ? "bear" diff --git a/documentation/index.html.erb b/documentation/index.html.erb index 216f07d3..c544b88c 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -518,12 +518,12 @@ coffee --bare --print --stdio

<%= code_for('range_comprehensions', 'countdown') %>

- Note how because we are assigning the value of the comprehensions to a - variable in the example above, CoffeeScript is collecting the result of + Note how because we are assigning the value of the comprehensions to a + variable in the example above, CoffeeScript is collecting the result of each iteration into an array. Sometimes functions end with loops that are intended to run only for their side-effects. Be careful that you're not accidentally returning the results of the comprehension in these cases, - by adding a meaningful return value, like true, or null, + by adding a meaningful return value, like true, or null, to the bottom of your function.

@@ -608,7 +608,7 @@ coffee --bare --print --stdio It can also be used for safer conditional assignment than ||= provides, for cases where you may be handling numbers or strings.

- <%= code_for('existence', 'speed') %> + <%= code_for('existence', 'footprints') %>

The accessor variant of the existential operator ?. can be used to soak up null references in a chain of properties. Use it instead @@ -1034,23 +1034,23 @@ coffee --bare --print --stdio Change Log - +

- 0.9.6 + 0.9.6 Dec 6, 2010 The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using --watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within - plucked closure-loops. Constructors now maintain their declaration + plucked closure-loops. Constructors now maintain their declaration location within a class body. Dynamic object keys were removed. - Nested classes are now supported. Fixes execution context for naked + Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.

- 0.9.5 + 0.9.5 Nov 21, 2010 0.9.5 should be considered the first release candidate for CoffeeScript 1.0. @@ -1066,7 +1066,7 @@ coffee --bare --print --stdio

- 0.9.4 + 0.9.4 Sep 21, 2010 CoffeeScript now uses appropriately-named temporary variables, and recycles @@ -1077,7 +1077,7 @@ coffee --bare --print --stdio

- 0.9.3 + 0.9.3 Sep 16, 2010 CoffeeScript switch statements now compile into JS switch @@ -1088,7 +1088,7 @@ coffee --bare --print --stdio

- 0.9.2 + 0.9.2 Aug 23, 2010 Specifying the start and end of a range literal is now optional, eg. array[3..]. @@ -1104,7 +1104,7 @@ coffee --bare --print --stdio

- 0.9.1 + 0.9.1 Aug 11, 2010 Bugfix release for 0.9.1. Greatly improves the handling of mixed @@ -1115,7 +1115,7 @@ coffee --bare --print --stdio

- 0.9.0 + 0.9.0 Aug 4, 2010 The CoffeeScript 0.9 series is considered to be a release candidate @@ -1141,7 +1141,7 @@ coffee --bare --print --stdio

- 0.7.2 + 0.7.2 Jul 12, 2010 Quick bugfix (right after 0.7.1) for a problem that prevented coffee @@ -1149,7 +1149,7 @@ coffee --bare --print --stdio

- 0.7.1 + 0.7.1 Jul 11, 2010 Block-style comments are now passed through and printed as JavaScript block @@ -1159,7 +1159,7 @@ coffee --bare --print --stdio

- 0.7.0 + 0.7.0 Jun 28, 2010 Official CoffeeScript variable style is now camelCase, as in JavaScript. @@ -1178,7 +1178,7 @@ coffee --bare --print --stdio

- 0.6.2 + 0.6.2 May 15, 2010 The coffee command will now preserve directory structure when @@ -1195,7 +1195,7 @@ coffee --bare --print --stdio

- 0.6.1 + 0.6.1 Apr 12, 2010 Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 @@ -1203,7 +1203,7 @@ coffee --bare --print --stdio

- 0.6.0 + 0.6.0 Apr 3, 2010 Trailing commas are now allowed, a-la Python. Static @@ -1212,7 +1212,7 @@ coffee --bare --print --stdio

- 0.5.6 + 0.5.6 Mar 23, 2010 Interpolation can now be used within regular expressions and heredocs, as well as @@ -1225,7 +1225,7 @@ coffee --bare --print --stdio

- 0.5.5 + 0.5.5 Mar 8, 2010 String interpolation, contributed by @@ -1236,7 +1236,7 @@ coffee --bare --print --stdio

- 0.5.4 + 0.5.4 Mar 3, 2010 Bugfix that corrects the Node.js global constants __filename and @@ -1245,7 +1245,7 @@ coffee --bare --print --stdio

- 0.5.3 + 0.5.3 Feb 27, 2010 CoffeeScript now has a syntax for defining classes. Many of the core @@ -1257,7 +1257,7 @@ coffee --bare --print --stdio

- 0.5.2 + 0.5.2 Feb 25, 2010 Added a compressed version of the compiler for inclusion in web pages as @@ -1268,7 +1268,7 @@ coffee --bare --print --stdio

- 0.5.1 + 0.5.1 Feb 24, 2010 Improvements to null soaking with the existential operator, including @@ -1278,7 +1278,7 @@ coffee --bare --print --stdio

- 0.5.0 + 0.5.0 Feb 21, 2010 CoffeeScript 0.5.0 is a major release, While there are no language changes, @@ -1287,7 +1287,7 @@ coffee --bare --print --stdio

- 0.3.2 + 0.3.2 Feb 8, 2010 @property is now a shorthand for this.property.
@@ -1296,7 +1296,7 @@ coffee --bare --print --stdio

- 0.3.0 + 0.3.0 Jan 26, 2010 CoffeeScript 0.3 includes major syntax changes: @@ -1314,7 +1314,7 @@ coffee --bare --print --stdio

- 0.2.6 + 0.2.6 Jan 17, 2010 Added Python-style chained comparisons, the conditional existence @@ -1324,7 +1324,7 @@ coffee --bare --print --stdio

- 0.2.5 + 0.2.5 Jan 13, 2010 The conditions in switch statements can now take multiple values at once — @@ -1335,7 +1335,7 @@ coffee --bare --print --stdio

- 0.2.4 + 0.2.4 Jan 12, 2010 Added ECMAScript Harmony style destructuring assignment, for dealing with @@ -1344,7 +1344,7 @@ coffee --bare --print --stdio

- 0.2.3 + 0.2.3 Jan 11, 2010 Axed the unsatisfactory ino keyword, replacing it with of for @@ -1352,7 +1352,7 @@ coffee --bare --print --stdio

- 0.2.2 + 0.2.2 Jan 10, 2010 When performing a comprehension over an object, use ino, instead @@ -1375,14 +1375,14 @@ coffee --bare --print --stdio

- 0.2.1 + 0.2.1 Jan 5, 2010 Arguments objects are now converted into real arrays when referenced.

- 0.2.0 + 0.2.0 Jan 5, 2010 Major release. Significant whitespace. Better statement-to-expression @@ -1394,7 +1394,7 @@ coffee --bare --print --stdio

- 0.1.6 + 0.1.6 Dec 27, 2009 Bugfix for running coffee --interactive and --run @@ -1403,7 +1403,7 @@ coffee --bare --print --stdio

- 0.1.5 + 0.1.5 Dec 26, 2009 Array slice literals and array comprehensions can now both take Ruby-style @@ -1414,7 +1414,7 @@ coffee --bare --print --stdio

- 0.1.4 + 0.1.4 Dec 25, 2009 The official CoffeeScript extension is now .coffee instead of @@ -1428,7 +1428,7 @@ coffee --bare --print --stdio

- 0.1.3 + 0.1.3 Dec 25, 2009 The coffee command now includes --interactive, @@ -1444,7 +1444,7 @@ coffee --bare --print --stdio

- 0.1.2 + 0.1.2 Dec 24, 2009 Fixed a bug with calling super() through more than one level of @@ -1458,14 +1458,14 @@ coffee --bare --print --stdio

- 0.1.1 + 0.1.1 Dec 24, 2009 Added instanceof and typeof as operators.

- 0.1.0 + 0.1.0 Dec 24, 2009 Initial CoffeeScript release. diff --git a/documentation/js/existence.js b/documentation/js/existence.js index 39ae7e1d..e8631865 100644 --- a/documentation/js/existence.js +++ b/documentation/js/existence.js @@ -1,5 +1,6 @@ -var solipsism; +var footprints, solipsism; if ((typeof mind != "undefined" && mind !== null) && !(typeof world != "undefined" && world !== null)) { solipsism = true; } -typeof speed != "undefined" && speed !== null ? speed : speed = 140; \ No newline at end of file +typeof speed != "undefined" && speed !== null ? speed : speed = 75; +footprints = typeof yeti != "undefined" && yeti !== null ? yeti : "bear"; \ No newline at end of file diff --git a/index.html b/index.html index fea77d0b..50f1fd60 100644 --- a/index.html +++ b/index.html @@ -886,12 +886,12 @@ countdown = (function() { return _results; }());;alert(countdown);'>run: countdown

- Note how because we are assigning the value of the comprehensions to a - variable in the example above, CoffeeScript is collecting the result of + Note how because we are assigning the value of the comprehensions to a + variable in the example above, CoffeeScript is collecting the result of each iteration into an array. Sometimes functions end with loops that are intended to run only for their side-effects. Be careful that you're not accidentally returning the results of the comprehension in these cases, - by adding a meaningful return value, like true, or null, + by adding a meaningful return value, like true, or null, to the bottom of your function.

@@ -1111,22 +1111,26 @@ globals = (function() {

solipsism = true if mind? and not world?
 
-speed ?= 140
+speed ?= 75
+
+footprints = yeti ? "bear"
 
 
 
 
 
-
var solipsism;
+
var footprints, solipsism;
 if ((typeof mind != "undefined" && mind !== null) && !(typeof world != "undefined" && world !== null)) {
   solipsism = true;
 }
-typeof speed != "undefined" && speed !== null ? speed : speed = 140;
-

+typeof speed != "undefined" && speed !== null ? speed : speed = 75; +footprints = typeof yeti != "undefined" && yeti !== null ? yeti : "bear";;alert(footprints);'>run: footprints

The accessor variant of the existential operator ?. can be used to soak up null references in a chain of properties. Use it instead @@ -1901,23 +1905,23 @@ task('build:parser Change Log - +

- 0.9.6 + 0.9.6 Dec 6, 2010 The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using --watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within - plucked closure-loops. Constructors now maintain their declaration - location within a class body. - Nested classes are now supported. Fixes execution context for naked + plucked closure-loops. Constructors now maintain their declaration + location within a class body. Dynamic object keys were removed. + Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.

- 0.9.5 + 0.9.5 Nov 21, 2010 0.9.5 should be considered the first release candidate for CoffeeScript 1.0. @@ -1933,7 +1937,7 @@ task('build:parser0.9.4 + 0.9.4 Sep 21, 2010 CoffeeScript now uses appropriately-named temporary variables, and recycles @@ -1944,7 +1948,7 @@ task('build:parser0.9.3 + 0.9.3 Sep 16, 2010 CoffeeScript switch statements now compile into JS switch @@ -1955,7 +1959,7 @@ task('build:parser0.9.2 + 0.9.2 Aug 23, 2010 Specifying the start and end of a range literal is now optional, eg. array[3..]. @@ -1971,7 +1975,7 @@ task('build:parser0.9.1 + 0.9.1 Aug 11, 2010 Bugfix release for 0.9.1. Greatly improves the handling of mixed @@ -1982,7 +1986,7 @@ task('build:parser0.9.0 + 0.9.0 Aug 4, 2010 The CoffeeScript 0.9 series is considered to be a release candidate @@ -2008,7 +2012,7 @@ task('build:parser0.7.2 + 0.7.2 Jul 12, 2010 Quick bugfix (right after 0.7.1) for a problem that prevented coffee @@ -2016,7 +2020,7 @@ task('build:parser0.7.1 + 0.7.1 Jul 11, 2010 Block-style comments are now passed through and printed as JavaScript block @@ -2026,7 +2030,7 @@ task('build:parser0.7.0 + 0.7.0 Jun 28, 2010 Official CoffeeScript variable style is now camelCase, as in JavaScript. @@ -2045,7 +2049,7 @@ task('build:parser0.6.2 + 0.6.2 May 15, 2010 The coffee command will now preserve directory structure when @@ -2062,7 +2066,7 @@ task('build:parser0.6.1 + 0.6.1 Apr 12, 2010 Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 @@ -2070,7 +2074,7 @@ task('build:parser0.6.0 + 0.6.0 Apr 3, 2010 Trailing commas are now allowed, a-la Python. Static @@ -2079,7 +2083,7 @@ task('build:parser0.5.6 + 0.5.6 Mar 23, 2010 Interpolation can now be used within regular expressions and heredocs, as well as @@ -2092,7 +2096,7 @@ task('build:parser0.5.5 + 0.5.5 Mar 8, 2010 String interpolation, contributed by @@ -2103,7 +2107,7 @@ task('build:parser0.5.4 + 0.5.4 Mar 3, 2010 Bugfix that corrects the Node.js global constants __filename and @@ -2112,7 +2116,7 @@ task('build:parser0.5.3 + 0.5.3 Feb 27, 2010 CoffeeScript now has a syntax for defining classes. Many of the core @@ -2124,7 +2128,7 @@ task('build:parser0.5.2 + 0.5.2 Feb 25, 2010 Added a compressed version of the compiler for inclusion in web pages as @@ -2135,7 +2139,7 @@ task('build:parser0.5.1 + 0.5.1 Feb 24, 2010 Improvements to null soaking with the existential operator, including @@ -2145,7 +2149,7 @@ task('build:parser0.5.0 + 0.5.0 Feb 21, 2010 CoffeeScript 0.5.0 is a major release, While there are no language changes, @@ -2154,7 +2158,7 @@ task('build:parser0.3.2 + 0.3.2 Feb 8, 2010 @property is now a shorthand for this.property.
@@ -2163,7 +2167,7 @@ task('build:parser0.3.0 + 0.3.0 Jan 26, 2010 CoffeeScript 0.3 includes major syntax changes: @@ -2181,7 +2185,7 @@ task('build:parser0.2.6 + 0.2.6 Jan 17, 2010 Added Python-style chained comparisons, the conditional existence @@ -2191,7 +2195,7 @@ task('build:parser0.2.5 + 0.2.5 Jan 13, 2010 The conditions in switch statements can now take multiple values at once — @@ -2202,7 +2206,7 @@ task('build:parser0.2.4 + 0.2.4 Jan 12, 2010 Added ECMAScript Harmony style destructuring assignment, for dealing with @@ -2211,7 +2215,7 @@ task('build:parser0.2.3 + 0.2.3 Jan 11, 2010 Axed the unsatisfactory ino keyword, replacing it with of for @@ -2219,7 +2223,7 @@ task('build:parser0.2.2 + 0.2.2 Jan 10, 2010 When performing a comprehension over an object, use ino, instead @@ -2242,14 +2246,14 @@ task('build:parser0.2.1 + 0.2.1 Jan 5, 2010 Arguments objects are now converted into real arrays when referenced.

- 0.2.0 + 0.2.0 Jan 5, 2010 Major release. Significant whitespace. Better statement-to-expression @@ -2261,7 +2265,7 @@ task('build:parser0.1.6 + 0.1.6 Dec 27, 2009 Bugfix for running coffee --interactive and --run @@ -2270,7 +2274,7 @@ task('build:parser0.1.5 + 0.1.5 Dec 26, 2009 Array slice literals and array comprehensions can now both take Ruby-style @@ -2281,7 +2285,7 @@ task('build:parser0.1.4 + 0.1.4 Dec 25, 2009 The official CoffeeScript extension is now .coffee instead of @@ -2295,7 +2299,7 @@ task('build:parser0.1.3 + 0.1.3 Dec 25, 2009 The coffee command now includes --interactive, @@ -2311,7 +2315,7 @@ task('build:parser0.1.2 + 0.1.2 Dec 24, 2009 Fixed a bug with calling super() through more than one level of @@ -2325,14 +2329,14 @@ task('build:parser0.1.1 + 0.1.1 Dec 24, 2009 Added instanceof and typeof as operators.

- 0.1.0 + 0.1.0 Dec 24, 2009 Initial CoffeeScript release.