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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:2160 comp.software-eng:1249 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!srcsip!gumby!tking From: tking@gumby.SRC.Honeywell.COM (Tim King) Newsgroups: comp.lang.ada,comp.software-eng Subject: Re: Ada vs. LISP Message-ID: <18385@srcsip.UUCP> Date: 9 Mar 89 17:22:33 GMT References: <45978@linus.UUCP> Sender: news@src.honeywell.COM In-reply-to: eachus@mbunix.mitre.org's message of 6 Mar 89 16:52:26 GMT List-Id: In article <45978@linus.UUCP> eachus@mbunix.mitre.org (Robert 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. There were a few > problems in the early drafts, but they were all eliminated by the > final draft. > ... > (There are certain LISP lexical conventions that are incompatible with > Ada, but they are easily dealt with: 'a --> QUOTE(A).) Now, I'm no world class Lisp hacker, but I do know Ada, and I know enough about Lisp that I almost choked on my tongue when I read this. I showed this article to an associate who is heavily involved with Lisp (eg, as a member of the ANSI Common Lisp standards committee, and as a longtime Lisp zealot). He suggested that you might consider the following points: 1) Lisp's ability to store arbitrary objects in arrays regardless of the type of the object (ditto for lists, hash tables, etc.). 2) The first class nature of functions in Lisp. 3) Lisp's ability to share state among closures (you might be able to do this with Ada tasks). 4) Lisp macros. 5) Lisp symbols (they have plists and function bindings). 6) Lisp's complex type specifiers (e.g. type foo is either an integer or an array). 7) And so on. In a nut shell Ada can't support Lisp's view of typing, and functions are not first class objects in Ada. Even if you could somehow solve these problems, the performance of the resulting "AdaLisp" would be abysmal. If you *really* don't have anything better to do, try to write the following code in Ada: (defun funs (n) (let ((z n)) (cons #'(lambda (x) (incf z x)) #'(lambda (x) (decf z x))))) (setq foo (funs 0)) (funcall (car foo) 10) => 10 (funcall (cdr foo) 3) => 7 (=> is a short hand for evaluates to, and is not part of Common Lisp) ----------------------------------------------------------------- Tim King | Honeywell Systems & Research Center | Are we having fun yet? Mpls, MN 55418 |