Skip to content

Instantly share code, notes, and snippets.

@jessealama
Last active January 26, 2017 05:37
Show Gist options
  • Save jessealama/7f49f435d4cfdcc14b5e9ea6d47d9617 to your computer and use it in GitHub Desktop.
Save jessealama/7f49f435d4cfdcc14b5e9ea6d47d9617 to your computer and use it in GitHub Desktop.
#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