Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPN-1:基础语法设计 #1

Open
lg6s opened this issue Oct 30, 2018 · 1 comment
Open

CPN-1:基础语法设计 #1

lg6s opened this issue Oct 30, 2018 · 1 comment

Comments

@lg6s
Copy link
Member

lg6s commented Oct 30, 2018

执行顺序:
无空格:从左往右顺序执行
空格:从右往左执行(先执行无空格
斜杠无空格:从左往右,传参
斜杠空格:从左往右,传参,并行(spawn
空斜空:从左往右并行
双斜杠:平级上下文,依次执行
斜空斜:平级上下文,同时执行
反引号:从左往右递进(比如替代oop里的.
逗号:依次执行;逻辑and
分号:分段;逻辑or
句号:结尾(等价于空行
减号:连接符
单行注释:井号空格
区块:- ... =
等价:例如:等价于-=

修饰符 同义 备注
^ public
$ static
_ private

定义规则:

例一:

def f(x:int): return 1+x
def f2(x):
  returnx+x
def f3(x,y):
  return x+y
f4=lambda x,y,z: z(x,y)

例一等价:

f x-int: 1+x
f2/1:x+x
f3/2: x+y
# f4/3: z/x y
f4/3: z x,y
@lg6s
Copy link
Member Author

lg6s commented Nov 1, 2018

从属关系:用箭头和集合符号A<-B和A E B 等价

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant