# Re: String#slice! doc bug?

**URL:** <https://www.ruby-forum.com/t/re-string-slice-doc-bug/79981>\
**Category:** Ruby\
**Created:** [December 20, 2006, 7:29pm UTC](https://www.ruby-forum.com/t/re-string-slice-doc-bug/79981 "2006-12-20T19:29:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [December 20, 2006, 7:29pm UTC](https://www.ruby-forum.com/t/re-string-slice-doc-bug/79981/1 "2006-12-20T19:29:06Z")

</div>

From: Daniel B. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> The docs for String#slice! say, “The forms that take a Fixnum will raise  
> an IndexError if the value is out of range.”

Perhaps the docs are describing what the documenter hoped would be  
implemented. My C is very rusty, but I don’t see anything in string.c  
related to slice! that would raise errors for that.

I’d mention the bug on the ruby-core or ruby-doc lists (depending on  
whether the code or documentation is perceived to be at fault).

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [December 20, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/re-string-slice-doc-bug/79981/2 "2006-12-20T20:59:46Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Gavin K. wrote:

> From: Daniel B. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]
> 
> > The docs for String#slice! say, “The forms that take a Fixnum will raise  
> > an IndexError if the value is out of range.”
> 
> Perhaps the docs are describing what the documenter hoped would be implemented. My C is very rusty, but I don’t see anything in string.c related to slice! that would raise errors for that.

Neither do I.

> I’d mention the bug on the ruby-core or ruby-doc lists (depending on whether the code or documentation is perceived to be at fault).

Roger that. I’ll file a bug report.

Regards,

Dan  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2 (GNU/Linux)  
Comment: Using GnuPG with SUSE - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iD8DBQFFiNI33p/dorzCFX0RAvqcAJ9+7VWic7oLRF86r6Wdav/4co0tDACfaTMy  
OqxmHxBchdwzu+6pc2axH10=  
=a0f3  
-----END PGP SIGNATURE-----
