From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Newbie question # 2 Date: Thu, 6 Aug 2020 23:08:00 +0300 Organization: Tidorum Ltd Message-ID: References: <8b2858e0-e69c-4a22-ad51-a6a7c51e7a7do@googlegroups.com> <7348444d-f3a1-4bd2-823c-7c67052c0a5co@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 8v5CsAa/dQA5ytTO+nDz/AUe2/gbLV6sN+gDjAI3DJ2feIXGO+ Cancel-Lock: sha1:nDIJErLGYBqEhPJYmE52fcmZ948= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <7348444d-f3a1-4bd2-823c-7c67052c0a5co@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:59679 List-Id: On 2020-08-06 22:45, Ian Douglas wrote: > On Thursday, 6 August 2020 21:20:15 UTC+2, Niklas Holsti wrote: >> >> Ada does not have such a feature. > > I figured as much, probably "unsafe programming practice" at the end of the day. I wouldn't say so. I think "namelist" input is a perfectly reasonable function to have in some programs, and is not particularly unsafe in any way -- if the programmer can limit the set of variables that can be named and changed by such input, which is the case in Fortran (and also in our various suggestions for implementing it in Ada). PHP is (I believe) an interpreted language, so the symbol table is around at run-time, which makes it easy for PHP to support variables that refer to any other variable by its symbolic name. This can make "namelist" input in PHP unsafe, since the input can change any variable -- including variables that the programmer did not intend to be changeable in this way. Ada is usually compiled, and the symbol table is not present when the compiled program runs, so it would be harder to implement a "namelist" input/output feature. But not impossible, as Fortran shows. -- Niklas Holsti niklas holsti tidorum fi . @ .