OS/X OpenGL
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed May 10 13:52:00 UTC 2023
On 10/05/2023 14:05, Michael Hall wrote:
> Basically you’re saying you need a length 5 chain that needs to be
> searched for the leaf? Yes, ultimately you would at some point.
> Possibly you would be over working a lambda? I thought it might be
> more a convenience to the developer if they have a collection of
> Path’s they could specify them in one invocation of libraryLookup and
> the api would manage the necessary multiple SymbolLookup’s searching
> for the leaf. The developer can of course manage this themselves
> although again at some point maybe not with a lambda.
>
What I'm saying is this:
```
SymbolLookup MY_LOOKUP = SymbolLookup.compose(
libraryLookup("lib1", arena),
libraryLookup("lib2", arena),
libraryLookup("lib3", arena),
libraryLookup("lib4", arena),
...
libraryLookup("libN", arena));
```
Doesn't seem bad. You get back a single lookup, which is then used to
perform several lookups. If we can achieve same behavior via simple
composition, that seems better/more flexible to me. Symbol lookups are
created once (at the start of your application) and then "forgot", so I
don't think there's a lot of value in making the above more succinct (at
the expense of API regularity).
Maurizio
More information about the panama-dev
mailing list