Skip to content

How do we expose read-only methods from ImmutableBuffer in Chapter 7? #27

Answered by halpina
halpina asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry - just looking at it again and can answer my own question 😁 !! Because buffer[prop].bind(buffer) is assigned as a property to the ImmutableBuffer, that property is both the data object (buffer) and it's method (readInt8), so buffer is implicitly available when calling the readInt8 method on immutable.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lmammino
Comment options

@halpina
Comment options

Answer selected by halpina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants