Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Revert "Make Array.gist limit output to 100 els""
This reverts commit 334b872.
  • Loading branch information
zoffixznet committed Dec 20, 2017
1 parent 8275c03 commit 08539c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/core/Array.pm
Expand Up @@ -1208,9 +1208,6 @@ my class Array { # declared in BOOTSTRAP
~ ']'
})
}
multi method gist(Array:D:) {
self.gistseen('Array', { '[' ~ self.map({.gist}).join(' ') ~ ']' } )
}
multi method WHICH(Array:D:) { self.Mu::WHICH }

#=============== class Array is closed in src/core/TypedArray.pm ===============
Expand Down
9 changes: 6 additions & 3 deletions src/core/List.pm
Expand Up @@ -2,6 +2,7 @@
# deep; a List may contain Scalar containers that can be assigned to. However,
# it is not possible to shift/unshift/push/pop/splice/bind. A List is also
# Positional, and so may be indexed.
my class Array { ... }
my class List does Iterable does Positional { # declared in BOOTSTRAP
# class List is Cool
# The reified elements in the list so far (that is, those that we already
Expand Down Expand Up @@ -804,14 +805,16 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
}

multi method gist(List:D:) {
self.gistseen('List', {
'(' ~ self.map( -> $elem {
self.gistseen(self.^name, {
(nqp::istype(self,Array) ?? '[' !! '(')
~ self.map( -> $elem {
given ++$ {
when 101 { '...' }
when 102 { last }
default { $elem.gist }
}
}).join(' ') ~ ')'
}).join(' ')
~ (nqp::istype(self,Array) ?? ']' !! ')')
})
}

Expand Down

0 comments on commit 08539c4

Please sign in to comment.