SQL DATA100 / CS186先导课名副其实 😏
create 不说了见186第一节课第二节课
overview select 1 2 3 select ... union select ... union select ... union
Macros quote or unquote 在于怎么eval 🤔
, 后面的 (some_expression) 不会被quote
Macros in Scheme define new special form in scheme…
define-macro 定义一个新的宏,接收一个 <expression> 作为参数,返回一个新的<expression> 并且eval之, 先不对参数eval
注意和define的区别,define在意的是传进来的 value
another example, to show info of your expression using macro
1 2 3 (define-macro (check expr) (list 'if expr ''pass (list 'quote (list 'failed: expr)))) For Macro in Scheme 1 2 3 4 5 (define (map fn vals) (if (null? vals) () (cons (fn (car vals)) (map fn (cdr vals))))) 1 2 > (map (lambda (x) (* x x)) '(2 3 4 5)) ; without using macro case (4 9 16 25) 1 2 3 (define-macro (for sym vals expr) (list 'map lambda (sym) (expr) (vals)) ;?
Interpreters Special Forms Quotation Logical Forms Lambda Expressions 1 (lambda (x) (+ x 1)) Frame and Environment Dynamic Scope who calls you can provide the value you need
rather than static scope…
Interpreting Scheme Code 核心在此 Define Expressions