Ok.. I changed the way the dictionary was created and
it's now being done as follows to eliminate the association,
just to simplify.  If it matters I'm using version 3.2 of GST..

dictionaryForAttributes: aCollection [
        | dict |
        dict := Dictionary new.
        aCollection do: [:each | dict at: each key put: each value ].
        ^dict.
"  ^Dictionary withAll: (aCollection
                collect: [ :each | each key type -> each value ])"
]

Here's the code that populates it from an array of XML.Attributes:
        attributes := self dictionaryForAttributes: (each attributes).

Here's the results of what's now in the attributes dictionary :
        attributes inspect.

An instance of Dictionary
  tally: 2
  contents: [
    {link}->'http://foobar.com'
    {label}->'use-case-Name-1'
  ]

Here's the code that is trying to do a lookup for an item in the
dictionary..

        labelName := attributes at: 'label'.

And here's the results..

Object: Dictionary new: 32 "<-0x53bb440>" error: Invalid argument label: key not found
SystemExceptions.NotFound(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.NotFound(Exception)>>signal: (ExcHandling.st:264)
SystemExceptions.NotFound class>>signalOn:what: (SysExcept.st:758)
[] in Dictionary>>at: (Dictionary.st:139)
Dictionary>>at:ifAbsent: (Dictionary.st:149)
Dictionary>>at: (Dictionary.st:138)

I just don't get it.. I must be missing something here..

--Rick

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to