<div dir="ltr"><div dir="ltr">On Sat, Jun 13, 2020 at 11:31 AM Walter Bright via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/11/2020 6:55 PM, Manu wrote:<br>
>     We're not talking about templates. <br>
> <br>
> This is another one of those cases is really bizarre resistance to what seems <br>
> like a blindingly obvious thing.<br>
> Can you please explain why you feel opposed to this, and why our existing <br>
> solution, which is 'weird' by all accounts, and satisfies ZERO of the goals <br>
> assigned to inline is preferable?<br>
<br>
Specifying solutions without explaining what the problem is means I will never <br>
understand what you want. For example, I had to keep saying why? why? why? to <br>
you over several posts before you finally said what you wanted was a header only <br>
library.<br></blockquote><div><br></div><div>I felt like my OP was really clear. I identify 3 use cases for inline, and then commented on their level of importance.</div><div>I've answered your "why"s so many times.</div><div><br></div><div>#1 why? - users don't want "undefine symbol" link errors (C++ calls this 'inline')</div><div>#2 why? - users want to add a hint to override the optimisers judgement (C++ calls this `__forceinline` among various others, completely non-standard, but useful)</div><div>#3 why? - we rarely absolutely MUST inline, and we want an error if we can't (C++ doesn't have this at all. It's useful for preserving features of the calling context)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I show you how you can do that with existing D, along with an existing, working <br>
solution.<br></blockquote><div><br></div><div>Templates are not a solution, they're a weak workaround which I'm completely aware of. This thread exists because we don't want that workaround.</div><div>Templates are not functions, and inserting a template into any generic code where a function is expected leads to a sea of edge cases.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Then you say you're not talking about templates.<br></blockquote><div><br></div><div>Because we're not talking about templates. Functions are _functions_, they have a lot of semantic differences from templates.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hence I still don't know what problem(s) you are having, as I have no idea why <br>
templates are no good for you.</blockquote><div><br></div><div>We don't satisfy any of the 3 key goals in my OP.</div><div>After reading the various responses in this thread, I could rewrite that post to be clearer, but I really didn't feel it was that unclear in the first place.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> The existing implementation is inline is a COMPLETELY useless thing.<br>
<br>
I use it, and it's not useless.<br></blockquote><div><br></div><div>I'm not aware that I've ever wanted inline for any reason other than those 3 points I described. I invited others to add their own use cases if I was missing some.</div><div>You're welcome to add a use case showing how you'd like to use inline... but it doesn't implement any of my use cases today.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I suggest coming up with a complete list of what problems you are trying to <br>
solve, not a list of proposed solutions.<br></blockquote><div><br></div><div>I have, that's the OP.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
BTW, the pragma(inline) came out of a conversation you & I had at a DConf some <br>
years ago, and we talked about inline and not inlining. I don't recall you ever <br>
mentioning issues with linkage, multiple instantiations, etc.<br></blockquote><div><br></div><div>That's correct; our discussion was about what I describe in case #3.</div><div>Notably, that is a case that C/C++ has absolutely no way to express and it was very interesting to me at the time to have a way to express it.</div><div><br></div><div>I think the mistake I made at the time was that I held an underlying assumption about what inline does do, and presumed that to be a given.</div><div>We never discussed what inline does (emit to the calling CU), and I certainly never said that was incorrect functionality and that we should change that behaviour.</div><div>We didn't discuss it, I presumed it was a given, fundamental to the concept of inline, and never gave it a second thought. It never occurred to me that mechanic could come into question.</div><div><br></div><div>When I did realise that mechanic was broken though, I mentioned it at a later time, and it's never been fixed.</div><div><br></div><div>Even assuming we were producing a solution for what I describe in case #3, it still depends on #1 being effective. #1 is a baseline requirement that any incarnation of inline must have to be useful.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I also have problems understanding what you want when things are distributed <br>
piecemeal over a large number of n.g. posts. I suggest again:<br>
<br>
1. putting each problem into a bugzilla issue<br>
2. keeping a text file of URLs to those issues<br>
3. cut & paste that list as necessary and where necessary<br>
<br>
N.g. postings are utterly disorganized and ephemeral. Using targeted bugzilla <br>
issues is a far better way of organizing specific topics for change.<br></blockquote><div><br></div><div>I agree, my bugzilla issues on inline are confused. I'll straighten them out.</div></div></div>