Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created October 1, 2016 13:11
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/da2703d5c82caa0af8c545a11d140a32 to your computer and use it in GitHub Desktop.
Save zoffixznet/da2703d5c82caa0af8c545a11d140a32 to your computer and use it in GitHub Desktop.
# we have these 9 multies to avoid infiniloop when incorrect types are
# given to $offset/$size
multi method splice(Array:D: Whatever $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Whatever $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Whatever $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Callable:D $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Callable:D $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Callable:D $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Int:D $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Int:D $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) }
multi method splice(Array:D: Int:D $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment