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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Thu, 28 Jun 2018 20:48:11 -0700 Organization: A noiseless patient Spider Message-ID: <87lgay1cec.fsf@nightsong.com> References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t75nwad.fsf@adaheads.home> <15b6f89f-997b-45ac-86b4-2e614bb624c2@googlegroups.com> <28a46046-e7eb-4306-bc39-72bc751831ae@googlegroups.com> <400ba7f8-6875-4ba8-99ee-c105180d5d8b@googlegroups.com> <87tvpm1e2q.fsf@nightsong.com> <39b42dbe-0e74-4855-9291-bbf5a193c3b4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="966165e45452a248a610ffd33a3be8e2"; logging-data="17899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/2CjJ75wW81UhjqrvoAYd" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:wdPtIn+3ssHo3fk+lMRrfHE1ulA= sha1:W2Y4KbcWUwWAs1qtyJyVZq3HUTo= Xref: reader02.eternal-september.org comp.lang.ada:53421 Date: 2018-06-28T20:48:11-07:00 List-Id: "Dan'l Miller" writes: > It is. There are about a half dozen of the big causes of landmines in > the landmine-field that is C++. Slicing is perhaps the most > potent/pernicious/silent of those big-6. I don't understand the exact reasons but the functional-programming community tends to dislike subtypes altogether, preferring bounded polymorphism (Num a => sum :: [a] -> a) to accomplish somewhat similar goals. Maybe slicing is one of the issues. But I think it's more of an obstacle to type inference. Because of that same FP indoctrination, in C++ I tend to use generics where it might be possible to use OO instead. Does that avoid the hazards of slicing? Of course it has its own hassles, but once you get something to compile it tends to do the right thing.