5.3 Demo 3: multiple functions scope🔗ℹ

Multiple functions involved in the debugging activity.

src3.rkt:
#lang racket
 
(define counter 0)
 
(define (inc-counter) (set! counter (add1 counter)))
 
(define (inc x)
  (inc-counter)
  (+ x 1))
 
(define (g x)
  (inc x))
 
(g 4)

src3-medic.rkt:
#lang medic
(layer layer1
       (in #:module "src3.rkt"
           ; scope of multiple functions
           [(g inc) [on-entry @log{function @function-name : x = @x}]]
           ; each-function primitive
           [each-function [on-entry @log{function @function-name entered}]]))