From c8306d3d7439b6cf76498462720a26503fa29318 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Tue, 21 Aug 2012 10:38:48 -0300 Subject: [PATCH 1/3] Update numbers converting Use dart:math and drop the Math prefix as parse functions are toplevel in library. --- .../_includes/language-tour/3-built-in-types/numbers.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/site/_includes/language-tour/3-built-in-types/numbers.html b/src/site/_includes/language-tour/3-built-in-types/numbers.html index fce2e9407..2d7da54fa 100644 --- a/src/site/_includes/language-tour/3-built-in-types/numbers.html +++ b/src/site/_includes/language-tour/3-built-in-types/numbers.html @@ -57,12 +57,14 @@

{% highlight dart %} +#import('dart:math'); // Needed for math functions. See libraries section + // String -> int -var one = Math.parseInt("1"); +var one = parseInt("1"); assert(one == 1); // String -> double -var onePointOne = Math.parseDouble("1.1"); +var onePointOne = parseDouble("1.1"); assert(onePointOne == 1.1); // int -> String From b525cc8d46cc7939bf848d36d255703a85f3fee9 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Tue, 21 Aug 2012 10:50:41 -0300 Subject: [PATCH 2/3] Fixed bitshift typo --- src/site/_includes/language-tour/3-built-in-types/numbers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/_includes/language-tour/3-built-in-types/numbers.html b/src/site/_includes/language-tour/3-built-in-types/numbers.html index 2d7da54fa..d6b84571b 100644 --- a/src/site/_includes/language-tour/3-built-in-types/numbers.html +++ b/src/site/_includes/language-tour/3-built-in-types/numbers.html @@ -82,7 +82,7 @@

{% highlight dart %} -assert((3 < 1) == 6); // 0011 << 1 == 0110 +assert((3 << 1) == 6); // 0011 << 1 == 0110 assert((3 >> 1) == 1); // 0011 >> 1 == 0001 assert((3 | 4) == 7); // 0011 | 0100 == 0111 {% endhighlight %} From 5976f21a8a5113294c3e7b548b63d2555146da43 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Tue, 21 Aug 2012 13:20:55 -0300 Subject: [PATCH 3/3] Update list methods descriptions Clarified description for every() and some(). --- src/site/_includes/language-tour/3-built-in-types/lists.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/site/_includes/language-tour/3-built-in-types/lists.html b/src/site/_includes/language-tour/3-built-in-types/lists.html index c21ae6eb5..f28590e7c 100644 --- a/src/site/_includes/language-tour/3-built-in-types/lists.html +++ b/src/site/_includes/language-tour/3-built-in-types/lists.html @@ -120,8 +120,8 @@

List and Collection methods

returns a new collection with only the elements that satisfy a condition. The every() and some() methods -check whether a collection matches -every condition or at least one condition, respectively. +check whether every item in a collection matches a condition +or if at least one item matches a condition, respectively. The sort() method lets you sort a list using any criteria you like.