comp.lang.ada
 help / color / mirror / Atom feed
* Q: type ... is new String
@ 2012-05-30 16:33 tmoran
  2012-05-30 17:04 ` Dmitry A. Kazakov
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: tmoran @ 2012-05-30 16:33 UTC (permalink / raw)


Any comments on the effectiveness of using multiple types for different
categories of strings, rather than "String" all the time?
  I have a TV program database with a base directory, containing a folder
for each show, which in turn has a folder for each season, which then
has a folder for each episode, which then contains the actual video, eg
  c:\TV\I Love Lucy\1975\The New Neighbor\video.mpg
Instead of wordy, and error prone, calls on Ada.Directories.Compose, or
  Episode & '\' & Video_File
Would it be useful to have
  type Show_Paths is new String;
  type Season_Paths is new String;
  type Episode_Paths is new String;
  ...
  function "+"(Show : Show_Paths; Season : String) return Season_Paths;
  function "+"(Show_Season : Season_Paths; Episode : String)
    return Episode_Paths;
  etc
so one could write
  This_Show : Show_Paths := ...
  First_Episode_Name : String := ...
  Episode_Path : Episode_Paths := This_Show + "1975" + First_Episode_Name;
but the compiler would object to
  Episode_Path : Episode_Paths := This_Show + First_Episode_Name;



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

end of thread, other threads:[~2012-06-07 11:15 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-30 16:33 Q: type ... is new String tmoran
2012-05-30 17:04 ` Dmitry A. Kazakov
2012-05-31  7:37 ` Maciej Sobczak
2012-06-04  5:58   ` Yannick Duchêne (Hibou57)
2012-06-04  6:30     ` J-P. Rosen
2012-06-04  7:48       ` Yannick Duchêne (Hibou57)
2012-06-04  8:03         ` Dmitry A. Kazakov
2012-06-04  8:14           ` Yannick Duchêne (Hibou57)
2012-06-04  9:09             ` Dmitry A. Kazakov
2012-06-04 10:35         ` J-P. Rosen
2012-06-04  5:43 ` Yannick Duchêne (Hibou57)
2012-06-04 11:39 ` Brian Drummond
2012-06-04 13:36   ` Maciej Sobczak
2012-06-04 14:58     ` Georg Bauhaus
2012-06-04 15:14       ` Dmitry A. Kazakov
2012-06-04 16:06         ` Georg Bauhaus
2012-06-04 17:05           ` Dmitry A. Kazakov
2012-06-04 20:28             ` Yannick Duchêne (Hibou57)
2012-06-04 20:56             ` Georg Bauhaus
2012-06-05  7:32               ` Dmitry A. Kazakov
2012-06-05  8:40                 ` Georg Bauhaus
2012-06-05  9:06                   ` Dmitry A. Kazakov
2012-06-05 12:20                     ` Georg Bauhaus
2012-06-05 13:14                       ` Dmitry A. Kazakov
2012-06-06  4:09                       ` Shark8
2012-06-06  8:52                         ` Georg Bauhaus
2012-06-06 23:56                       ` Randy Brukardt
2012-06-07 11:15                         ` Georg Bauhaus
2012-06-06 23:51                 ` Randy Brukardt
2012-06-04 20:33         ` Yannick Duchêne (Hibou57)
2012-06-04 21:27           ` Georg Bauhaus
     [not found]             ` <m9kqs7hgii13e220b1phm46n43d92tu1pj@invalid.netcom.com>
2012-06-05  6:15               ` Georg Bauhaus
2012-06-05  6:36                 ` Yannick Duchêne (Hibou57)
2012-06-06  4:14               ` Shark8
2012-06-07  0:01             ` Randy Brukardt
2012-06-07  0:20               ` Adam Beneschan
2012-06-05 12:05     ` Brian Drummond
2012-06-05 14:43       ` Yannick Duchêne (Hibou57)
2012-06-04 15:54   ` Shark8
2012-06-04 22:01     ` Jeffrey Carter
2012-06-05 12:10       ` Brian Drummond

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