Standard way to supply hints to branches
Timon Gehr
timon.gehr at gmx.ch
Fri Sep 13 11:56:21 UTC 2024
On 9/13/24 10:19, Walter Bright wrote:
> On 9/11/2024 12:46 PM, Timon Gehr wrote:
>> On 9/11/24 20:55, Walter Bright wrote:
>>>
>>>> My proposal is to allow a hint attached strictly to control
>>>> statements. (ideally as a suffix)
>>>> It is easy to read, also easy to ignore (this is important), and
>>>> extremely low-impact when marking up existing code: no new lines, no
>>>> rearranging of code, purely additive; strictly appends to the end of
>>>> existing control statements... these are very nice properties for
>>>> casually marking up some code where it proves to be profitable,
>>>> without interfering with readability, or even interfering with
>>>> historic diff's in any meaningful way that might make it annoying to
>>>> review.
>>>
>>> How is that materially different from [[likely]] annotations?
>>
>> It's associated with the branch and not with the program path.
>
> I have no idea what the difference is, as the branch determines the
> program path.
>
Well, it is the attribute being associated with the program path being
ill-defined that is being criticized in that blog post. The difference
is that for path-associated, you are saying that a specific statement is
likely or unlikely to be executed, for branch-associated, you are saying
in which direction a specific branch is likely to go.
More information about the Digitalmars-d
mailing list