λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

University of California, Berkeley/ElectricalEngineering & ComputerSciences

(48)
Week 7 Week 7 Resources https://docs.google.com/presentation/d/1t6tK4J5dmeRb9z619f2AaGawlkrMVCwhJMP2HF-2tUY/edit#slide=id.g1fd8f00051_0_0 Google ν”„λ ˆμ  ν…Œμ΄μ…˜ - ν”„λ ˆμ  ν…Œμ΄μ…˜μ„ μž‘μ„±ν•˜κ³  μˆ˜μ •ν•  수 있으며 λ¬΄λ£Œμž…λ‹ˆλ‹€. ν•˜λ‚˜μ˜ κ³„μ •μœΌλ‘œ λͺ¨λ“  Google μ„œλΉ„μŠ€λ₯Ό ν”„λ ˆμ  ν…Œμ΄μ…˜μœΌλ‘œ μ΄λ™ν•˜λ €λ©΄ λ‘œκ·ΈμΈν•˜μ„Έμš”. accounts.google.com https://docs.google.com/document/d/1_wpYjkzeuRZOIM6GssSDH8X2CoIRjqjtDIYMNaTQGtQ/edit Streams Scheme Streams Objectives: Understand the motivation behind s..
Macros Macros - Macros are a more convenient way to transform or create expressions - The define-macro special form will create a macro procedure - Macros take in and return expressions, which are then evaluated in place of the call to the macro Evaluating Macros Recall evaluation procedure used for regular call expressions: 1. Evaluate the operator sub-expression, which evaluates to a regular procedur..
Interpreters lab Interpreters Def : a program that allows you to interact with the computer in a certain language - This is what project 4 is all about ! - Involves 2 languages 1. language being implemented ( Scheme in Project 4 ) 2. Underlying language implementing 1 ( Python in Project 4 ) REPL Process : Process that interpreters follow Read lexer : break up inputs into smaller 'tokens' parser : 'organize' tok..
Interpreters Review : Tail Recursion - An expressio in a tail context is evaluated a sthe last step the function call - Function calls in a tail context are called tail calls - If all recursive calls are in tail contexts, we say that function is tail recursive Review : Writing Tail Recursive Functions 1. Identify recursive calls that are not in a tail context 2. Create a helper function with arguments to acc..
More Scheme Lis(t) P(rocessing) Scheme List Definition A Scheme list is either: - nil - Composed of a first element (car) and the rest (cdr) of the Scheme list Creating Scheme Lists - (cons 1 __________________________________) - (cons 1 (cons 2 _________________________)) - (cons 1 (cons 2 (cons 3 nil)) Scheme Lists vs. Linked Lists Checking Equivalence : (equal? e1 e2) checks if e1 and e2 evaluate to equi..
Scheme Scheme - Scheme is a dialect of Lisp. - It uses a lot of parentheses. https://scheme.cs61a.org 61A Scheme scheme.cs61a.org Why another language? : The goal of this class is not to teach Python, but rather to teach a variety of programming techniques and core concepts. How does learning another language help us? - To see some key components across many programming languages. - To see what paradig..
Week 6 https://cs61a.org/articles/scheme-builtins.html Scheme Built-In Procedure Reference | CS 61A Summer 2019 Scheme Built-In Procedure Reference Last Updated: Summer 2018 This document serves as a reference for the built-in procedures in the Scheme project and staff Scheme interpreter. The web interpreter includes several additional built-in procedures. In all of cs61a.org https://cs61a.org/articles..
Interfaces Interfaces : Describe how you can interact with an object without necessarily implementing it Magic Methods : These are specially named methods that are callable outside the ordinary dot notation. Example: __init__ str & repr str __str__ specifies what occurs when str is called on it Used when calling print on an object repr __repr__ specifies what occurs when repr is called on it Used when disp..