comp.lang.ada
 help / color / mirror / Atom feed
* Constrained Character Subtype
@ 1997-03-12  0:00 Tracy Fletcher
  1997-03-12  0:00 ` Matthew Heaney
  1997-03-13  0:00 ` Joakim Olsson
  0 siblings, 2 replies; 5+ messages in thread
From: Tracy Fletcher @ 1997-03-12  0:00 UTC (permalink / raw)



Howdy,

I am trying to define a type, which would be a subtype of CHARACTER.  I
want it to contain a list of CHARACTER constants i.e. type VOWELS is
('a', 'e', 'i', 'o', 'u');  

The problem is that I cannot compare one element of a string with type
VOWELS (compile error) for instance to count the vowels in a string
(i.e. if INPUT_STRING(j) in VOWELS . . .)  I have tried making VOWELS a
subtype of CHARACTER, but cannot then specify the actual characters I
want to be included (aside from range, which does me no good).  I would
also like to do something similar to recognize substrings such as:

type More_than_one_syllable is ("ana", "ani", "uno", etc.)
if INPUT_STRING(i..i+2) in More_than_one_syllable then . . .

I know this must be possible, but I have been able to find no effective
solution in reference books, internet documenets, etc.

Any advice would be greatly appreciated.

Thanks,

Tracy Fletcher




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-03-13  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-12  0:00 Constrained Character Subtype Tracy Fletcher
1997-03-12  0:00 ` Matthew Heaney
1997-03-13  0:00   ` Jeff Carter
1997-03-13  0:00   ` Robert Dewar
1997-03-13  0:00 ` Joakim Olsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox