On Thu, 27 Jan 2022 19:28:01 GMT, Tyler Steele <d...@openjdk.java.net> wrote:

> 
> This is a good suggestion. I thought about doing it before, but I am used to 
> tamping down my functional programming instincts when writing C.

You are right, it's generally good to do things the way they are done. When in 
Rome. But in this case, Rome already uses closures. Not textbook-like with 
operator overloading, but still. Just grep the hotspot sources for "Closure" 
and you see what I mean.

> That said, this option required no additional memory allocation, so it 
> removes any need for the class I wrote before. My implementation is a little 
> brittle, as I chose to take os::LoadedModulesCallbackFunc, rather than a more 
> general type (and having to construct a closure etc.). This should save on 
> indirection for now, and could be extended in the future if needed.

I'm sure whatever you come up will be fine from your description. Note that 
long term you'll be the maintainer, so you will have first say in taste matters 
like these.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6885

Reply via email to