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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e016ae58737f34 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: win32ada design question/problem Date: 1998/11/16 Message-ID: <36501A46.82C348D3@elca-matrix.ch>#1/1 X-Deja-AN: 412364545 Content-Transfer-Encoding: 7bit References: <364C5EDE.4F402D13@elca-matrix.ch> <364c90eb.10939677@SantaClara01.news.InterNex.Net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-16T00:00:00+00:00 List-Id: Tom Moran wrote: > Win32Ada is just a thin binding to that, and Windows (based on C) uses > the equivalent of Unchecked_Access all over. You either swallow hard > and do C-ish code with Ada syntax, or you hide it in a thicker > binding. I disagree. Windows was written in C, as was UNIX, and the same problems would appear in a UNIX binding if it were done the same way (using fancy access types). I think the problem with this binding is the inappropriate use of general access types, because: - they encourage using global declarations for the parameters (and this is actually happening: see the examples), when using 'Unchecked_Access would be far better. - they don't document what is actually being done, e.g. to pass a string, you must pass an '(Unchecked_)Access to its first character, which is definitely not the Ada way of doing things and could even be a problem with an aggressive optimizer. I think a binding done with System.Address for pointers and strings, and Interfaces.C.Int for integers, would be far better. It's the way thin bindings were done in Ada 83 and it's a method that has always worked fine and does not have the general access type approach's problems.