🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ti.explorer
Article #120

a patch to defsystem allowing external module references

#120
From: Clint Hyde 343-7709 Strong Typin...
Date: Mon, 23 Oct 1989 15:54
65 lines
3760 bytes
OK, these go in package SYS. what they accomplish is allowing one
DEFSYSTEM to refer to modules in another DEFSYSTEM, which does not have
to be a component system (although I'd recommend that it is). This way,
if the other system has macros you're using, you can be sure you get
recompiled properly. (this could help you avoid those "... was compiled
with a different version of macro PUSH/SETF/...")

;;; -*- Mode:Common-Lisp;Package:SYSTEM;Base:10;Fonts:(*code-font*
*comment-font* *string-font* *other-string-font* *fn-name-font*);Patch-file:T -*-

;;;a CHANGE to these next two functions allows
;;;referencing modules external or component systems
;;;inside the current one.  can't say I think this is
;;;wise, but if you were dependent on some macros...

;;; Changed to call validate-external-module routine.  patch SYSTEM-3-30. -dkm 6/87

(DEFUN PARSE-MODULE-COMPONENTS (COMPONENTS SYSTEM)
  (COND ((PATHNAME-P COMPONENTS)	   ;a string or pathname object
	 (CONS (PARSE-MODULE-PATHNAME-LIST (CONS COMPONENTS NIL) SYSTEM) NIL))
	((SYMBOLP COMPONENTS)		   ;Single module within this system	
	 (LIST (FIND-MODULE-NAMED COMPONENTS SYSTEM)))	   ;return ((module-object))
	((not (listp COMPONENTS))
	 (FERROR nil "~S is not a recognized module component specification" COMPONENTS))
	((AND (SYMBOLP (CAR COMPONENTS))   ;list containing system followed by modules
	      ;if first symbol is a module, not external -dkm 6/87
	      (NOT (FIND-MODULE-NAMED (CAR COMPONENTS) SYSTEM T)))
	 (VALIDATE-EXTERNAL-MODULE COMPONENTS)	   ;parse external module spec is OK  -dkm 6/87

	 ;;this only occurs if the first element is a
	 ;;symbol specifying a component-system or other
	 ;;system. patch to return files, not a list.  TRP 10/89.
	 (MAPCAR #'(lambda (name)
		     (FIND-MODULE-NAMED name (CAR COMPONENTS)))	;(CAR COMPONENTS) names a system
		 (CDR COMPONENTS)))
	(T
	 (PARSE-MODULE-COMPONENT-LIST COMPONENTS SYSTEM))))

;;; Changed to call new validate-external-module routine, and to support a list
;;; modules, as documented in LISP manual. patch SYSTEM-3-30. -dkm 6/87

(DEFUN PARSE-MODULE-COMPONENT-LIST (COMPONENTS SYSTEM)
  (LOOP FOR COMPONENT IN COMPONENTS
	COLLECT (COND ((PATHNAME-P COMPONENT)
		       (PARSE-MODULE-PATHNAME-LIST (CONS COMPONENT NIL) SYSTEM))
		      ((SYMBOLP COMPONENT)
		       (FIND-MODULE-NAMED COMPONENT SYSTEM))
		      ((not (listp COMPONENT))
		       (FERROR nil "~S is not a recognized module component specification" COMPONENT))
		      ((SYMBOLP (CAR COMPONENT))           
		       (COND ((FIND-MODULE-NAMED (CAR COMPONENT) SYSTEM T)  ;support list of modules  -dkm 6/87
			      ;;LOOP removed--ugly. TRP 10/89
			      (DOLIST (module component)
				(PUSH (find-module-named module system) modules)))
			     (T (VALIDATE-EXTERNAL-MODULE COMPONENT)   ;must be an external spec  -dkm 6/87
				;;changed to allow referencing component or external systems --TRP 10/89.
				(DOLIST (module (CDR component))
				  (PUSH (find-module-named module (CAR COMPONENT)) modules)))))
		      ((PATHNAME-P (CAR COMPONENT))
		       (PARSE-MODULE-PATHNAME-LIST COMPONENT SYSTEM))
		      (T (FERROR nil "~S is not a recognized module
component specification" COMPONENT)))))

;;;END
Technical Details
Message-ID: <8910231603.AA26327@ti.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ngstl1.csc.ti.com!hyde

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ngstl1.csc.ti.com!hyde
From: hyde@ngstl1.csc.ti.com (Clint Hyde 343-7709 Strong Typing is for people with Weak Memories!)
Newsgroups: comp.sys.ti.explorer
Subject: a patch to defsystem allowing external module references
Message-ID: <8910231603.AA26327@ti.com>
Date: 23 Oct 89 15:54:24 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: inet
Organization: The Internet
Lines: 65