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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.albasani.net!.POSTED!not-for-mail From: Dirk Heinrichs Newsgroups: comp.lang.ada Subject: Re: Beginning Ada Programming, by Andrew T. Shvets (2020) Date: Thu, 5 Dec 2019 17:35:58 +0100 Organization: albasani.net Message-ID: References: <87muca3vgd.fsf@nightsong.com> <57d49047-0a61-4d13-8822-d004732a3acc@googlegroups.com> <3b1b248b-43d0-4762-b1f5-1c5460d24c8b@googlegroups.com> <5e222e6c-7afe-4349-ac66-d9b78ca40ec6@googlegroups.com> <27b11294-d628-4118-8328-a4a9a3946937@googlegroups.com> <80bcdfd1-b1e5-4ebf-aa8a-4beaba5ec3c2@googlegroups.com> <60e61003-409d-4bd5-9784-8ddad5942934@googlegroups.com> <4f659af6-c840-4509-9f76-e9a96b547a55@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net FRrUF9MtCBgQDMEkIJ0He9GQ2CdB2HunBBMC9xNGWr3n/B28RtyZAby3UHsYzgSJzD8f0CwdajfX+pqGuVXoNHhtdEfgtAvMTrfIVMhf3rbM7CUNkLN0vDAap57sSdhx NNTP-Posting-Date: Thu, 5 Dec 2019 16:35:58 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="yu+6Ar+hhLLWxz4DZGPjAq4yNMaQHE+TwC/K86blRpIo+xm5CkNyF7M2FCOPh31lBAKb65SUnHbNxSiQVLDFEVhXdBIxPIfg/9eAce0DkqloLf1aEO0y5HP68qqwKadP"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <4f659af6-c840-4509-9f76-e9a96b547a55@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:24TxcSvOhU8hOO+4E9Y2pP6ydjQ= Xref: reader01.eternal-september.org comp.lang.ada:57655 Date: 2019-12-05T17:35:58+01:00 List-Id: Am 03.12.19 um 18:02 schrieb Shark8: > Perhaps the easiest way to do this is by doing something that's (e.g.) much more complex in C, but relatively straightforward in Ada -- perhaps modeling a Password in the software: > > Type Digit is Character Range '0'..'9'; > Type Upper_Case is Character Range 'A'..'Z'; > Type Lower_Case is Character Range 'a'..'z'; > Type Symbol is Character > with Static_Predicate => Symbol in '!'|'@'|'#'|'$'|'%'|'^'|'&'|'*'; > > Minimum_Length : Constant := 8; > Maximum_Length : Constant := 32; > > Type Password is new String > with Dynamic_Predicate => Password'Length in Minimum_Length..Maximum_Length > and (For all C of Password => C in Digit|Upper_Case|Lower_Case|Symbol); That's a really nice one. How would the predicate look like if the PW was to start with a lowercase character? Bye... Dirk -- Dirk Heinrichs GPG Public Key: D01B367761B0F7CE6E6D81AAD5A2E54246986015 Sichere Internetkommunikation: http://www.retroshare.org Privacy Handbuch: https://www.privacy-handbuch.de