Created
July 23, 2019 09:41
-
-
Save wwj718/ba5300c56d5b884785f04f8b65621bbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
目标: 构建中文dsl | |
Date today | |
"hello" size | |
'hello' executeMethod: ('hello' class lookupSelector: #size) | |
[:x | Date executeMethod: (Date class lookupSelector:x) ] value: #today | |
|日期 今天 周| | |
日期 := [:x | Date executeMethod:(Date class lookupSelector:x) ]. | |
今天 := #today. | |
日期 value: 今天. | |
|日期 今天 周| | |
日期 := [:x | Date perform: x]. | |
今天 := #today. | |
周 : = #weeks | |
日期 value: 今天. | |
'hello world' perform: #size | |
'hello world' perform: #size. | |
'hello world' perform: 'size' asSymbol. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment