home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / edu / 1648 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  1.9 KB

  1. Xref: sparky comp.edu:1648 comp.lang.fortran:3545 comp.lang.misc:3063 comp.arch:9398 sci.math:11392
  2. Newsgroups: comp.edu,comp.lang.fortran,comp.lang.misc,comp.arch,sci.math
  3. 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
  4. From: kirchner@uklira.informatik.uni-kl.de (Reinhard Kirchner)
  5. Subject: Re: User-Defined Operators (was: Scientists as Programmers (was: Small Language Wanted))
  6. Message-ID: <1992Sep14.090213.18722@uklirb.informatik.uni-kl.de>
  7. Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
  8. Nntp-Posting-Host: uklira.informatik.uni-kl.de
  9. Organization: University of Kaiserslautern, Germany
  10. References: <1992Sep13.022830.2046@CS.ORST.EDU>
  11. Distribution: na
  12. Date: Mon, 14 Sep 1992 09:02:13 GMT
  13. Lines: 25
  14.  
  15. >>compiler-generation time.  
  16. > That last statement is _wrong_.  It is _easy_ to add user-defined operators to
  17. > a language.  The attributes sufficient to make it easy are:
  18. >    operators must be lexically distinct
  19. >       just like identifiers are not predefined, but are lexically distinct,
  20. >       so too can operators be lexically distinct
  21. >    the operator precedence relationships must be static
  22. >       this is true in languages like C where all the operators are fixed,
  23. >       and therefore all the precedences are fixed
  24. >    the operator precedence must be lexically determined
  25. >       this is easy if you incorporate symbol table information into the
  26. >       lexer so that on finding an operator, it looks up the precedence
  27. If one wants to see and USE a language with user definable operators:
  28.  
  29. Take Pascal-XSC. It is available on all unix machines since it compiles to
  30. standard C. It allows users to define operators monadic and dyadic, and it comes
  31. with many of them for interval, vector, matrix, complex etc. computations.
  32.  
  33. R. Kirchner
  34. Univ. of Kaiserslautern, Germany
  35. kirchner@informatik.uni-kl.de
  36.  
  37.