From: Eleanor McHugh Date: 2009-05-09T10:12:40+09:00 Subject: Re: ruby string slice/[] w/ range, weird end behavior (RANT) On 9 May 2009, at 01:23, Gary Yngve wrote: > Are replies to this group always like this? > > someone blindly posts the doc without reading that I already posted > the doc or reading my example (like an implicit RTFM) > other folks automatically assume I'm a newb and respond in five > seconds without fully reading my post or thinking about their own post Yes. We all have our moron moments. After all, the String.[] documentation clearly states: Element Reference---If passed a single +Fixnum+, returns a substring of one character at that position. which is precisely what I've just tried to explain in my other message and confirms that the behaviour you're querying is completely consistent with the conceptual model of a string of characters. A Ruby string is not a *char[] and the index points are intersticies _between_ an array of characters, not the addresses of those characters. > do i need to be a kool kid or have a secret code word for this noise > to go away? > > i've found the more niche ruby groups to be much more signal.. but > this didn't seem to fit into a niche Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason