MASTERSCOPE EXTENSIONS 1. More than one type of executable thing. All possible executable thing types are stored on ÿÿMSFNTYPESÿ, whichÿÿ ÿisÿÿ a list ÿof MSANALYZABLE recordsÿÿ: ÿ(filepkgname setname getdef-fn) Vanilla Masterscope starts with it set to ((FNS FNS GETDEF)) and new things get added to it through MSADDANALYZE (see below). The filepkgname must be the File Manager name of the new executable thing. MSADDANALYZE will barf if filepkgname is not on IL:FILEPKGTYPES. The setname must be the name Masterscope uses for a set of the new executable things. The getdef-fn has to take the same arguments as GETDEF and return NIL or a definition suitable for Masterscope munching. MSGETDEF, MSEDITF, MSSEEKTYPE, MSMARKCHANGED, and MSADDANALYZE look at ÿÿMSFNTYPESÿ; they CDR down it and take the first definition they find for any given name. The unstated assumption here is that there will be only one executable thing for each name in the system. This means users may need to edit ÿÿMSFNTYPESÿ and rearrange its entries, and that sometimes they will lose anyway. MSSHOWUSE, UPDATECHANGED1, MSUPDATEFN1, and UPDATEFN are changed to not always specify FNS as the type to look for to MSGETDEF. 2. Extensions to understood relations Mostly done for Loops by smL, using the following functions of his: (MSADDANALYZE plural singular filepkg-type getdef-fn) Defines a new Masterscope analyzable-thing plural - the plural of its name singular - the singular of its name filepkg-type - the file manager type where its definitions live getdef-fn - The name of a function that takes the same arguments as GETDEF; it should ignore the TYPE argument and return a definition suitable for Masterscope analysis or NIL if it can't find one. (ADDTEMPLATEWORD word) Defines a new template word for Masterscope. word - The new word which will be tracked by a relation table (MSADDRELATION relation-names table-names) Defines a new Masterscope relation relation-names - a list of four verbs naming this relation as follows: (1st-singular 3rd-singular ING-form ED-form) E.g. the list for LOOPS SEND is (SEND SENDS SENDING SENT) table-names - a list of names for tables where the relation will be tracked. (MSADDMODIFIER relation modifier table-name describe-string) Defines modifiers for relations relation - a relation previously defined with MSADDRELATION modifier - a modifying word table-name - the name of a table which will track the modified relation describe-string - a string that will be added to DESCRIBELST for this relation ; should also take arg describe-string for munging DESCRIBELST Example: LOOPS tracks messages sent with templates like this one for _, whose form is (_ Object Message args...): (! NIL (@ EXPR (IF (EQ 'SELF (CADR EXPR)) THEN '(EVAL SENDSELF .. EVAL) ELSE '(EVAL SENDNOTSELF .. EVAL)))) It tracks messages sent to objects bound to SELF differently from other sends. Here is how the various SEND relations are added to Masterscope: (ADDTEMPLATEWORD 'SENDSELF) (ADDTEMPLATEWORD 'SENDNOTSELF) (MSADDRELATION '(SEND SENDS SENDING SENT) '(SENDSELF SENDNOTSELF)) (MSADDMODIFIER 'SEND 'SELF 'SENDSELF) (MSADDMODIFIER 'SEND 'NOTSELF 'SENDNOTSELF) (SETSYNONYM phrase description) Allows defining new relations in terms of existing ones phrase - A list describing the phrase you want to create. The CAR of the list must be an existing relation (which could have NO tables of its own). The phrase may contain ampersands (&) which are numbered from left to right and may be referred to in the description by number. description - A description of the new phrase. If atomic, it must be an existing relation which will be used for the phrase. If a list, it must be in the form of a template. Example: LOOPS tracks what messages are handled by what classes with the relation IMPLEMENT. It can figure out who specializes a message by computing who IMPLEMENTs the message AND calls _Super or something equivalent AND has a superclass that IMPLEMENTs the message. This is implemented in Masterscope as follows: (SETSYNONYM '(SPECIALIZES &) '(@ (MethodOverrides? X) IMPLEMENTS 1)) where MethodOverrides? is a predicate that handles the _Super and superclass IMPLEMENT check. (MSADDTYPE type tables howused synonyms) Creates a new Masterscope datatype that the verb USE can work on. type - Singular name of the type tables - List of the tables tracking that type; their union is used. howused - List of other ways to talk about the type; the plural should be specified here for sure. synonyms - Other words altogether; I have no idea (ask smL). 3. Common Lisp extensions Masterscope recognizes VARIABLES forms and analyzes their initializing forms under the name of the variable being set, i.e., after analyzing (DEFVAR FOO (BAR (SETQ BAZ CRUD))) you can query the following: . WHO SETS 'BAZ (FOO) . WHO IS CALLED BY 'FOO (BAR) It also now recognizes FUNCTIONS as potentially executable things. DEFMACROs are just given MACRO templates so things that CALL them will be reanalyzed appropriately. DEFUNs get their lambda-lists parsed so their &key and &aux symbols get noticed, and their bodies get analyzed more or less normally. Keywords are gathered from analyzed DEFUNs so calls with bogus keywords are detected; keywords can also be specified in templates for DEFUNs by making the tail of the template: ... KEYWORDS :FOO :BAR) To allow any keyword, specify &ALLOW-OTHER-KEYS. All CL and XCL functions that take keywords have templates that list their legal ones. The following queries for keywords now work as follows: FOO ACCEPTS :BAR means function FOO can be legally called with keyword :BAR. FOO SPECIFIES :BAR means function FOO calls at least one function that specifies keyword :BAR. FOO KEYCALLS BAR means function FOO calls function BAR with at least one keyword. A query of the form FOO CALLS BAR SPECIFYING :BAZ cannot be done without major changes to the internal structure of Masterscope. It is possible to come close by querying FOO KEYCALLS BAR AND FOO SPECIFIES :BAZ which gets a larger set than necessary. The following queries now also work: FOO FLETS BAR means FOO has an FLET definition for BAR FOO LABELS BAR means FOO has a LABELS definition for BAR FOO MACROLETS BAR means FOO has a MACROLET definition for BAR FOO LOCAL-DEFINES BAR means FOO has an FLET, LABELS, or MACROLET definition for BAR Masterscope does not analyze definitions like this correctly; that is, MACROLET definitions are not expanded in place to see their effects, and FLET and LABELS calls are recorded in the global CALLS relation just like anything else. This oversight might be corrected someday. ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) v Dß3P zº