home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.edu:1648 comp.lang.fortran:3545 comp.lang.misc:3063 comp.arch:9398 sci.math:11392
- Newsgroups: comp.edu,comp.lang.fortran,comp.lang.misc,comp.arch,sci.math
- Path: sparky!uunet!wupost!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb!kirchner
- From: kirchner@uklira.informatik.uni-kl.de (Reinhard Kirchner)
- Subject: Re: User-Defined Operators (was: Scientists as Programmers (was: Small Language Wanted))
- Message-ID: <1992Sep14.090213.18722@uklirb.informatik.uni-kl.de>
- Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
- Nntp-Posting-Host: uklira.informatik.uni-kl.de
- Organization: University of Kaiserslautern, Germany
- References: <1992Sep13.022830.2046@CS.ORST.EDU>
- Distribution: na
- Date: Mon, 14 Sep 1992 09:02:13 GMT
- Lines: 25
-
- >>compiler-generation time.
- >
- > That last statement is _wrong_. It is _easy_ to add user-defined operators to
- > a language. The attributes sufficient to make it easy are:
- >
- > operators must be lexically distinct
- > just like identifiers are not predefined, but are lexically distinct,
- > so too can operators be lexically distinct
- > the operator precedence relationships must be static
- > this is true in languages like C where all the operators are fixed,
- > and therefore all the precedences are fixed
- > the operator precedence must be lexically determined
- > this is easy if you incorporate symbol table information into the
- > lexer so that on finding an operator, it looks up the precedence
- >
- If one wants to see and USE a language with user definable operators:
-
- Take Pascal-XSC. It is available on all unix machines since it compiles to
- standard C. It allows users to define operators monadic and dyadic, and it comes
- with many of them for interval, vector, matrix, complex etc. computations.
-
- R. Kirchner
- Univ. of Kaiserslautern, Germany
- kirchner@informatik.uni-kl.de
-
-