> Any recipe R that uses LOOKUP automatically works with all the data structures that LOOKUP works with, even though R itself may be a specific recipe for a specific data structure of its own.
this seems similar to protocol extensions + associated types as used in swift maybe?https://docs.swift.org/swift-book/documentation/the-swift-pr...
Yes. I don't know Swift, but it appears that Swift's protocol and class are similar to Java's interface and implementation (class), and defining a protocol would be required in Swift in order to define a generic table.LOOKUP(key) operator.