-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathTRANSOR.TEDIT
129 lines (112 loc) · 6.25 KB
/
TRANSOR.TEDIT
1
Sender: SenderNameTooLong%SUMEX-AIM.STANFORD:EDU:XeroxDate: 5 Jan 88 18:39:54 PST (Tuesday)Subject: Interlisp to Commonlisp conversion packageFrom: darrelj%sm.unisys:COMTo: info-1100%sumex-aim.stanfordcc: darrelj%sm.unisys:COMReturn-Path: <@SUMEX-AIM.Stanford.EDU:sdcrdcf!sm.unisys.com!darrelj@PRC.Unisys.COM>Redistributed: Info-1100-Redistribute^.XReceived: from SUMEX-AIM.Stanford.EDU by Xerox.COM ; 05 JAN 88 18:38:18 PSTReceived: from burdvax.PRC.Unisys.COM (PRC-GW.PRC.UNISYS.COM) by SUMEX-AIM.Stanford.EDU with TCP; Tue, 5 Jan 88 17:44:10 PSTReceived: by burdvax.PRC.Unisys.COM (burdvax) [5.54/1.0] id AA15346; Tue, 5 Jan 88 20:44:28 ESTReceived: by rdcf.sm.unisys.com (sdcrdcf) (5.51/Domain/jpb/2.7) id AA28679; Tue, 5 Jan 88 16:35:37 PSTMessage-Id: <8801060035.AA28679@rdcf.sm.unisys.com>Received: from XAVIER by sdcrdcf with PUP; Tue, 5 Jan 88 16:35 PSTOriginal-Date: 5 Jan 88 16:34 PST (Tuesday)Interlisp-D into Xerox Commonlisp, we developed a collection of toolsto automate the conversion as much as possible.These have been placed in {parcvax.xerox.com}/lisp/exchange.While we at Unisys have reasonable confidence in these tools, they arebeing made available with no promises of accuracy, completeness orsupport (though we would appreciate feedback).The tools run in Xerox Lyric Common Lisp. The following files are parts of it:TRANSOR -- A slightly modified version of Transor, to fix a fewLyric-related problems and provide the ability to emit aDEFINE-FILE-INFO expression and to use the value of TRANSOUTREADTABLEas the output readtable. We used TRANSOR because we were familiarwith it, and it handles a lot of details needed to safely and surelytraverse the code to be translated. The biggest impediment to addingto the transforms is that they are specified as teletype editorcommands, and only old-time Interlispers have much experience with those. TSET -- The same version dating back to 1979. This is the part oftransor used for interactively developing and testing translation rules.TRANSOR.LCOM -- contains the compilation of BOTH the above files.TO-COMMONLISP.XFORMS -- translation rules for 428 functions, 98remarks and 4 auxiliary functions. It covers are large portion ofInterlisp, including most Clisp constructs, and specifically handlesany function with the same name in both Interlisp and Commonlisp, sothat holes in a translation should result in calls to undefinedfunctions. In many cases, nice transformations are used for easycases, and ugly ones only for hard cases. This file setsTRANSOUTREADTABLE to be a copy of the XCL readtable which is caseSENSITIVE, MYLOAD below reads it case INsensitive, so the resultingfile will ultimately lose most case distinctions on reloading intoXerox Lisp (or other common lisps). This was a much debated pointinternally, but this seemed the best of three bad possibilities (e.g.print one ofCased AS ORIGinal which becomes CASED AS ORIGINAL on load,|Cased| AS |ORIGinal|, orCASED AS ORIGINALINTERLISP-COMMONLISP.TEDIT -- A document describing thetransformations and formacro.LOADTRAN -- contains a few functions which prevent many breaks onloading the translated file. The function MYLOAD is intended to loada translated file.LOADTRAN.DFASL -- compiled versionFORMACRO and FORMACRO.DFASL -- Still another portable iteration macrofor commonlisp. Its main claims are almost 100% compatibility withthe semantics of the Interlisp-Clisp FOR (especially when used the theXFORMS which fix a few incompatibilities); and user extensibility(unfortunately not compatible with IL:I.S.OPR). Embedded keywords(e.g. IN, COLLECT) may be in any package.COMMON-MAKE and COMMON-MAKE.LCOM -- still another version of code togenerate a more "common" source file. It handles more filepkg commandtypes than most. Also, when used with COMMENTHACKS will successfullyprint ALL comments in semicolon format. CallIL:COMMON-MAKEFILE(file). It checks the MAKEFILE-ENVIRONMENT propertyto select a package and base.COMMENTHACKS and COMMENTHACKS.LCOM -- patches to the prettyprinter andto the DEFUN editor. The prettyprinter patches will print Interlisp(* --) comments as semicolon comments when *PRINT-SEMICOLON-COMMENTS*is 'IL:ALL.This file also redefines the ED method for DEFUNs so that the initialsand date of editing get updated for DEFUNs just as Interlisp hasalways done for FNS.Because of the way things developed, these tools are not as fullyintegrated as they could have been. If we were doing it over, theTRANSOR step could have more carefully coordinated the new COMS sothat COMMON-MAKE would be able to do the right thing. As it stands,the COMS generally have to be edited to change FNS to FUNCTIONS, etc,but you tend to need a few iterations of editing things before thecompiler is completely happy anyway.The steps needed to do translations are roughly as follows:(LOAD 'TRANSOR.LCOM)(LOAD 'TO-COMMONLISP.XFORMS)(SETQ FIXSPELLDEFAULT 'N) ;; Otherwise DWIM gets too clever(SETQ XlatedRecords NIL) ;; This is currently set to recordsspecific to the system we translated.TRANSOR files containing record declarations. The records MUST betranslated before any code containing create/fetch/replace since thetranslation depends on the type of records. Also, the recorddeclarations should be LOADED. In a large translation effort, save afile containing all needed declarations and the value of XlatedRecordscomputed by translating them.(TRANSOR 'file1) ... ;; results in file1.TRAN and file1.LSTRAN, seeTRANSOR documentation.To load translated files into a fresh xerox lisp system:>From an XCL exec:(IL:SETPROPLIST '*COMMENT* (IL:GETPROPLIST 'IL:*)) (IL:PUTASSOC '*COMMENT* 'IL:* IL:PRETTYEQUIVLST)(LOAD 'LOADTRAN)(SETQ IL:*DEFUALT-MAKEFILE-ENVIRONMENT* '(:READTABLE "XCL" :PACKAGE ???))(SETQ IL:CMLRDTBL (IL:FIND-READTABLE "XCL"))(LOAD 'FORMACRO.DFASL) if used interlisp for's ;; may need to import USER:FOR depending on packages you've set up.(MYLOAD 'translated-records)(MYLOAD 'file1.tran) ...A little work with ED and FILES? and you should be able to save acommonlisp version of your files (well, OK, a lot of work).Suggestions and questions to one of:darrelj@RDCF.SM.UNISYS.COM or darrel@CAM.UNISYS.COM,or fritzson@bigburd.prc.UNISYS.COM ----- End Forwarded Messages -----