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

另一种适合拼音输入法的编程语言转译方案 #94

Closed
4b5ent1 opened this issue Oct 16, 2018 · 3 comments
Closed

另一种适合拼音输入法的编程语言转译方案 #94

4b5ent1 opened this issue Oct 16, 2018 · 3 comments
Labels
APL +组合逻辑/tacit族 设计 design
Milestone

Comments

@4b5ent1
Copy link
Member

4b5ent1 commented Oct 16, 2018

前文:#93

#94#93 的差异在于,这里是重新设计语法结构,使之更适应中文的用语逻辑。

@4b5ent1
Copy link
Member Author

4b5ent1 commented Oct 16, 2018

例1:i93的写法:

类 G【
greeting/字;
=“msg:字”【 此·greeting=msg;】
greet“”【= {hello,}+此·greeting 】
】

令 g = + G“{world}”
令 按钮 = 文档·createElment“{button}”
按钮·内容= {say hello}
按钮·单击 = 。【提示“g·greet。 ”】

文档·体·appendchild“按钮”

i94的写法/中文+半角:

G类: 问/str
=[msg/字]>此`问←msg
问侯=>{hello,}+此`问.

g←+G[world]
按钮←文档`createElement/button
按钮`内容←{say hello}
按钮`单击→提示/g`问候

文档`体`appendchild/按钮

@4b5ent1
Copy link
Member Author

4b5ent1 commented Oct 16, 2018

例2: i93

类 动物(
 =[^名字/字]()
 移动[距离/数=0](它=此`名字,多少=距离,
  控`记录[\{它}移动了{多少}米\))

类 蛇 从 动物(
 =[名/字](传[名])
 爬[米=5](控`印[\ssss\]
  从`移动[米]))

类 马 从 动物(
 =[名/字](传[名])
 行[路程=45](控`印[\马叫声\]
  从`移动[路程]))

令 s=+ 蛇[\python\]
令 t/动物=+ 马[\tom\]
s`爬。
t`行[34]

i94:

动物类:=[^名/字]()
移动[距离/数=0]: 它=此`名, 多少=距离,
    控`印/  \{它}移动了{多少}米\.
输出显示=控·印
蛇 类 动物:
    = 名/字 > 类[名]
    爬[米=5]> 输出显示: \sss\
        类`移动/米.

马类动物:=[名/字]>类/名
  行 路程=45 > 输出显示\马叫\
  类`移动/路程.

s<=蛇\python\, t/动物<+马\tom\
s`爬, t`行/34

@4b5ent1 4b5ent1 added 设计 design APL +组合逻辑/tacit族 labels Oct 16, 2018
@4b5ent1 4b5ent1 added this to the 2018戊戌 milestone Oct 20, 2018
@4b5ent1
Copy link
Member Author

4b5ent1 commented Nov 30, 2018

这种方案最后综合成了CPN。CPN的实现将在 ./C8 进行。 ref #111

@4b5ent1 4b5ent1 closed this as completed Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APL +组合逻辑/tacit族 设计 design
Projects
None yet
Development

No branches or pull requests

1 participant