A_lab

CS61A_lab14_macro

(define-macro (switch expr cases) (cons 'cond (map (lambda (case) (cons (eq? (eval expr) (car case)) (cdr case))) cases)) ) 这段代码是一个用于 Scheme 语言的宏定义,可以 ......
A_lab macro lab CS 61

CS61A_lab12_macro

(define-macro (def func args body) `(define ,(cons func args) ,body)) 分析: 定义一个万能的函数定义,那就要模拟函数定义的样子。ok,函数定义是什么样子的呢? eg: (define (filter-lst fn lst) (if ......
A_lab macro lab CS 61

CS_61A_lab10

Write sub-all, which takes a list s, a list of old words, and a list of new words; the last two lists must be the same length. It returns a list with ......
A_lab lab CS 61 10

CS_106A_lab_09

重点:: 观察到:在带入函数之后,没有任何返回值,是直接对参数本身进行作用。遇到这种情况就必须在基线条件下多加一个 【return】语句 why? 其实就是人为两种情况,第一种就是t是节点,此时只需要将节点平方就可以了。第二种情况就是有分支,首先呢就将root平方,再将分支进行处理。 1 def l ......
A_lab 106 lab CS 09

CS61A_lab08

题目: Write the generator function make_generators_generator, which takes a zero-argument generator function g and returns a generator that yields gener ......
A_lab lab CS 61 08

CS61A_lab_07

Problem 2 题目描述: 代码: 1 def inc_subseqs(s): 2 """Assuming that S is a list, return a nested list of all subsequences 3 of S (a list of lists) for which ......
A_lab lab CS 61 07
共6篇  :1/1页 首页上一页1下一页尾页