From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.134.135 with SMTP id q7mr48223633ioi.1.1438287052046; Thu, 30 Jul 2015 13:10:52 -0700 (PDT) X-Received: by 10.140.94.145 with SMTP id g17mr127198qge.13.1438287052016; Thu, 30 Jul 2015 13:10:52 -0700 (PDT) Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!pg9no5475956igb.0!news-out.google.com!b31ni1613qge.0!nntp.google.com!z61no4257678qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 30 Jul 2015 13:10:49 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.203.145.32; posting-account=AFCLjAoAAABJAOf_HjgEEEi3ty-lG5m2 NNTP-Posting-Host: 81.203.145.32 References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <014427b1-ff7a-4a69-82e6-0330af77ed96@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Running a preprocessor from GPS? From: EGarrulo Injection-Date: Thu, 30 Jul 2015 20:10:52 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:194550 Date: 2015-07-30T13:10:49-07:00 List-Id: On Thursday, July 30, 2015 at 9:32:17 PM UTC+2, Randy Brukardt wrote: > "EGarrulo" wrote in message > > But is this a valid excuse? Aren't programming languages supposed to > > let programmers write useful programs? > > Within the language philosophy. If writing *your* useful programs is too > hard, then you are probably using the wrong language (or you need some > re-education, which I think applies more to the current case ;-). > > ... > > If Ada offered runtime typing by means of a type `Any`, then `Printf` > > could be trivially written as: > > > > type Printf_Arguments is array (Positive range <>) of Any; > > > > procedure Printf (Format : String; Arguments : Printf_Arguments); > > Surely, at the cost of all compile-time checking (because there isn't any). But not all conversions can be checked during compilation, that is a fact already. > And there couldn't be any useful runtime checking, either Why not? Please explain me why this is acceptable: -- This conversion will fail if Some_Integer is bigger than what -- Constrained_Integer_Type can hold. Some_Constrained_Integer := Constrained_Integer_Type (Some_Integer); whilst this is not: -- This conversion will fail if Any doesn't contain an Integer. Some_Integer := Integer (Any); I don't see any difference. Both conversions can fail at runtime because types don't match. > unless Ada added Multiple Inheritance, which is unlikely), so such a > construct would be unsafe. (Exactly how unsafe depends on the capabilities > of the format string.) If Printf took care of formatting, then the number of supported types would be limited to standard types (incidentally, this is why I envisioned an alternative where formatting happens before passing the arguments to Printf).