comp.lang.ada
 help / color / mirror / Atom feed
* Discriminated records are not the most efficient, but ...
@ 2010-08-21 21:18 Yannick Duchêne (Hibou57)
  2010-08-21 21:57 ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 26+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-21 21:18 UTC (permalink / raw)


Discriminated records are not the most efficient, but ... other ways to do  
are likely to be turned into program logic errors.

Fully agree with this (do not like the technique of returning a special  
value to indicate a state, which is a common practice with YouKnowWho).

Here is precisely a quote in this area:
> Often these tags are folded into the type as "reserved values",
> and their occurrence is not consistently checked: this is a fairly
> common source of programming errors
http://en.wikipedia.org/wiki/Tagged_union
(in “Advantages and disadvantages”)

Well, this efficiency leak should at least be really weighted (heavy in  
this/that case ? not heavy ?) instead of supposed by reflex.

This may be a good “Warning: suspicious design” topic to check for  
compilers, but I do not see a way how a compilers could determine such a  
suspicious design is in use (honestly, I have an idea, but prefer not to  
talk about it, because this would requires a bloat in the language).

This is an example where, while Ada help, sometime it needs your help in  
return.



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

end of thread, other threads:[~2010-09-04 18:49 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21 21:18 Discriminated records are not the most efficient, but Yannick Duchêne (Hibou57)
2010-08-21 21:57 ` Yannick Duchêne (Hibou57)
2010-08-22  5:39   ` Yannick Duchêne (Hibou57)
2010-08-22 20:40     ` Yannick Duchêne (Hibou57)
2010-08-22 20:47       ` Florian Weimer
2010-08-22 22:07         ` Yannick Duchêne (Hibou57)
2010-08-22 22:11           ` Yannick Duchêne (Hibou57)
2010-08-23  3:06           ` Peter C. Chapin
2010-08-23  3:50             ` Yannick Duchêne (Hibou57)
2010-08-23  6:25               ` J-P. Rosen
2010-08-23  8:09                 ` Yannick Duchêne (Hibou57)
2010-08-23  6:40               ` Niklas Holsti
2010-08-23  7:33                 ` Simon Wright
2010-08-23 11:44                   ` Martin
2010-08-23 13:16                     ` Georg Bauhaus
2010-08-23 13:32                       ` Martin
2010-08-23 17:02                       ` Yannick Duchêne (Hibou57)
2010-08-23  8:13                 ` Yannick Duchêne (Hibou57)
2010-08-23  1:52         ` Yannick Duchêne (Hibou57)
2010-08-23  5:14           ` Yannick Duchêne (Hibou57)
2010-08-23  5:43             ` Florian Weimer
2010-08-23  7:55               ` Yannick Duchêne (Hibou57)
2010-08-23  8:06                 ` Dmitry A. Kazakov
2010-08-23  8:26                   ` Yannick Duchêne (Hibou57)
2010-08-23  8:43                     ` Dmitry A. Kazakov
2010-09-04 18:49             ` Florian Weimer

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