You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lambda with receiver is something that you can pass to another function, so that the other function would call it, and pass the receiver object that you would be able to access in the body of the lambda. An extension function is something that you can only call directly.
수신자를 가지는 람다는 다른 함수로 전달 가능한 존재이다. 즉, 다른 함수가 이를 호출하고, 람다의 바디에 접근할 수 있는 수신자 객체를 전달할 수 있다. 익스텐션 함수는 그저 직접 호출 가능한 존재이다. 내가 써놓고도 뭔소린가 싶다.
간단하게 이런 뜻이다.
this의 사용 유무를 가장 중요한 기준으로 할 때
this를 사용할 수 있다는 것은 람다 자체를 넘기는 것만으로도 객체에 대한 레퍼런스는 따라 간다는 뜻이다.
반대로 this를 사용할 수 없음은 객체에 대한 레퍼런스를 유지하기 위해 이를 직접 매개 변수로 넘겨야 한다.
선데이사당 모임에서 문득 @Pluu 님의 질문:
차이를 알아보기 위해 간단하게 decompile
2차 시도
일단 내용을 알아보도록 하자.
사실 이 답변이 제일 맞다고 생각한다.
간단하게 이런 뜻이다.
with receiver
TODO: Standard.kt를 파보기로 한다.
The text was updated successfully, but these errors were encountered: