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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,42e401e32683b965 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!r18g2000yqd.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: A new notion: stronglly-typed-by-user language Date: Sat, 17 Apr 2010 07:33:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: <57119c7d-eb78-4904-a2de-bf183b03ccf0@r18g2000yqd.googlegroups.com> References: NNTP-Posting-Host: 85.1.204.101 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1271514804 20256 127.0.0.1 (17 Apr 2010 14:33:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 Apr 2010 14:33:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r18g2000yqd.googlegroups.com; posting-host=85.1.204.101; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:10042 Date: 2010-04-17T07:33:24-07:00 List-Id: On 17 Kwi, 07:25, "J-P. Rosen" wrote: > >http://www.msobczak.com/prog/typegen/ > > This shows that an educated Ada programmer, well aware of the issues of > strong typing, can mimmic the same behaviour in C++. But how many C++ > programmers use that? Not many, but that does not matter in this discussion - we are discussing the language, not programmers. > > I don't see how type promotion violates the strong type safety. > > Type promotion is based on the underlying representation, not on > abstract types. No. Type promotions in C++ are defined in terms of values, not in terms bit patterns. There is nothing that forces char and int to have similar underlying representation, yet promotion from char to int is well-defined. > And it is a form of automatic type case - which is > always a bad idea IMHO. There are many bad ideas in C++. I don't see how this one affects strong type safety. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4