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: How to get Ada to ?cross the chasm?? Date: Sun, 29 Apr 2018 14:20:42 -0700 Organization: A noiseless patient Spider Message-ID: <87fu3dogk5.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <87efiyuh10.fsf@jacob-sparre.dk> <87vacanebz.fsf@nightsong.com> <87a7tlvppi.fsf@jacob-sparre.dk> <87k1sponey.fsf@nightsong.com> <658b4dfa-6c52-42d0-a289-8c612e6ee6a5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="44469886d7cbf8c147a14f89ea91dade"; logging-data="7408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jadJKDvw4PdN1oaJZMEHf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:31ozGb4kg1Yapji2r/u/NF8DZy4= sha1:5km77E6DKi/MLvcpfG3W7pTW3C0= Xref: reader02.eternal-september.org comp.lang.ada:51810 Date: 2018-04-29T14:20:42-07:00 List-Id: gautier_niouzes@hotmail.com writes: > You definitely missed most of Ada language, because it's standard Ada > features. You can have expressions of types of any complexity > returned from a function, as parameters, as operator parameters etc. > Catch up! Ok, here is I write a nested array in Python: x = [[1, 2], [3, 4], [5,6]] In Haskell I can add a type signature (but I don't have to, since the compiler can figure it out automatically): x :: [[Integer]] x = [[1, 2], [3, 4], [5,6]] Here's a dictionary in Python: { 'alice': 5, 'bob': 10, 'charlie': 15 } If there's an equivalent in Ada, that's good to know. > Ada has more powerful ways to manage memory, and it's automatic as well. > Mostly it's through stack; I wouldn't call that more powerful, but it's useful, and compilers for gc'd languages sometimes can recognize situations where they can stack-allocate stuff. I do use unique_ptr in C++ so I'm familiar with the style.