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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.mind.de!bolzen.all.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: why learn C? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230352.808212.15550@e65g2000hsc.googlegroups.com> <1175236212.771445.135460@y66g2000hsf.googlegroups.com> <1175308871.266257.77460@e65g2000hsc.googlegroups.com> <1175501602.127760.186120@q75g2000hsh.googlegroups.com> <1yveg1eads.fsf@hod.lan.m-e-leypold.de> Date: Sun, 15 Apr 2007 09:55:02 +0200 Message-ID: NNTP-Posting-Date: 15 Apr 2007 09:54:06 CEST NNTP-Posting-Host: 121e4d76.newsspool1.arcor-online.net X-Trace: DXC=_\BH3YRHiNC=jUAX4RDNcfSJ;bb[UIRnRBaCd On Sun, 15 Apr 2007 00:55:19 GMT, Hyman Rosen wrote: > Markus E Leypold wrote: >> This is only necessary because C/C++ has no way to specify a >> constant array (i.e. a "array literal"). > > Not really. The preprocessor stuff is generating program code as > well as data. Think about "properties" - you need to code a getter, > a setter, a place to hold the value, a type, a descriptive string, > and so forth. The language syntax may not allow all of this to be > in one place, and that's where macros can come in handy. If the language does not provide abstract member interface (primitive operations for ".Foo") that is a deficiency. I think that the idea of having tools (and meta programming) instead of fixing the language is wrong. Surely there exist border cases used rarely, which aren't worth the efforts. But getter/setter is IMO not among them. In your example type is superfluous, it should be determinable from the value. The value and the string would be a tuple used in the setter. For tuples one would also need user-defined aggregates, otherwise the string length discriminant of the tuple could not be evaluated from the string value. Maybe anonymous record types..., anyway, I think that the sugar X.Foo := (1.35, "Blah"); is solvable in a statically typed language without preprocessing. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de