From bba9c34744f20e0d60838e7b28a8966c0f2d64b9 Mon Sep 17 00:00:00 2001 From: sperber Date: Thu, 16 Jan 2003 12:52:16 +0000 Subject: [PATCH] - rename FTP-TYPE -> FTP-SET-TYPE! - use enumerated type for argument of FTP-SET-TYPE! --- scheme/lib/ftp.scm | 19 +++++++++---------- scheme/packages.scm | 4 +++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scheme/lib/ftp.scm b/scheme/lib/ftp.scm index 048605d..2d53ad6 100644 --- a/scheme/lib/ftp.scm +++ b/scheme/lib/ftp.scm @@ -146,18 +146,17 @@ connection)))) (exactly-code "230"))))))) -;; Type must be one of 'binary or 'text or 'ascii, or a string which will be -;; sent verbatim +(define-enumerated-type ftp-type :ftp-type + ftp-type? + ftp-types + ftp-type-name + ftp-type-index + (binary ascii)) -(define (ftp-type connection type) +(define (ftp-set-type! connection type) (let ((ttype (cond - ((string? type) type) - ((eq? type 'binary) "I") - ((or (eq? type 'ascii) - (eq? type 'text)) "A") - (else - (call-error "type must be one of 'binary or 'text or 'ascii" - ftp-type type))))) + ((eq? type (ftp-type binary)) "I") + ((eq? type (ftp-type ascii)) "A")))) (ftp-send-command connection (build-command "TYPE" ttype)))) ;;: connection x string x string -> status diff --git a/scheme/packages.scm b/scheme/packages.scm index beae1d4..54b2780 100644 --- a/scheme/packages.scm +++ b/scheme/packages.scm @@ -90,7 +90,8 @@ (define-interface ftp-interface (export ftp-connect - ftp-type + (ftp-type :syntax) + ftp-set-type! ftp-rename ftp-delete ftp-cd @@ -414,6 +415,7 @@ (open scheme-with-scsh netrc define-record-types + finite-types receiving handle conditions