scsh-0.6/scheme/misc/getenv.scm

16 lines
293 B
Scheme
Raw Permalink Normal View History

1999-09-14 08:45:02 -04:00
; Copyright (c) 1993-1999 by Richard Kelsey and Jonathan Rees. See file COPYING.
; ,open primitives
(define getenv
(let ((buffer (make-string 2000)))
(lambda (var-name)
(let ((len (vm-extension 26 (cons var-name buffer))))
(if len
(substring buffer 0 len)
#f)))))