<div dir="auto">Yes, you have to build it from the Babylon repo.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Dec 1, 2025, 14:35 David Alayachew <<a href="mailto:davidalayachew@gmail.com">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Thanks <span class="gmail_chip gmail_plusreply" dir="auto"><a href="mailto:amaembo@gmail.com" style="color:#15c;text-decoration:underline" target="_blank" rel="noreferrer">@Tagir Valeev</a></span>.<div dir="auto"><br></div><div dir="auto">I am still not great at the stuff Babylon is doing, so I can only roughly follow along. Regardless, it sounds like this is depending on Babylon features which have not yet landed in the mainline jdk, yes?</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 1, 2025, 5:22 AM Tagir Valeev <<a href="mailto:amaembo@gmail.com" target="_blank" rel="noreferrer">amaembo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think this will surely be possible for RecordComponents with code reflection (project Babylon), using the syntax you propose.<div><br></div><div>You can create a quotable function like this:</div><div><br></div><div>import jdk.incubator.code.*;</div><div><br></div><div>@Reflect<br></div><div>@FunctionalInterface</div><div>interface Accessor {</div><div> Object get(Record r);</div><div>}</div><div><br></div><div>Then create something like (just a sketch, sorry, I have no time now to provide a full-fledged sample):</div><div><br></div><div>static RecordComponent foo(Accessor acc) {</div><div> Quoted q = Op.ofQuotable(acc).orElseThrow();</div><div> // extract a method handle from q using Babylon API</div><div> // unreflect it and find the corresponding RecordComponent</div><div>}<br><a class="gmail_plusreply" rel="noreferrer noreferrer"><br></a></div><div>With best regards,</div><div>Tagir Valeev</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 29, 2025 at 8:45 PM David Alayachew <<a href="mailto:davidalayachew@gmail.com" rel="noreferrer noreferrer" target="_blank">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello <a class="gmail_plusreply" id="m_-6545955205200716692m_-5341124393457924939m_2513946637271001261plusReplyChip-2" href="mailto:amber-dev@openjdk.org" rel="noreferrer noreferrer" target="_blank">@amber-dev</a>,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">I asked this on core-libs-dev already, but I figured I should ask here too.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Let's say I have some record User(String firstName, String lastName) {}.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Is there any possible way for me to do the following?</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">java.lang.reflect.RecordComponent firstName = foo(User::firstName);</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">I'll even accept this.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">java.lang.reflect.Method lastName = foo(User::lastName);</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Thank you for your time and consideration.</div><div class="gmail_default" style="font-family:monospace">David Alayachew</div></div>
</blockquote></div>
</blockquote></div></div></div>
</blockquote></div>