comp.lang.ada
 help / color / mirror / Atom feed
From: gateley@m2.csc.ti.com (John Gateley)
Subject: Re: Ada vs. LISP
Date: 10 Mar 89 03:31:42 GMT	[thread overview]
Message-ID: <71886@ti-csl.csc.ti.com> (raw)
In-Reply-To: 45978@linus.UUCP

In article <45978@linus.UUCP> eachus@mbunix (Robert I. Eachus) writes:
>     One of the things which I did during the ANSI standardization of
>Ada was to look for ANYTHING in the standard which would make
>translation of LISP programs into Ada difficult.

Hmmm.... how would the following programs be written in Ada:
(I give both Scheme and CL versions, take your pick)

Scheme                           CL
(define x                        (defun x (n)
  (lambda (n)                      (function (lambda (m)
    (lambda (m)                       (+ n m)))
      (+ m n))))

that is, how can you write first class functions? These are quite
useful for things like writing an interpreter for Lisp in Lisp, or
a denotational semantics, or table abstractions where the elements are
functions etc.

Scheme                           CL
(define print                    (defun print (x)
  (lambda (x)                      (typecase x
    (cond                            (integer 1)
      ((integer? x) 1)               (real 2)
      ((real? x) 2)                  (complex 3)
      ((complex? x) 3)               (vector 4)))
      ((vector? x) 4))))

that is, how can you write dynamically typed functions?

I do not think you can.
These two features of Lisp that I have highlighted are fundamental aspects
of the langauge. That is, it is not fair to say that you can translate
programs from Lisp to Ada unless you can handle these cases as well.
I am assuming that you do not mean you can write a Lisp compiler in Ada
(since you can do that in any language), but that you can translate
any expression in Lisp into a corresponding Ada fragment.

John
gateley@tilde.csc.ti.com

  parent reply	other threads:[~1989-03-10  3:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-02-22 10:56 "Forced to Use Ada" Edward Berard
1989-02-27 23:28 ` Bob Hathaway
1989-03-01 23:49   ` A. Jeff Offutt
1989-03-02 20:04     ` Bob Hathaway
1989-03-03 17:21       ` Paul Raveling
1989-03-05  1:07         ` Bob Hathaway
1989-03-06 16:52         ` Ada vs. LISP Robert Eachus
1989-03-09 17:22           ` Tim King
1989-03-09 20:40           ` C++ vs. Ada (was Ada vs. LISP) Archie Lachner
1989-03-10  3:31           ` John Gateley [this message]
1989-03-13 19:23             ` Ada vs. LISP Robert Eachus
1989-03-12 16:22           ` Steven D. Litvintchouk
1989-03-15  1:33         ` "Forced to Use Ada" Douglas Miller
1989-03-15 17:29           ` Paul Raveling
1989-03-16 14:06         ` karl lehenbauer
1989-03-09  5:36     ` Harry S. Delugach
  -- strict thread matches above, loose matches on Subject: below --
1989-03-08 22:05 Ada vs. LISP Bob Riemenschneider
replies disabled

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