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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:2166 comp.software-eng:1255 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!killer!rpp386!dalsqnt!pollux!ti-csl!m2!gateley From: gateley@m2.csc.ti.com (John Gateley) Newsgroups: comp.lang.ada,comp.software-eng Subject: Re: Ada vs. LISP Keywords: Ada LISP Message-ID: <71886@ti-csl.csc.ti.com> Date: 10 Mar 89 03:31:42 GMT References: <6125@medusa.cs.purdue.edu> <4624@hubcap.UUCP> <6153@medusa.cs.purdue.edu> <7682@venera.isi.edu> <45978@linus.UUCP> Sender: news@ti-csl.csc.ti.com Reply-To: gateley@m2.UUCP (John Gateley) Followup-To: comp.lang.ada Organization: TI Computer Science Center, Dallas List-Id: 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