正在加载图片...
Persistent Local State Using Environments Global frame >func make_withdraw(balance)[parent=Global] make_withdraw func withdraw(amount)[parent=f1] withdraw f1:make_withdraw [parent=Global] balance 50 withdraw The parent frame contains the balance,the local state Return of the withdraw function value f2:withdraw [parent=f1] All calls to the same amount 25 Every call decreases the same balance by function have the Return value 75 (a possibly different)amount same parent f3:withdraw [parent=f1] amount 25 Return value 50Persistent Local State Using Environments The parent frame contains the balance, the local state of the withdraw function Every call decreases the same balance by (a possibly different) amount 8 All calls to the same function have the same parent
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有