Skip to Content
프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
book

프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)

by 오현석, 딘 왐플러, 알렉스 페인
July 2016
Beginner to intermediate
776 pages
17h 26m
Korean
Hanbit Media, Inc.
Content preview from 프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)
655
19
스칼라 동적 호출
지원하는 것이 불가능하지는 않지만, 모든 가능한 값 타입이 그런 연산을 지원하지는 않기 때문
에 구현이 쉽지 않다.
19.3
DSL
에서 고려할 점
Dynamic
트레이트는 내장 또는 내부
DSL
을 정의할 수 있도록 스칼라가 제공하는 여러 도구 중
하나다. 다음 장에서
DSL
에 대해 더 자세히 다룰 것이다. 지금은 몇 가지 사실만 지적하고 싶다.
첫째, 구현을 이해하기 쉽지 않다. 이는 이런 프로그램은 유지보수하고, 디버깅하고, 확장하기 쉽
지 않다는 의미다. 동적 호출과 같은 ‘멋진’ 도구를 사용하는 것은 매우 매력적이지만, 여러분이
투입한 노력에 대해 후회하게 되기도 쉽다. 따라서
Dynamic
이나 다른
DSL
기능은 사려 깊게 사
용해야 한다.
둘째, 모든
DSL
구현을 어렵게 만드는 도전 과제는 의미 있고 사용자에게 도움이 되는 오류 메
시지를 제공하는 것이다. 앞에서 우리가 사용했던 예제를 가지고 실험을 해보면, 컴파일러가
이해할 수 없는 구문을 쉽게 작성할 수 있고, 그런 경우
DSL
시스템에서 제공하는 오류 메시지
가 그리 유용하지 않다는 사실도 쉽게 알 수 있다 (힌트: 몇몇 마침표와 괄호를 제거한 중위 표
기법을 사용해보라 ).
셋째, 좋은
DSL
은 사용자가 논리적으로 옳지 못한 내용을 작성할 수 없도록 막을 수 있어야 한
다. 여기서 본 단순한 예제에서는 실제로 그런 문제가 없지만, 더 고급 기능의
DSL
을 작성하다
보면 그런 목표가 도전 과제가 될 것이다.
19.4
마치며
이 장에서는 루비와 같은 동적 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

스파크를 이용한 자연어 처리 : 대규모 텍스트를 다루는 가장 효율적인 딥러닝을 만나다

이창현, 앨릭스 토머스

Publisher Resources

ISBN: 9788968482755