Re: character matching

From: Adrian Knoth (adi_at_thur.de)
Date: 08/15/04


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?


Relevant Pages

  • Re: character matching
    ... > I support Steve's suggestion. ... Yours has the advantage of showing how ... Ludovic Brenta. ...
    (comp.lang.ada)
  • Re: Sarah Palin- creationist VP candidate?
    ... Correlation does not imply causality. ... that makes learning real mathematics impossible. ... I would argue that the responses to your suggestion of change are only ...
    (talk.origins)
  • Re: I just got a unicycle help?!
    ... Welcome to unicycling! ... I think learning to unicycle is like learning to walk. ... Continue to use the support to ride if it helps you ... Be sure your seat is comfortable and at a proper height. ...
    (rec.sport.unicycling)
  • Re: More Intel ICH5 SATA150 hangs
    ... >>also a suggestion that HT be turned off. ... # Floppy drives - None present ... # Floating point support - do not disable. ... # PCI Ethernet NICs that use the common MII bus controller code. ...
    (freebsd-questions)
  • Re: Return classic menus as an option in Office.
    ... It's a simple matter to support ... | This post is a suggestion for Microsoft, ... To vote for this suggestion, ... | Web-based Newsreader and then click "I Agree" in the message pane. ...
    (microsoft.public.officeupdate)