【阿摩網站-置頂欄顏色票選問卷】只要填寫就能獲得500Y,結束時間 2024/04/25 11:59:59。 前往查看

教甄◆電腦科專業題庫下載題庫

上一題
副程式名當作副程式的參數,關於被傳入的副程式執行時的參考環境(Referenceenvironment),以下那一方法最適合Dynamicscoping的程式語言?
(A)Shallowbinding
(B)Deepbinding
(C)Adhocbinding
(D)以上皆非


答案:A
難度: 適中
1F
安身立命 國二下 (2016/03/29)
Dynamic scoping從 Call Stack 找 Scope
Static Scoping從 Definition 找 Scope
http://pjack1981.blogspot.tw/2013/06/static-vs-dynamic-scoping.html
Shallow淺的
ShallowBinding gives good performance when looking up variables, but makes the implementation of DynamicClosures difficult. MacLisp, for example, only solved the "downward funarg" problem, and not the "upward funarg" problem.

2F
Elizabeth 大二上 (2019/04/29)

淺繫結(Shallow Binding)

為副程式變數取值的實作方式,指副程式中若無定義變數,

則會參考執行副程式的敘述當時環境的變數值來取值。


深繫結(Deep Binding)

為副程式變數取值的實作方式,指副程式中若無定義變數,

則會參考副程式定義時結構的上層來取變數值。


特設繫結(Ad-hoc Binding)

為副程式變數取值的實作方式,指副程式中若無定義變數,

則會參考呼叫副程式時的環境來取變數值。


副程式名當作副程式的參數,關於被傳入的副程式執行時的參考環境(Reference..-阿摩線上測驗