home *** CD-ROM | disk | FTP | other *** search
- From: kers@hplb.hpl.hp.com (Chris Dollin)
- Date: Wed, 27 Jan 1993 10:22:44 GMT
- Subject: Re: Lisp vs English (was Re: Why Isn't Lisp a Mainstream Language?)
- Message-ID: <KERS.93Jan27102244@cdollin.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- 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
- Newsgroups: comp.lang.lisp
- References: <728069830.F00001@ocitor.fidonet>
- Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
- Lines: 43
- In-Reply-To: Michael.Fleming@f2206.n124.z1.fidonet.org's message of Tue, 26 Jan 1993 09:36:00
- Nntp-Posting-Host: cdollin.hpl.hp.com
-
- Michael.Fleming@f2206.n124.z1.fidonet.org (Michael Fleming) writes:
-
- Don't most languages use prefix notation? For example puts("type
- your name."); seems quite similar to (print "type your name"). Why
- is one prefix and the other something else? Prefix notation is also
- common in English. We say "Put the letter in the slot" not "letter
- put slot." Or "the letter put in the slot". I am puzzled by the
- complaint that a drawback of Lisp is its use of prefix notation.
- I agree that a complex math expression can be difficult in prefix,
- but the same expression is usually difficult in infix as well.
- * Origin: The Interocitor*AI/Robotics*214-258-1832 (1:124/2206)
-
- (a) Imperatives in English are prefix, but declarative sentences are
- infix (degnerating to postfix when there's no second argument); ``I
- drink tea'', ``She abhores jazz'', ``This is an aardvark'', ``I swim''.
-
- (b) In any case, ``infix'' is rather a weak term, sicne many
- (programming) language structures ae mixfix; if-then-else-(endif),
- while-do-(endwhile), etc, as well as providing infix operators.
-
- (c) Infix operators are not confined to the usual mathematical ones;
- consulting a piece of code I've just de-iconised, I see the following
- infixes:
-
- . x.f, evaluate x and apply f to it
- ->> val ->> var, assign and preserve value
- -> val -> var, assign, don't preserve value
- == x == y, x is-identical-to y (test)
- /== x /== y, x isn't the same thing as y
- :: x :: y, list with head x and tail y
- > x > y, numeric greater-than
- - x - y, numeric subtraction
- + x + y, numeric addition
- >< x >< y, turn into strings and concatenate
-
- *I* find ``x == y'' easier to read than ``(== x y)'' or ``(eq x y)'',
- and at this point Your Kilometerage May Vary.
-
-
- --
-
- Regards | "Always code as if the guy who ends up maintaining your code will be
- Kers. | a violent psychopath who knows where you live." - John F. Woods
-