TAILIEUCHUNG - How to Design Programs Languages phần 5

Nếu một tên được xác định trong các hình thức địa phương là giống như một ràng buộc cấp cao nhất, bên trong "bóng tối" một trong những bên ngoài. Đó là,lambda trong tất cả, từ khóa lambda chỉ có thể được sử dụng với định nghĩa trong các cú pháp functiondefinition thay thế | quicksort listof X X X - boolean - listof X sort listof X X X - boolean - listof X define define id id id . expr define id expr define id lambda id id . expr Besides working in local definition forms are the same as Beginning s define. lambda As in Beginning lambda keyword can only be used with define in the alternative functiondefinition syntax. define-struct define-struct structid fieldid . Besides working in local this form is the same as Beginning s define-struct. local local definition . expr Groups related definitions for use in expr. Each definition is evaluated in order and finally the body expr is evaluated. Only the expressions within the local form including the right-hand-sides of the definition s and the expr may refer to the names defined by the definition s. If a name defined in the local form is the same as a top-level binding the inner one shadows the outer one. That is inside the local form any references to that name refer to the inner one. Since local is an expression and may occur anywhere an expression may occur it introduces the notion of lexical scope. Expressions within the local may escape the scope of the local but these expressions may still refer to the bindings established by the local. 70 letrec let and let letrec id expr-for-let . expr Similar to local but essentially omitting the define for each definition. A expr-for-let can be either an expression for a constant definition or a lambda form for a function definition. let id expr-for-let . expr Like letrec but the defined ids can be used only in the last expr not the expr-for-let s next to the id s. let id expr-for-let . expr Like let but each id can be used in any subsequent expr-for-let in addition to expr. Function Calls id expr expr . A function call in Intermediate is the same as a Beginning function call except that it can also call locally defined functions or functions passed as arguments. That is id can be a function defined in local or an argument name

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.