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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,571930b4ff0bc1ee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-27 06:44:06 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!freenix!sunqbc.risq.qc.ca!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!uunet!dca.uu.net!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Compile time executed functions Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Tue, 27 Mar 2001 14:39:36 GMT References: <3AC03CCE.70E3C2D5@mida.se> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:6111 Date: 2001-03-27T14:39:36+00:00 List-Id: Mats Karlssohn writes: > Sometimes, especially when doing embedded programming, I feel a great > need to execute a function to get literal initialization a constant. > That is I'd like to have the compiler to execute a function for me (at > compiletime!) and use the return of that function to initialize the > constant. If you inline the function, you are likely to get what you want, depending on how good the compiler's support for inlining is. > I realize that a lot of limitations must be put on the > Generate_CRC_Table function, but, have something along these lines been > considered by the language designers. I don't think it's really a language design issue. The language doesn't talk about how clever the compiler is about doing things at compile time, nor about what goes in ROM vs RAM. - Bob