From: Gavin Sinclair Date: 2004-11-30T10:21:29+09:00 Subject: Re: Seeking advice on some method names On Monday, November 29, 2004, 9:56:12 PM, Brian wrote: > On Mon, 29 Nov 2004 11:31:06 +0900 > Gavin Sinclair wrote: >> Hi all, >> >> I'm preparing some methods for 'extensions' [1] and would like some >> people's opinions on method names. >> >> Array#only >> [5].only -> 5 >> [1,2,3].only -> exception >> > Maybe to_scalar would tell more clearly what it is doing? #to_scalar is not really clear to me. I can foce my mind to think that way, but it's not natural. But obviously #only has attracted its fair share of comment as well. It's very clear to me: return the _only_ element in the array. Perhaps people have never felt the need for it, which I understand. Gavin