[Pharo-users] "Theming" dictionaries?
emaringolo at gmail.com
Wed Feb 19 12:05:16 EST 2020
I'm not sure I fully understand your question.
But Dictionaries expect its elements to respond to #key/#value messages,
and in the case of Pharo Dictionary is tightly bound to the Association
class (and the #-> selector), so there is no way to subclassify Dictionary
and specify the class of its elements.
Otherwise you could subclassify Dictionary and have its elements to be
instances of "MinipediaLanguage", that is polymorphic with Association but
have language/titles instead of key/value.
I don't see the need for it, though.
Esteban A. Maringolo
On Wed, Feb 19, 2020 at 1:49 PM Offray Vladimir Luna Cárdenas <
offray.luna at mutabit.com> wrote:
> As some of you may know, I'm a "savage coder" who learned
> Smalltalk/Pharo by himself, of course thanks to communities, books and
> videos, but without formal training or peers in the same country and
> guided mostly by necessity. All this to say that this maybe kind of a
> silly question.
> Anyway, we have this project called Minipedia, that imports Wikipedia
> articles and their history. A Minipedia language there, is just a
> dictionary, where the key is the language two letters code and the value
> for each key is an array of article titles. There is any way to
> specialize a Dictionary to tell it, name your 'key' as language and your
> 'value' as 'titles'?
>  https://mutabit.com/repos.fossil/minipedia/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-users