Last active
January 26, 2017 05:37
-
-
Save jessealama/7f49f435d4cfdcc14b5e9ea6d47d9617 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define (env) | |
;; Association list of the current environvment variables and their values. | |
;; | |
;; NB: Both the car and the cdr of the returned cons cells are byte strings, | |
;; not simply strings. If you're looking for strings, you'll need to do | |
;; a bit of work. | |
(define (names env) | |
(environment-variables-names env)) | |
(define e (current-environment-variables)) | |
(map (lambda (name) | |
(cons name (environment-variables-ref e name))) | |
(names e))) | |
(env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment