From: Dave Thomas Date: 2004-04-03T07:18:25+09:00 Subject: Re: Variable names On Apr 2, 2004, at 16:01, David King Landrith wrote: > Replies like this make this list next to useless. I'm sorry you felt like that: that certainly wasn't my intent. I was simply trying to point out what others have said: the receiver of a message is an object, not a variable, and it isn't always possible to determine an appropriate variable name to use from within a receiver. Have you considered changing your approach slightly? Rather than making it assertion-based, you could implement it more like cast-style checking: def delete_file(str) name = cast(:str, String) # ... The 'cast' method could then verify its its first parameter was a kind_of second parameter, and would have the name lying around if it needed to report an error. The interpreter takes this kind of approach when ensuring that parameters have the right behavior. In fact, it goes one better, supplying the name of a conversion method to use if the object isn't of the required type: name = cast(:str, String, :to_str) You could also do this, making the third parameter optional. However, I still question whether this is all worthwhile... :) Cheers Dave