You can decompose the so-called "current environment" as follows:
(define (get-current-binding-list)
(let* ((e (current-module)) ;; assume checking current-module
(h (struct-ref e 0)) ;; index 0 is current vars hashtable
)
(hash-map->list cons h) ;; return a vars binding list
))
(get-current-binding-list), .
, , (-, ). , :
var:
(define abc 5)
(let ((vl (get-current-binding-list)))
(assoc-ref vl 'abc)
)
== > #<variable 9bb5108 value: 5>
" " "abc". -ref.
, - , var-name var-value.
, , , , .
, .