Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created December 19, 2017 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/94c6f19f79372cd7bdc56d2646e374ea to your computer and use it in GitHub Desktop.
Save zoffixznet/94c6f19f79372cd7bdc56d2646e374ea to your computer and use it in GitHub Desktop.
diff --git a/src/core/Rakudo/Internals.pm b/src/core/Rakudo/Internals.pm
index 5e5f940..c6d83f8 100644
--- a/src/core/Rakudo/Internals.pm
+++ b/src/core/Rakudo/Internals.pm
@@ -474,11 +474,23 @@ my class Rakudo::Internals {
}
method !gist(@path, @dims) {
if @dims.elems == 1 {
- '[' ~ (^@dims[0]).map({ self.AT-POS(|@path, $_).gist }).join(' ') ~ ']';
+ '[' ~ (^@dims[0]).map( -> \el {
+ given ++$ {
+ when 101 { '...' }
+ when 102 { last }
+ default { self.AT-POS(|@path, el).gist }
+ }
+ }).join(' ') ~ ']';
}
else {
my @nextdims = @dims[1..^@dims.elems];
- '[' ~ (^@dims[0]).map({ self!gist((flat @path, $_), @nextdims) }).join(' ') ~ ']';
+ '[' ~ (^@dims[0]).map( -> \el {
+ given ++$ {
+ when 101 { '...' }
+ when 102 { last }
+ default { self!gist((flat @path, el), @nextdims) }
+ }
+ }).join(' ') ~ ']';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment