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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,15bb83df7cabf157 X-Google-Attributes: gid103376,public From: Markus Kuhn Subject: Re: is there a FAQ? Date: 1998/05/15 Message-ID: <355CA018.747DC2C2@cl.cam.ac.uk>#1/1 X-Deja-AN: 353610309 Content-Transfer-Encoding: 7bit References: <3559AF5F.B16CCDA7@student.liu.se> <3559C828.71BF48A4@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Cambridge University, Computer Laboratory Newsgroups: comp.lang.ada Date: 1998-05-15T00:00:00+00:00 List-Id: Johann Hibschman wrote: > I'm also just looking into Ada. I tried reading the FAQ, but I > couldn't find a could very basic questions answered. Does Ada support > functional programming and closures? No, Ada is clearly not a functional programming language. It supports references to functions as parameters, but it has otherwise very little in common with functional programming languages. Ada is supporting the procedural, data abstraction, object orientation styles, in the tradition of languages like Algol, Pascal, Modula II, C, C++, Java. It is not in any way related to functional languages like Scheme, ML, Haskell, Miranda, DSSSL, etc. Unlike C and Algol, Ada does not even have conditions in expressions (A := if B then C else D), as those were considered to lead to unreadable code too easily. > I'm a bit of a language > hobbyist, and I've become quite addicted to easy temporary function > creation for mapping/reduce/etc uses. You can't create an unnamed function, often not even an unnamed type in Ada. > Is there a (convenient) way to write > > (map-into out-vector > #'(lambda (x y) (+ x (sqrt y))) > vector1 vector2) > > as I would in Common Lisp? (Or, with slight syntax changes, in ML?) You have nested functions in Ada, so creating a small function close to the place where you use it (inside a declare block) is not too inconvenient, and frequently used. Markus -- Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK email: mkuhn at acm.org, home page: