From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.7 required=3.0 tests=BAYES_00,NICE_REPLY_A, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Unifont static compiled and stack size... Date: Tue, 15 Aug 2023 10:40:45 +0200 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 15 Aug 2023 08:40:45 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f1acf26e01205de9b47de1be82eecae9"; logging-data="2902178"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187mj5C95ZGQH2amKNI7ucMQLoUoOBaPb0=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Cancel-Lock: sha1:++a4/CwPyUwjMa9GwvYdlRn2XC8= In-Reply-To: Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:65527 List-Id: On 14.08.23 10:31, Dmitry A. Kazakov wrote: > > P.S. I always wanted static functions in Ada for the purpose of all static initializations of objects like maps etc. > If data form the equivalent of a static Ada array, thus a mapping from an index type to a value type, could you approximate the static initialization of maps using expression functions? Simplifying example: package sttc is type Key is range 1 .. 7; type Value is new Character; type Cursor is private; function lookup (K: Key) return Cursor; function element (C: Cursor) return Value; private type Cursor is new Key; end sttc; package body sttc is function lookup (K: Key) return Cursor is (Cursor (K)); function element (C: Cursor) return Value is (case C is when 1 => 'M', when 2 => 'M', when 3 => 'X', when 4 => 'X', when 5 => 'I', when 6 => 'I', when 7 => 'I' ); end sttc;