Hi Mike On Thu, 2011-09-15 at 15:43 +1000, Mike Hamilton wrote: > Ron writes: > > > I think it'd be set_month_names($calendar, $array_ref_of_names), which > > would > > store those names into the pre-existing hash of default month names per > > calendar. > > I'd prefer set_calendar(calendar) and set_month_names(language,month_names). > Completely decouple the calendar from the month names.
I'll think about this. You've got me worried, if nothing else. You're implying that you can think of a /realistic/ use case with 1 calendar and multiple languages. Now I'm beginning to hope you're wrong :-)). > > I'm astonished you think sub-classing is inelegant and clumsy > > Real-life example: I have French and German names in my tree, so I need > French accents (acute, grave, etc) and, maybe one day, German umlauts. So I > have to create new classes for French and German, and then some sort of > multiple inheritance class FrenchGerman ? No no. You've overlooked the precise details of my non-existent implementation. Hahahahahaha. The code will stockpile user options, be they calendar or language. So, calls to set options can be endless in number. The code will just be storing stuff in a hash. Access to the hash is, as always, triggered by your usage of a date_calendar_escape in the GEDCOM file itself. By design, a single file can hence use any number of escapes. > Non-real-life: tomorrow I receive a new tree in Swahili, which requires a > FrenchGermanSwahili class. The day after, my long-lost Tibetan cousin emails > with his tree. He has data in Tibetan, Thai, Manipuri, Konkani and Marathi, > so do I create a new class named > FrenchGermanSwahiliTibetanThaiManipuriKonkaniMarathi ? > > Yes, that's of course an extreme, contrived and absurd example. > > Please don't take any of my comments as being negative. > DateTime::Format::Gedcom is already a worthwhile and useful module. GEDCOM > parsers seem easy at first glance, but many have given up after facing the > nitty-gritty bits, the "ifs and buts" and the edge cases ! I assuredly don't take them negatively. I haven't given up yet, but I'm beginning to get your hint... > Must sign off now, there are some angels dancing on the heads of pins that I > have to count ... What a coincidence. I computed that number earlier today. It's ... Damn - there's not enough space in this margin for my proof, but it can be approximated by $infinity/$zero. -- Ron Savage http://savage.net.au/ Ph: 0421 920 622