Path: utzoo!utgpu!watmath!clyde!ima!compilers-sender From: liberte@m.cs.uiuc.edu (Daniel LaLiberte) Newsgroups: comp.compilers Subject: Re: pattern languages Message-ID: <2881@ima.ima.isc.com> Date: 10 Nov 88 04:15:18 GMT Sender: compilers-sender@ima.ima.isc.com Reply-To: liberte@m.cs.uiuc.edu (Daniel LaLiberte) Lines: 32 Approved: compilers@ima.UUCP I copied an article out of the SIGPLAN Notices, August 1969 which may have been a conference procedings. The article "Transformations: The Extension Facility of Proteus" by James Bell at DEC describes a language in which you specify the form of an expression and what it is transformed into using named arguments. Then the names are used in expressions which describe what to do at compile time and what to do at run time. Here is an example of defining complex addition. First, the pattern of a complex literal (or type?) is given. pattern complex ! complex <- " + I" ! Now complex addition is defined in terms of the complex pattern. trans 30 " + " <- "" ! Z.REAL <- X.REAL + Y.REAL, Z.IMAG <- x.IMAG + Y.IMAG: The "30" is a priority. So if the compiler sees "X + Y" where X and Y are complex, "Z" is substituted where the REAL and IMAG parts of Z are as specified. Dan LaLiberte uiucdcs!liberte liberte@cs.uiuc.edu liberte%a.cs.uiuc.edu@uiucvmd.bitnet -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request