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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed2.news.rcn.net!rcn!feed3.news.rcn.net!not-for-mail Sender: jsa@rigel.goldenthreadtech.com Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> <10qlsg9l2dvm0$.1hmtmnbmktmk$.dlg@40tude.net> From: jayessay Organization: Tangible Date: 07 Sep 2004 11:25:13 -0400 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: DXC=8Jho\Q7D0\gdePdd<;jV^n0R]m=BkYWIg:6bU3OT9S9jXBbeQGUQ43j^aM2i8keRmmNZgTLRVQ;8b X-Complaints-To: abuse@rcn.com Xref: g2news1.google.com comp.lang.ada:3436 Date: 2004-09-07T11:25:13-04:00 List-Id: "Dmitry A. Kazakov" writes: > On 06 Sep 2004 17:12:54 -0400, jayessay wrote: > > >> And if you open files or lock mutexes or consume any other limited > >> resource, you are going to have to ensure they are released by > >> writing the equivalent of a destructor. > > > > Macros eliminate this sort of "boiler plate" code. These are nothing > > at all like a destructor. Most other uses of "destructors" typically > > revolve around "memory management" which obviously is pretty > > irrelevant in Common Lisp. > > > > A typical example here would be with-open-file. You simply do not > > need to be concerned with the maintenance of the file/os resource, > > etc. It is handled for you and guranteed to be cleaned up when > > leaving scope whether by normal or exceptional flow. > > > > Same with locks: > > > > ;;; Serialize access, lock for update, guarantee unlock on exception, > > ;;; and unlock/commit on success > > ;;; > > (with-protected-resource (get-database :medline-journals) > > (foo it) > > (bar it)) > > That's because LISP is not truly dynamic. In a really dynamic language the > scopes should be regarded as superfluous as type information, they just > bind programmer's fantasy and creativity. Bad enough, the nasty compiler > might guess your intention (to lock something). What is worse is that the > code maintainer could do it too! Garbage collectors solve this. My favorite > language is MS-DOS: format C: /q solves everything. Whatever floats your boat, bro... /Jon -- 'j' - a n t h o n y at romeo/charley/november com