[Nitro] ann problem

transfire at gmail.com transfire at gmail.com
Mon Jan 29 09:45:00 EST 2007

On Jan 29, 6:33 am, "George Moschovitis" 
<george.moschovi... at gmail.com> wrote:
> Tom, the following does not work:
> require 'facets/core/hash/insert'
> require 'facets/more/ann'
  class T; end

  T.ann!(:self).insert(:list, [])
  T.ann(:self, :list) << 1

The ! is only needed when effecting the annotations list in place. Ie.


Note, that unlike previous versions, annotation keys can now be any 
object, and strings and symbols are treated differently. (that last 
part kind of sucks, as it does for all hashes, but ruby 1.9 is 
supposed to correct that by making symbols and strings "equal" when 
used as hash keys.)


More information about the Nitro-general mailing list