Kotlin Infix func
Kotlin Infix function 이란? ; 두 개의 객체 중간에 들어가게 되는 함수 형태 ex) val day2 = mapOf("Monday" to "월요일", "Tuesday" to "화요일") 개발자가 직접 정의하는 Infix func infix fun dispatcher.함수명(receiver): 리턴타입 { } 위와 같은 형태로 사용 가능. 위의 예시와 비교하자면, Monday가 Dispatcher고, 월요일이 receiver ex) infix fun String.add(other:String): String { return this + other } class내에 정의하면 dispatcher 생략 가능 class StringAcc { var data = "" infix fun add(re..
2023.05.03