home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / lisp / 3403 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.6 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Wed, 27 Jan 1993 10:22:44 GMT
  3. Subject: Re: Lisp vs English (was Re: Why Isn't Lisp a Mainstream Language?)
  4. Message-ID: <KERS.93Jan27102244@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!udel!bogus.sura.net!howland.reston.ans.net!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.lang.lisp
  8. References: <728069830.F00001@ocitor.fidonet>
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 43
  11. In-Reply-To: Michael.Fleming@f2206.n124.z1.fidonet.org's message of Tue, 26 Jan 1993 09:36:00
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14. Michael.Fleming@f2206.n124.z1.fidonet.org (Michael Fleming) writes:
  15.  
  16.    Don't most languages use prefix notation? For example puts("type 
  17.    your name."); seems quite similar to (print "type your name"). Why 
  18.    is one prefix and the other something else? Prefix notation is also 
  19.    common in English. We say "Put the letter in the slot" not "letter 
  20.    put slot." Or "the letter put in the slot". I am puzzled by the 
  21.    complaint that a drawback of Lisp is its use of prefix notation.
  22.    I agree that a complex math expression can be difficult in prefix, 
  23.    but the same expression is usually difficult in infix as well.
  24.     * Origin: The Interocitor*AI/Robotics*214-258-1832 (1:124/2206)
  25.  
  26. (a) Imperatives in English are prefix, but declarative sentences are 
  27. infix (degnerating to postfix when there's no second argument); ``I 
  28. drink tea'', ``She abhores jazz'', ``This is an aardvark'', ``I swim''.
  29.  
  30. (b) In any case, ``infix'' is rather a weak term, sicne many 
  31. (programming) language structures ae mixfix; if-then-else-(endif),
  32. while-do-(endwhile), etc, as well as providing infix operators.
  33.  
  34. (c) Infix operators are not confined to the usual mathematical ones; 
  35. consulting a piece of code I've just de-iconised, I see the following
  36. infixes:
  37.  
  38.     .        x.f, evaluate x and apply f to it
  39.     ->>        val ->> var, assign and preserve value
  40.     ->        val -> var, assign, don't preserve value
  41.     ==        x == y, x is-identical-to y (test)
  42.     /==        x /== y, x isn't the same thing as y
  43.     ::        x :: y, list with head x and tail y
  44.     >        x > y, numeric greater-than
  45.     -        x - y, numeric subtraction
  46.     +        x + y, numeric addition
  47.     ><        x >< y, turn into strings and concatenate
  48.  
  49. *I* find ``x == y'' easier to read than ``(== x y)'' or ``(eq x y)'',
  50. and at this point Your Kilometerage May Vary.
  51.  
  52.  
  53. --
  54.  
  55. Regards | "Always code as if the guy who ends up maintaining your code will be
  56. Kers.   | a violent psychopath who knows where you live." - John F. Woods
  57.