timothy235 icon

sicp-4-1-4-running-the-evaluator-as-a-program

timothy235 | PRO | 12/19/24 01:08:29 AM UTC (Edited) | 0 ⭐ | 7284 👁️ | Never ⏰ | []
Racket |

630 B

|

None

|

0 👍

/

0 👎

#lang racket
 
;;;;;;;;;;
;; 4.14 ;;
;;;;;;;;;;
 
;; Installing map as a primitive procedure does not work because map expects its
;; first argument to be a Racket procedure, and not one of our M-language procedures,
;; which is a procedure wrapped in a tagged list.
 
;; For example, after putting map and + in the primitive procedures list:
 
;; (driver-loop)
;; ;;; M-Eval input:
;; (+ 1 2)
;; ;;; M-Eval value:
;; 3
;; ;;; M-Eval input:
;; (map + (list 1 2) (list 3 4))
;; . . map: contract violation
  ;; expected: procedure?
  ;; given: '(primitive #<procedure:+>)
  ;; argument position: 1st
  ;; other arguments...:

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎