No. 019 (2025.07.24)
前回
No. 017 (2025.06.12)
参加者
yuchi yamaguchi.icon abap34
antimon2
https://github.com/c42f/JuliaLowering.jl
読み進めていく
resolve_scopes
L266~
global` 宣言などされていない global な scope での代入は iterate されて binding が作られていく
is_macro_expansion なら :local として
あんまりピンとこない...
違う場合は :global として binding を作る
そうでないなら
static parameter との conflict をチェック
もし toplevel の thunk かつハードスコープではないとき
is_defined_and_owned_global <- あるシンボルがそのモジュールで **定義** (そこで作られたの意味で) されているかチェック
isdefined と違って side effects がないらしい.(isdefined にあるのがかなりびっくりだけど)
Bindings と LambdaBindings ← これの違いがあまりわからない
linear_ir の compile_lambda では lambda bindings を iterate して binding を lookup して Slots にしていて
https://github.com/JuliaLang/julia/blob/master/base/docs/bindings.jl