Support environment variable procedures.

This commit is contained in:
Sam Tobin-Hochstadt 2016-07-08 12:37:39 -04:00
parent b1818723dc
commit 88f896c121
4 changed files with 12 additions and 0 deletions

View File

@ -266,6 +266,7 @@ These are not part of the numeric tower.
@defidform[FSemaphore]
@defidform[Will-Executor]
@defidform[Pseudo-Random-Generator]
@defidform[Environment-Variables]
)]{
These types represent primitive Racket data.

View File

@ -2964,6 +2964,14 @@
(->opt [(Un (-val #f) (-val 'subprocesses) -Thread)] -Fixnum)]
;; Section 15.7
[environment-variables? (make-pred-ty -Environment-Variables)]
[current-environment-variables (-Param -Environment-Variables)]
[bytes-environment-variable-name? (asym-pred Univ B (-PS (-is-type 0 -Bytes) -tt))]
[make-environment-variables (->* null -Bytes -Environment-Variables)]
[environment-variables-ref (-> -Environment-Variables -Bytes (-opt -Bytes))]
[environment-variables-set! (->opt -Environment-Variables -Bytes (-opt -Bytes) [(-> Univ)] Univ)]
[environment-variables-names (-> -Environment-Variables (-lst -Bytes))]
[string-environment-variable-name? (asym-pred Univ B (-PS (-is-type 0 -) -tt))]
[getenv (-> -String (Un -String (-val #f)))]
[putenv (-> -String -String B)]

View File

@ -160,6 +160,7 @@
[Place-Channel -Place-Channel]
[Place -Place]
[Will-Executor -Will-Executor]
[Environment-Variables -Environment-Variables]
[Listof -Listof]

View File

@ -251,6 +251,8 @@
(define/decl -Place-Channel (Un -Place -Base-Place-Channel))
(define/decl -Will-Executor
(make-Base 'Will-Executor #'will-executor? will-executor?))
(define/decl -Environment-Variables
(make-Base 'Environment-Variables #'environment-variables? environment-variables?))
;; Paths
(define/decl -car (make-CarPE))