datadirectedprogramming
연산에 관련된 table에 flag(보통 tag라고 함)를 달아서 operators 가 자료(type)에 따라 다르게 연산하도록 한는 기법
operators 를 추상화 하는것이라고 보면 된다. generic operators(smart operators)!!
table의 예
Type | Operations | ||||||||
generic operators | combine | equality | nth item | size | |||||
words | word | eq? | item | count | |||||
numbers | + | = | item | count | |||||
strings | string-append | string=? | string-ref | string-length | |||||
lists | append | equal? | list-ref | length | |||||
vectors | vector-append | equal? | vector-ref | vector-length |
—- 과학의 메인 아이디어는 추상화 라니깐..
datadirectedprogramming.txt · Last modified: 2018/07/18 14:10 by 127.0.0.1