| Brian Schröder 2005-08-28, 6:59 pm |
| On 26/08/05, Mark Volkmann <r.mark.volkmann@gmail.com> wrote:
> On 8/26/05, Brian Schr=F6der <ruby.brian@gmail.com> wrote:
n the Hash.[color=darkred]
n[color=darkred]
>=20
>=20
> Just to clarify, are you saying that ...
>=20
> 1) If I want my code that accepts a Hash parameter to allow keys to be
> either Symbols or Strings, I need to use an approach like you showed
> above.
>=20
> 2) Many existing Ruby classes do this.
Yes, that is two times true. Hashes do not special-case for strings or
symbols. (Nearly) anything can go into a Hash as keys. Generally ruby
does not special case very often. Thats what makes it so nice to learn
and use.
regards,
Brian
>=20
> --
> R. Mark Volkmann
> Partner, Object Computing, Inc.
>=20
>=20
--=20
http://ruby.brian-schroeder.de/
Stringed instrument chords: http://chordlist.brian-schroeder.de/
|