comp.lang.ada
 help / color / mirror / Atom feed
From: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>
Subject: Re: is there a FAQ?
Date: 1998/05/15
Date: 1998-05-15T00:00:00+00:00	[thread overview]
Message-ID: <355CA018.747DC2C2@cl.cam.ac.uk> (raw)
In-Reply-To: mtn2cjl6h6.fsf@leporello.berkeley.edu


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: <http://www.cl.cam.ac.uk/~mgk25/>




  reply	other threads:[~1998-05-15  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-13  0:00 is there a FAQ? Cristian Libardo
1998-05-13  0:00 ` Markus Kuhn
1998-05-15  0:00   ` Johann Hibschman
1998-05-15  0:00     ` Markus Kuhn [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-05-15  0:00 adam
1998-05-15  0:00 ` Brian Rogoff
     [not found]   ` <Et0xrx.798@world.std.com>
1998-05-16  0:00     ` Brian Rogoff
1998-05-16  0:00     ` Fergus Henderson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox