We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好 练习4.11 的add-binding-to-frame! 我觉得你实现错了 (define (add-binding-to-frame! var val frame) (cons (cons var val) frame))
(define (add-binding-to-frame! var val frame) (cons (cons var val) frame))
这里不应该是简单的返回一个新的frame,而是要修改原来的frame
(define (add-binding-to-frame! var val frame) (let ((old-car (car frame))) (set-car! frame (cons var val)) (set-cdr! frame (cons old-car (cdr frame))))) ;;test (let ((frame (make-frame '(a b c) '(1 2 3)))) (add-binding-to-frame! 'd 4 frame) (display frame))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
您好
练习4.11 的add-binding-to-frame! 我觉得你实现错了
(define (add-binding-to-frame! var val frame) (cons (cons var val) frame))
这里不应该是简单的返回一个新的frame,而是要修改原来的frame
The text was updated successfully, but these errors were encountered: