Code: Select all
(context 'extend-env)
(extend-env:filter 1 2 3) --> (extend-env:filter 1 2 3)
How to design this function?
Code: Select all
(context 'extend-env)
(extend-env:filter 1 2 3) --> (extend-env:filter 1 2 3)
Code: Select all
(define (extend-env:filter) (cons 'extend-env:filter (args))
Code: Select all
(define-macro (extend-env:filter) (cons 'extend-env:filter (args))
Code: Select all
(new Class 'extend-env)
(define (create-funcs f)
(set (eval f) (append (lambda ()) (list (list 'cons f '(args))))))
(setq built-in (difference
(filter eval (symbols))
'(define context MAIN Class Tree create-funcs)))
(map create-funcs (map quote (map (fn (x) (sym x 'extend-env)) built-in)))
(save "extend-env.lsp" 'extend-env)