From: Gerd S. <in...@ge...> - 2001-10-07 20:56:28
|
On Sun, 07 Oct 2001, Patrick M Doane wrote: >I've been working on e-mail address support today and have a couple >of suggestions: > > - I think it may be good to factor out the address support to > a Netaddress module. It seems to distract from the focus of the > Netmessage module. Agreed. This is another fundamental structure like Netdate. > - Object-based representations for addresses may not be the best idea. > I forgot that they don't support equality, which makes it impossible > to use them as keys and it also complicates testing. You can use objects as keys. The object ID is used in this case. I.e. obj1 = obj2 <=> obj1 and obj2 are the same object. Of course, objects are not compared component by component. I think the comparison by components does not make sense because there is no way to find out whether two mailbox references mean the same mailbox or not. Maybe the object ID is better. But I am undecided. Testing: It is possible to define printers for objects. >I would > recommend switching back to a record based structure: > > type mailbox = { > name: string option; > route: string list; > spec: addr_spec; > } Better: mb_name, mb_route, mb_spec. This avoids name clashes. > type t = > [ `Mailbox of mailbox > | `Group of string * mailbox list > ] > >Patrick Gerd -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 45 64293 Darmstadt EMail: ge...@ge... Germany ---------------------------------------------------------------------------- |