Re: RFR: 8287834: Add SymbolLookup::or method

2023-05-22 Thread Paul Sandoz
On Mon, 22 May 2023 11:51:33 GMT, Maurizio Cimadamore wrote: > So, not only the new method results in more succinct code (compared to the > alternatives), but it also combines symbol lookups in the "right way", so > that the chain of lookups is defined, once and for all, when the composite >

Re: RFR: 8287834: Add SymbolLookup::or method [v3]

2023-05-22 Thread Maurizio Cimadamore
On 17/05/2023 02:33, John Hendrikx wrote: SymbolLookup lookUp = name -> library1.find(name) .or(() -> library2.find(name)) .or(() -> loader.find(name)); What you say is true - e.g. the fact that a lookup returns an optional can be used to chain multiple lookups as you

Re: RFR: 8287834: Add SymbolLookup::or method [v3]

2023-05-16 Thread John Hendrikx
On Tue, 16 May 2023 22:36:51 GMT, Maurizio Cimadamore wrote: >> This patch adds a simpler method for composing symbol lookups. It is common >> for clients to chain multiple symbol lookups together, e.g. to find a symbol >> in multiple libraries. >> >> A new instance method, namely

Re: RFR: 8287834: Add SymbolLookup::or method [v3]

2023-05-16 Thread Maurizio Cimadamore
> This patch adds a simpler method for composing symbol lookups. It is common > for clients to chain multiple symbol lookups together, e.g. to find a symbol > in multiple libraries. > > A new instance method, namely `SymbolLookup::or` is added, which first > searches a symbol in the first

Re: RFR: 8287834: Add SymbolLookup::or method [v2]

2023-05-16 Thread Paul Sandoz
On Tue, 16 May 2023 17:06:02 GMT, Maurizio Cimadamore wrote: >> This patch adds a simpler method for composing symbol lookups. It is common >> for clients to chain multiple symbol lookups together, e.g. to find a symbol >> in multiple libraries. >> >> A new instance method, namely

Re: RFR: 8287834: Add SymbolLookup::or method [v2]

2023-05-16 Thread Maurizio Cimadamore
> This patch adds a simpler method for composing symbol lookups. It is common > for clients to chain multiple symbol lookups together, e.g. to find a symbol > in multiple libraries. > > A new instance method, namely `SymbolLookup::or` is added, which first > searches a symbol in the first

Re: RFR: 8287834: Add SymbolLookup::or method [v2]

2023-05-16 Thread Maurizio Cimadamore
On Tue, 16 May 2023 16:55:21 GMT, Paul Sandoz wrote: >> I was trying to split the sentence so that we could get a compact javadoc >> header for the factory. How much important is that? > > Not very IHMO. I was just trying to say the same thing you said with less > words, which makes it more

Re: RFR: 8287834: Add SymbolLookup::or method

2023-05-16 Thread Paul Sandoz
On Tue, 16 May 2023 16:50:34 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/foreign/SymbolLookup.java line 136: >> >>> 134: * lookup} More specifically, if a symbol is not found using this >>> lookup, the provided lookup will be >>> 135: * used as fallback.

Re: RFR: 8287834: Add SymbolLookup::or method

2023-05-16 Thread Paul Sandoz
On Fri, 12 May 2023 12:11:23 GMT, Maurizio Cimadamore wrote: > This patch adds a simpler method for composing symbol lookups. It is common > for clients to chain multiple symbol lookups together, e.g. to find a symbol > in multiple libraries. > > A new instance method, namely

Re: RFR: 8287834: Add SymbolLookup::or method

2023-05-16 Thread Maurizio Cimadamore
On Tue, 16 May 2023 16:48:13 GMT, Paul Sandoz wrote: >> This patch adds a simpler method for composing symbol lookups. It is common >> for clients to chain multiple symbol lookups together, e.g. to find a symbol >> in multiple libraries. >> >> A new instance method, namely `SymbolLookup::or`

RFR: 8287834: Add SymbolLookup::or method

2023-05-12 Thread Maurizio Cimadamore
This patch adds a simpler method for composing symbol lookups. It is common for clients to chain multiple symbol lookups together, e.g. to find a symbol in multiple libraries. A new instance method, namely `SymbolLookup::or` is added, which first searches a symbol in the first lookup, and, if