Browse files

type check

  • Loading branch information...
1 parent be04efa commit 75d6ede595359af3be6ea481dbf79a29c926edd4 @krukow krukow committed Oct 27, 2011
Showing with 7 additions and 8 deletions.
  1. +4 −5 pprint/pprint.dart
  2. +3 −3 utils/utils.dart
View
9 pprint/pprint.dart
@@ -1,6 +1,6 @@
#library("contrib.pprint");
-pstr(obj [increment=" ", prefix="", content=" ", suffix="", newline=true]) {
+pstr(obj, [increment=" ", prefix="", content=" ", suffix="", newline=true]) {
StringBuffer res = new StringBuffer();
_line(str, indent, [newline=true]) {
res.add(indent);
@@ -22,7 +22,6 @@ pstr(obj [increment=" ", prefix="", content=" ", suffix="", newline=true]) {
_entries(res, obj, increment, content, newline);
_line("}", suffix, newline:false);
} else if (obj is Queue) {
- _line("Queue[ ");
_line("Queue[", prefix, newline:newline);
_entries(res, obj, increment, content, newline);
_line("]", suffix, newline:false);
@@ -39,7 +38,7 @@ pstr(obj [increment=" ", prefix="", content=" ", suffix="", newline=true]) {
}
-pp(obj [indent=" ", increment=" ", newline=true]) {
+pp(obj, [indent=" ", increment=" ", newline=true]) {
print(pstr(obj,
increment: increment,
content: indent,
@@ -58,9 +57,9 @@ p(obj) {
final _NOTHING = const Object();
-_entries(res, obj, inc, indent, newline [separator=":"]) {
+_entries(res, obj, inc, indent, newline, [separator=":"]) {
var cnt = obj.length;
- obj.forEach((k [v = _NOTHING]) {
+ obj.forEach((k, [v = _NOTHING]) {
cnt -= 1;
res.add(pstr(k,
increment:inc,
View
6 utils/utils.dart
@@ -1,6 +1,6 @@
#library("contrib.utils");
-time(action [watches]) {
+time(action, [watches]) {
var actionTimer = new StopWatch();
if (watches == null) {
watches = [];
@@ -24,10 +24,10 @@ time(action [watches]) {
final _NOTHING = const Object();
//Maps arent collections, collections dont have map
-map_with_index(coll, f [context]) {
+map_with_index(coll, f, [context]) {
var res = [];
int idx=0;
- coll.forEach((k [v=_NOTHING]) {
+ coll.forEach((k, [v=_NOTHING]) {
if (v === _NOTHING) {
res.add(f(k, idx, context));
} else {

0 comments on commit 75d6ede

Please sign in to comment.