SPAN - question 1
This commit is contained in:
parent
902b798979
commit
e9f2877acb
|
@ -26,7 +26,7 @@
|
||||||
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
(define (ask-server request port-number)
|
(define (SPAN-ask-server request port-number)
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(socket-client (get-host-name) port-number))
|
(socket-client (get-host-name) port-number))
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
(define (tell-client request port-number sock)
|
(define (SPAN-tell-client request port-number sock)
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(socket-accept sock))
|
(socket-accept sock))
|
||||||
|
|
|
@ -26,4 +26,28 @@
|
||||||
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
(define SPAN-shell-droptext-1
|
||||||
|
"The following questions are intended to help you with the
|
||||||
|
configuration. The CPAN module needs a directory of its own to cache
|
||||||
|
important index files and maybe keep a temporary mirror of CPAN files.
|
||||||
|
This may be a site-wide or a personal directory."
|
||||||
|
|
||||||
|
(define (SPAN-question~ droptext question answer defaultchoice)
|
||||||
|
(let ((s ""))
|
||||||
|
(display droptext)
|
||||||
|
(newline)
|
||||||
|
(display question)(display " ")
|
||||||
|
(display "[")(display defaultchoice)(display "] ")
|
||||||
|
(set! s (read))
|
||||||
|
(cond ((and (symbol? s)
|
||||||
|
(string=? (symbol->string s) defaultchoice))
|
||||||
|
(set! answer defaultchoice))
|
||||||
|
((and (number? s)
|
||||||
|
(string=? (symbol->number s) defaultchoice))
|
||||||
|
(set! answer defaultchoice))
|
||||||
|
((string=? (symbol->string s)(string #\return))
|
||||||
|
(set! answer defaultchoice))
|
||||||
|
((string? (symbol->string s))
|
||||||
|
(set! answer (symbol->string s)))
|
||||||
|
(else (SPAN-question~ droptext question answer defaultchoice)))))
|
||||||
|
|
||||||
|
|
|
@ -26,3 +26,9 @@
|
||||||
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
(load "SPAN.scm")
|
||||||
|
;;prototype (define (SPAN-question~ droptext question answer defaultchoice)
|
||||||
|
(SPAN-question~ SPAN-shell-droptext-1
|
||||||
|
"SPAN build and cache directory"
|
||||||
|
""
|
||||||
|
(string-append (getenv "HOME") "/.span"))
|
||||||
|
|
Loading…
Reference in New Issue