Path: utzoo!attcan!uunet!wuarchive!sdd.hp.com!ucsd!ucbvax!bloom-beacon!m2.csc.ti.COM!camp From: camp@m2.csc.ti.COM (Clyde Camp) Newsgroups: comp.lang.scheme Subject: How to MAKE_FSL from inside Scheme (and other things) Message-ID: <9010242122.AA15471@m2.csc.ti.com> Date: 24 Oct 90 21:22:38 GMT Sender: daemon@athena.mit.edu (Mr Background) Reply-To: camp@ti-csl.csc.ti.com Organization: The Internet Lines: 203 >Does anyone have some code that will show me how to call MAKE_FSL from >inside scheme. A utility to do this is part of the PCS utility package I've been distributing now for several years. For those of you interested in PCS, a set of these utilities and detailed documentation is available (free) from: Clyde R. Camp Texas Instruments, Inc. P.O.Box 655474, MS 238 Dallas, TX 75266 *==========================*** N O T E ***==============================* Send two blank, FORMATTED 370K 5-1/4 disks or one 720K 3-1/2 minidisk and a SELF-ADDRESSED, STAMPED envelope. My distribution system is a TIPC so if you don't PRE-FORMAT them, you may not be able to read what I send you. And I don't pay postage (except for non-US mailings.) *=======================================================================* Although written originally for the TIPC, everything except the graphics works on IBMs and IBM clones. The directories are: UTILITY - Various text windowing, file printing and keyboard handlers which simplify writing application programs (includes a file pretty-printer and a new top-level read-eval-print loop which uses an emacs-like line-editor with the capability to scroll through and edit previous entries) SWI - A convenient mechanism for invoking 8086 ASSY routines via SWI-INT. HELP - A user-extendable on-line help facility which includes all of the PCS functions and syntax as well as other information on PCS specific quirks. GRAF - A graphics package for creating graphics "windows" somewhat analogous to text windows (also for IBMs) PLOT - A general purpose function plotter (only for TIPCs) GAME1 - Self explanatory - non-graphics for IBM or TIPC GAME2 - for TIPC graphics ERR_STAT - more utilities for controlling the status window, testing for directories and disabling the gc-message MENUSHEL - three general purpose menu driven command shells handy for application development. ===================================================================== The code to do what the poster wants looks like the following (yeah, I know it could be cleaned up, but it works and its free so don't knock it) (define ***default-file*** "") ; file to be processed (define ***default-editor*** "edit.com") ; dos editor of your choice (define ***default-memory-size*** 8190) ; memory to save for dos-call (define ***default-fsl*** "make_fsl") ; make_fsl executable (define ld) ; load (define ed) ; edit (define el) ; edit-load (define ec) ; edit-compile (define cf) ; compile-fasl (define ef) ; edit-compile-fasl (define fsl) ; fasl (define cmp) ; compile ;; ;; All procs take optional filename which then becomes the default for ;; future invocations (reduce them keystrokes!!) ;; (let ((beep (lambda () (display (integer->char 7)))) (extract (lambda (filename) (letrec ((max-index (-1+ (string-length filename))) (loop (lambda (index) (cond ((>? index max-index) #!false) ((char=? (string-ref filename index) #\.) index) (else (loop (1+ index)))))) (split (loop 0))) (if (null? split) (list filename) (cons (substring filename 0 split) (substring filename (1+ split) (1+ max-index)))))))) (set! ed (lambda file (let ((file-name (if (null? file) ***default-file*** (car file)))) (if (string? file-name) (begin (set! ***default-file*** file-name) (dos-call "" (string-append ***default-editor*** " " file-name) ***default-memory-size***)) (error "ED file-name not a string: " file-name))))) (set! ld (lambda file (let ((load-file (if (null? file) ***default-file*** (car file)))) (if (and (string? load-file) (file-exists? load-file)) (begin (set! ***default-file*** load-file) (load load-file) ) (if (string? load-file) (error "LD file-name does not exist: " load-file) (error "LD file-name not a string: " load-file) ))))) (set! cmp (lambda file (let ((file-name (if (null? file) ***default-file*** (car file)))) (if (and (string? file-name) (file-exists? file-name)) (let* ((name (car (extract file-name))) (objdest (string-append name ".so")) ) (set! ***default-file*** file-name) (mapcar display (list "Compiling file " file-name " ==> " objdest)) (compile-file file-name objdest) (display " COMPLETE") (newline)) (if (string? file-name) (error "CMP file-name does not exist: " file-name) (error "CMP file-name not a string: " file-name) ))))) (set! fsl (lambda file (let ((file-name (if (null? file) ***default-file*** (car file))) ) (if (and (string? file-name) (file-exists? file-name)) (let* ((name (car (extract file-name))) (fsldest (string-append name ".fsl"))) (mapcar display (list "FSLing file " file-name " ==> " fsldest)) (dos-call "" (string-append ***default-fsl*** " " file-name " " fsldest " /copyright") ***default-memory-size***) (display " COMPLETE") (newline)) (if (string? file-name) (error "FSL file-name does not exist: " file-name) (error "FSL file-name not a string: " file-name) ))))) (set! el (lambda file (let ((file-name (if (null? file) ***default-file*** (car file)))) (if (string? file-name) (begin (set! ***default-file*** file-name) (ed file-name) (ld file-name) (beep)) (error "EL file-name not a string: " file-name) )))) (set! ec (lambda file (let ((file-name (if (null? file) ***default-file*** (car file))) ) (if (string? file-name) (begin (set! ***default-file*** file-name) (ed file-name) (cmp file-name) (beep) ) (error "EL file-name not a string: " file-name) )))) (set! cf (lambda file (let ((file-name (if (null? file) ***default-file*** (car file))) ) (if (and (string? file-name) (file-exists? file-name)) (let* ((name (car (extract file-name))) (fslsrc (string-append name ".so")) ) (set! ***default-file*** file-name) (cmp file-name) (fsl fslsrc) (beep) ) (if (string? file-name) (error "CF file does not exist: " file-name) (error "CF file-name not a string: " file-name)))))) (set! ef (lambda file (let ((file-name (if (null? file) ***default-file*** (car file))) ) (if (string? file-name) (begin (set! ***default-file*** file-name) (ed file-name) (cf file-name) (beep)) (error "EF file-name not a string: " file-name)))))) -- ============================================================================== Clyde Camp | Texas Instruments, Incorporated |