comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Starter project: getopt_long in Ada
Date: Sun, 27 Nov 2011 16:11:54 +0100
Date: 2011-11-27T16:11:54+01:00	[thread overview]
Message-ID: <op.v5l1t4w1ule2fv@douda-yannick> (raw)
In-Reply-To: slrnjd4bar.vl6.lithiumcat@sigil.instinctive.eu

Le Sun, 27 Nov 2011 13:30:28 +0100, Natasha Kerensikova  
<lithiumcat@gmail.com> a écrit:
> 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 “I” 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 use
> two access-to-subprograms, but they are really meant to be completely
> different sources (one creates tokens from input while the other outputs
> 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 an  
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 provides  
fall in this case), the difference can become really tiny I believe. You  
can imagine some way for a compiler to optimize it.

> Natasha


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: [Epigrams on Programming — Alan J. — P. Yale University]



  reply	other threads:[~2011-11-27 15:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 10:47 Starter project: getopt_long in Ada Natasha Kerensikova
2011-11-25 16:39 ` Georg Bauhaus
2011-11-26 18:13   ` Natasha Kerensikova
2011-11-26 20:47     ` Jeffrey Carter
2011-11-28 15:49     ` Georg Bauhaus
2011-11-28 17:18       ` Natasha Kerensikova
2011-11-27  8:21   ` Yannick Duchêne (Hibou57)
2011-11-27 12:30     ` Natasha Kerensikova
2011-11-27 15:11       ` Yannick Duchêne (Hibou57) [this message]
2011-11-28  8:21         ` Natasha Kerensikova
2011-11-28 13:02           ` Yannick Duchêne (Hibou57)
2011-11-27  8:05 ` Yannick Duchêne (Hibou57)
2011-11-27 12:39   ` Natasha Kerensikova
2011-11-27 14:52     ` Yannick Duchêne (Hibou57)
2011-11-27  8:09 ` Yannick Duchêne (Hibou57)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox