comp.lang.ada
 help / color / mirror / Atom feed
* When to use formal discrete type?
@ 2017-11-29 19:04 Victor Porton
  2017-11-29 19:43 ` Shark8
  2017-11-29 21:05 ` Randy Brukardt
  0 siblings, 2 replies; 4+ messages in thread
From: Victor Porton @ 2017-11-29 19:04 UTC (permalink / raw)


I am creating a generic package which accepts as a formal argument a type 
which is expected to be an enumeration type.

Should for this enumeration argument I use formal private type (is private) 
or formal discrete type (is (<>))?

I do not use features specific to discrete types such as 'First or 'Range 
attributes.

Because it easily generalizes from discrete types to arbitrary private 
types, should I do generalization?

What of (generalizing for all private types or not) the two is better:

a. for clarity of code;

b. for performance?

It there a noticeable difference in performance if I generalize?

-- 
Victor Porton - http://portonvictor.org

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

end of thread, other threads:[~2017-11-29 21:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29 19:04 When to use formal discrete type? Victor Porton
2017-11-29 19:43 ` Shark8
2017-11-29 21:07   ` Dmitry A. Kazakov
2017-11-29 21:05 ` Randy Brukardt

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