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, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!aoa!mark From: mark@aoa.UUCP (Som Hane) Newsgroups: comp.lang.ada Subject: Re: Dynamic Typing in Ada Summary: I think you have missed the point Keywords: DYNAMIC Message-ID: <730@aoa.UUCP> Date: 19 Mar 89 21:52:24 GMT References: <8903101703.AA04518@ti.com> Reply-To: mark@aoa.UUCP (Som Hane) Distribution: usa Organization: Adaptive Optics Assoc., Cambridge, Mass. USA List-Id: In article <8903101703.AA04518@ti.com> linnig@skvax1.csc.ti.com (Mike Linnig) writes: >John Gateley's (Gateley@tilde.csc.ti.com) challenge was to implement the >following lisp construct in Ada... > > ---------------------------------------------------------------------- >-- 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)))) > ---------------------------------------------------------------------- >package dynamic_types is > > [ Ada code deleted ] > >I think this answers John Gateley's (Gateley@tilde.csc.ti.com) dynamic >typing challenge. I didn't understand the first challenge; if it involved >something similar to The C Language construct allowing pointers to >procedures (and calling them) that can be handled too. > Let me start off by saying that I am a Lisp ( and C ) programmer, and have only been doing Ada for 1 year, so I may be totally off base, but... I think you may have missed the point. In the CL example above the type of "x" could be set or changed dynamically; in your Ada example it was ( and had to be ? ) set at compile time. In addition, in the CL example the range of choices in the typecase itself could be modified dynamically to be the members of an arbitrary set of types ( some of which could themselves have been dynamically created ). I do not see at all how your example can be modified to do any of these things... so I think the challenge has not been met. Mark Reynolds ...!BBN.COM!bbn!aoa!mark mark%aoa.uucp@BBN.COM