Skip to content

Commit

Permalink
Merge pull request #10 from wahjava/master
Browse files Browse the repository at this point in the history
Add implementation for ABCL
  • Loading branch information
gwkkwg committed Feb 23, 2016
2 parents 8ba1653 + 0706122 commit adb47e4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions dev/abcl.lisp
@@ -0,0 +1,31 @@
(in-package #:trivial-shell)

(defun %shell-command (command input)
#+unix
(with-input (input-stream (or input :none))
(let (proc out-string err-string in-string out-stream err-stream in-stream)
(setf proc (system:run-program *bourne-compatible-shell* (list "-c" command) :wait nil))
(when input-stream
(setf in-stream (system:process-input proc))
(setf in-string (file-to-string-as-lines input-stream))
;; on all UNIXen the line-ending character is of 1 byte length
(write-string in-string in-stream :end (- (length in-string) 1))
(close in-stream))
(setf out-stream (system:process-output proc))
(setf err-stream (system:process-error proc))
(setf out-string (file-to-string-as-lines out-stream))
(setf err-string (file-to-string-as-lines err-stream))
(close out-stream)
(close err-stream)
(values out-string err-string (system:process-exit-code proc))))
#+(not unix)
(error 'unsupported-function-error :function 'shell-command))

(defun %os-process-id ()
(error 'unsupported-function-error :function 'os-process-id))

(defun %get-env-var (name)
(extensions:getenv name))

(defun %exit (code)
(extensions:exit :status code))
4 changes: 3 additions & 1 deletion trivial-shell.asd
Expand Up @@ -48,6 +48,8 @@ of gamma radiation and repeated does of the sonic screwdriver.
:depends-on ("dev")
:components
(
#+abcl
(:file "abcl")
#+allegro
(:file "allegro")
#+clisp
Expand All @@ -67,7 +69,7 @@ of gamma radiation and repeated does of the sonic screwdriver.
#+scl
(file "scl")

#-(or allegro clisp cmu digitool ecl
#-(or abcl allegro clisp cmu digitool ecl
lispworks openmcl sbcl scl)
(:file "unsupported")
#+digitool
Expand Down

0 comments on commit adb47e4

Please sign in to comment.