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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cfb2002511b830ab X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.35.131 with SMTP id h3mr20719046pbj.1.1322406716119; Sun, 27 Nov 2011 07:11:56 -0800 (PST) Path: lh20ni24260pbb.0!nntp.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news-transit.tcx.org.uk!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Starter project: getopt_long in Ada Date: Sun, 27 Nov 2011 16:11:54 +0100 Organization: Ada @ Home Message-ID: References: <4ecfc4c4$0$6579$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: B0fj88Qo5RPyajGtdWC/cQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.60 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:19197 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2011-11-27T16:11:54+01:00 List-Id: Le Sun, 27 Nov 2011 13:30:28 +0100, Natasha Kerensikova = a =C3=A9crit: > especially access to > subprograms (which are immune to most of access types problems like > dangling stuff or leaks). Yes, indeed (cheese) > It's just that I don't like at all having a tagged type for only one > dispatching operation (and no obvious need for internal state). If you think Specification, you should not say =E2=80=9CI=E2=80=9D here.= > Of course that's only when considering related operations. In another > project that I will publish soon (still needs a bit of polishing), I u= se > two access-to-subprograms, but they are really meant to be completely > different sources (one creates tokens from input while the other outpu= ts > the token, and the whole point of the separation is to have different > input-analysis and output-generation that can plugged together). So in= > that case, I count them as two independant single-operation cases. Your Markdown processor ? > My wild guess is that tagged types would need two dereferences while > access to subprogram only one, With an access to a subprogram, there is a reference to an address and a= n = address dereference; with a tagged type, there is a reference to an = instance and a selector (is that the good word? I'm not sure). I see two= = for both. > but that might end up being optimized > into the same thing, and it's probably too little a performance > difference to matter in most situations. With batched operations (an iteration like the one your interface provid= es = fall in this case), the difference can become really tiny I believe. You= = can imagine some way for a compiler to optimize it. > Natasha -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: [Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univer= sity]