[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do you use SCT (:type :text) files?



    Date: Wed, 27 Jul 88 14:21:24 EDT
    From: barr@pineapple.bbn.com (Hunter Barr)

    I included a (:type :text) module in some of my systems.  This is
    helpful because I want the Compile System command to check for it on
    disk, and I want it to go out when I distribute the system.  But the
    SCT insists on warning me that the file is not loaded.  Can I supress
    this warning?  If I understand the documentation right, the SCT should
    know that (:type :text) files are never loaded, and that it should
    just verify that they exist on disk.
				______
				HUNTER

I had a similar problem when I was creating an art-module type.

There is a mysterious, undocumented, function called:

sys:1SET-FILE-STREAM-LOADED-ID

0Its arguments are a STREAM (!) and a package and it somehow records
that the file open in stream has been loaded in the package.

Why take a stream and not a pathname?

The existence and lack of description of sys:1SET-FILE-STREAM-LOADED-ID
0is indicative of much of what is wrong with Symbolics documentation.
(To be honest, it is what is wrong with much of documentation in
general.)  There is rarely (ever?) any system level description, on the
order of "This system models that behavior by creating those objects and
manipulating them in the following way ... this system coexists with
this other system.  You have to call these functions in this manner at
this time to achieve the following...."

Instead we are always treated to: "This function exists and we have
documented how it is called as some kind of indication that it is
important to us.  Please don't use it except in the manner we had in
mind in some of our more restricted pieces of code or otherwise it may
go off in your face like some sort of dime store exploding cigar,
although that's only if you can get the damn thing lit and since you
have never worked for Symbolics there is little chance you will know the
other important functions you should have called first."

The changes (in 2italics0) below (to the generic no-load-compile module
found within "sys:sct;module-types") seem to have fixed the problem.

Have fun,

Jerry Bakin

P.S.  By the way, using text modules in the way you suggest is an idea
      that I needed.  Thanks!

;;; -*- Mode: LISP; Syntax: Zetalisp; Package: SCT; Base: 10; Lowercase: T -*-
;; You may wonder why we have a :LOAD method for "no load" modules at all.
;; The reason is that, even though these modules are not loaded or compiled,
;; they are still distributed (or reap-protected, or whatever).  Since we
;; make the driving and documentation functions NIL, the plan will not do
;; anything unless these slots are explicitly filled in later; distribution
;; and its friends does this.
(defmethod (:load no-load-or-compile-module) (system-op &key never-load &allow-other-keys)
  (ignore system-op)
  (unless never-load
    (multiple-value-bind (input-files nil)
	;; Since these files are never compiled, we use the input file
	;; as the output file as well!
	(collect-inputs-and-outputs inputs :input)
      (make-plan self *system*
		 :inputs input-files
		 :default-input-type (source-file-type-default self)
		 :driving-function
		 ; NIL
2		 #'(lambda (source ignore module &rest ignore)
		     (with-open-file (input-file source :direction :input)
		       (sys:1SET-FILE-STREAM-LOADED-ID2 input-file cl:*package*)
		       (ignore module)))
0		 :documentation
		 ; NIL
2		 #'(lambda (source ignore module &rest ignore)
		     (ignore module)
		     (format standard-output 0"~&Scan~[~;ning~;~] ~A."
2			     *system-pass* source))
0		 ))))