Skip to content

자바의 디스크립터에 대한 고찰 #31

Discussion options

You must be logged in to vote

다른 함수형 프로그래밍 언어는 잘 모르지만, 자바에서 제공하는 함수 디스크립터는 추상 메서드를 1개만 정의할 수 있다는 점이 제약인 듯 합니다.

예를 들어, 자바스크립트의 경우 아래처럼 한 객체 내에 여러 메서드를 포함할 수 있습니다.

const calculator = {
  add: (a, b) => { return a + b; },
  subtract: (a, b) => { return a - b; },
  multiply: (a, b) => { return a * b; },
  divide: (a, b) => { return a / b; },
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahngilwoong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ahngilwoong 길웅님을 위한 라벨입니다.
2 participants