home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / 3170 < prev    next >
Encoding:
Text File  |  1993-01-05  |  3.9 KB  |  95 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!newserver.jvnc.net!gmd.de!juergen.waltherñgmd.de
  3. From: juergen.waltherñgmd.de (Juergen Walther)
  4. Subject: Re: Lisp Parsers
  5. Message-ID: <1993Jan5.130620.13174@gmd.de>
  6. Sender: news@gmd.de (USENET News)
  7. Nntp-Posting-Host: mac-walther
  8. Organization: GMD FIT-KI
  9. References: <11586@uqcspe.cs.uq.oz.au>
  10. Date: Tue, 5 Jan 1993 13:06:20 GMT
  11. Lines: 82
  12.  
  13. In article <11586@uqcspe.cs.uq.oz.au>, berglas@cs.uq.oz.au (Anthony Berglas) writes:
  14. > I am trying to introduce Lisp to the UQ CS Dept, in which everybody
  15. > knows that real men use C++.  I will put on a demo of Garnet etc. shortly
  16. > but most important decisions are made on first impressions, and the
  17. > first impressions are the (())()()s.  God said that f(a, b); is easier
  18. > to read than (f a b), it requires less characters.
  19. > Seriously, (> (+ x 1) (* y 2)) is ugly, and it would be pretty easy
  20. > to add a parser to Lisp that could be used instead of the normal Reader.
  21. > (At least for demonstration purposes).  Such a parser would idealy be
  22. > table driven and dynamically extendible -- new macro, new grammar rule.
  23. > If anyone has heard of such a thing I would be interested to know.
  24. > Thanks,
  25. > --
  26. > Anthony Berglas
  27. > Rm 503, Computer Science, Uni of Qld
  28. > Ph 07 365 2812, Australia.
  29. Following  exerpts from the GLISP and MLISP manuals. I like Lisp syntax, so I did not use it, but it
  30. sound's promising in your context.
  31.  
  32. Generalized Lisp
  33. Users Manual
  34. by
  35. David Canfield Smith
  36.  
  37. Apple Computer
  38. August 1990
  39. Version 1.2
  40.  
  41. Generalized Lisp (or Glisp for short) is a coordinated set of high level syntaxes for Common Lisp.  It is 
  42. generalized in the sense that the Lisp programmer has a variety of dialects available, not just Lisp notation.  
  43. Initially Generalized Lisp consists of three dialects: Mlisp, Plisp and ordinary Lisp, 
  44. together with an extensible framework for adding others.  Mlisp (Meta-Lisp) is an Algol-like syntax 
  45. for people who dont like writing parentheses.  Plisp (Pattern Lisp) is a pattern matching rewrite-rule 
  46. language.  Plisp is a compiler-compiler; its rules are optimized for writing language translators.  
  47. Mlisp and Plisp are documented in separate user manuals.  
  48. It is expected that the set of dialects will increase over time as users add new ones.  
  49. All dialects may be freely intermixed in a file.The translators for all dialects are written in Plisp, 
  50. as is the Glisp translator framework itself.  
  51. Support routines for the translators are written in Mlisp and/or Lisp.  
  52. All dialects are translated to Common Lisp and execute in the standard Common Lisp environment.
  53.  
  54. Mlisp
  55. Users Manual
  56. by
  57. David Canfield Smith
  58.  
  59. Apple Computer
  60. xxx 1990
  61. Version 1.2
  62.  
  63. Introduction
  64. What is Mlisp?
  65. Mlisp (Meta-Lisp) is an alternative syntax for Common Lisp that reduces its reliance on parentheses.  
  66. Mlisp is designed to make Lisp programs easier to read.  Mlisp programs are translated into Lisp and 
  67. then compiled, executed or printed.  Therefore Mlisp has exactly the same capabilities as Common Lisp, 
  68. no more and no fewer.  Nevertheless, experience has shown that many people can write larger and 
  69. more complex programs in Mlisp than in Lisp, since they can better understand the code.
  70. The Mlisp syntax is a derivative of Algol, with begin-end blocks, if-then-else conditionals, etc.  
  71. The fundamental rule in Mlisp is that the mathematical notation
  72. function(arg1, arg2, ..., argn)
  73. is translated into the Lisp notation
  74. (function arg1 arg2 ... argn)
  75. For example,
  76. print("abc", stream)
  77. translates to
  78. (print "abc" stream)
  79. Any Lisp s-expression can be produced in this way, even special forms.  For example,
  80. cond(=(a, b)(c), t(d))
  81. translates to
  82. (cond ((= a b) c) (t d))
  83. Of course the former is hardly an improvement on the latter, so special syntax has been added for most special forms:
  84. if b then c else d
  85. The idea for Mlisp was first proposed by John McCarthy in his earliest Lisp report in 196?.
  86.  
  87.