[obsidian] vault backup: 2024-11-17 00:44:13[
All checks were successful
Build / build (push) Successful in 3m23s
All checks were successful
Build / build (push) Successful in 3m23s
This commit is contained in:
parent
94ce72ba47
commit
47ec0d1070
@ -26,7 +26,8 @@ decl_levelでレベル0になったら...うーん
|
||||
```ocaml
|
||||
let n = 100 in
|
||||
let m = 200 in
|
||||
~( let addc x y = &(~x + ~y) in addc &n &m )
|
||||
let addc x y = &(~x + ~y) in
|
||||
~(addc &n &m )
|
||||
```
|
||||
|
||||
`addc`の型は`&int -> &int`
|
||||
@ -37,8 +38,20 @@ Escapeはあくまで埋め込むだけで評価をするわけじゃないん
|
||||
`&(~x + ~y)`ここだけ取り出すとどうだろう
|
||||
|
||||
```
|
||||
fn addc x y // reg 1,2にはプログラム辺のインデックス
|
||||
mov 1 x
|
||||
mov 2 y
|
||||
add 1 1 2 //最後は必ずこうなるわけで
|
||||
|
||||
fn main
|
||||
movc 1 100
|
||||
movc 2 200
|
||||
|
||||
lift 1 1
|
||||
lift 2 2
|
||||
startescape
|
||||
call "addc" 1 2
|
||||
endescape
|
||||
ret 1
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user