Re: RFR: 8287834: Add SymbolLookup::or method [v2]
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 `SymbolLookup::or` is added, which first >> searches a symbol in the first lookup, and, if that fails, proceeds to >> search the symbol in the provided lookup. >> >> We have considered alternatives to express this, such as a static factory >> `SymbolLookup::ofComposite` but settled on this because of the similarity >> with `Optional::or`. > > Maurizio Cimadamore has updated the pull request incrementally with one > additional commit since the last revision: > > Update src/java.base/share/classes/java/lang/foreign/SymbolLookup.java > > Co-authored-by: Paul Sandoz Marked as reviewed by psandoz (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/13954#pullrequestreview-1429165729
Re: RFR: 8287834: Add SymbolLookup::or method [v2]
> 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 that fails, proceeds to search > the symbol in the provided lookup. > > We have considered alternatives to express this, such as a static factory > `SymbolLookup::ofComposite` but settled on this because of the similarity > with `Optional::or`. Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/java/lang/foreign/SymbolLookup.java Co-authored-by: Paul Sandoz - Changes: - all: https://git.openjdk.org/jdk/pull/13954/files - new: https://git.openjdk.org/jdk/pull/13954/files/09637772..27e82bb6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk=13954=01 - incr: https://webrevs.openjdk.org/?repo=jdk=13954=00-01 Stats: 4 lines in 1 file changed: 0 ins; 3 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/13954.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/13954/head:pull/13954 PR: https://git.openjdk.org/jdk/pull/13954
Re: RFR: 8287834: Add SymbolLookup::or method [v2]
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 amenable to being expressed as a compact javadoc > header. ok - thanks! - PR Review Comment: https://git.openjdk.org/jdk/pull/13954#discussion_r1195456129