Re: character matching
From: Adrian Knoth (adi_at_thur.de)
Date: 08/15/04
- Next message: Nick Roberts: "Re: ADA Popularity Discussion Request"
- Previous message: Ludovic Brenta: "Re: character matching"
- In reply to: Ludovic Brenta: "Re: character matching"
- Next in thread: Ludovic Brenta: "Re: character matching"
- Reply: Ludovic Brenta: "Re: character matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 15 Aug 2004 21:02:21 GMT
Ludovic Brenta <ludovic.brenta@insalien.org> wrote:
> type Category is (Whitespace, Punctuation, Letter, Digit, Other);
I support Steve's suggestion. Yours has the advantage of showing
how simple things can be done. I guess this is useful for learning
purposes but may contain more mistakes than the Annex-A-solution ;)
> when others => return Other;
> (note that in Ada, a "case" statement is required to process all
> possible values of the case_expression (here, C); the compiler will
> tell you if you forgot some values, unless as above you use "when
> others").
Which is considered BAD because when you change the range of a type
your case still works but may misbehave for the new values. Without
the "when others"-line the compiler forces you to adapt your routines
to the new range.
I know you know that, it's just for the original poster (John?).
-- mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver Wie kommts das am Ende des Geldes noch soviel Monat übrig ist?
- Next message: Nick Roberts: "Re: ADA Popularity Discussion Request"
- Previous message: Ludovic Brenta: "Re: character matching"
- In reply to: Ludovic Brenta: "Re: character matching"
- Next in thread: Ludovic Brenta: "Re: character matching"
- Reply: Ludovic Brenta: "Re: character matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|