Newsgroups: rec.arts.int-fiction
Subject: Re: what's wrong with some existing IF languages
References: <Xns924696F5A38E7edmewsicSPAMGUARDcom@199.45.49.11> <Xns92479B14FAF54OKB@12.252.202.62>
 <656X8.29751$5f3.22064@nwrddc01.gnilink.net>
 <agitkb$qnp@dispatch.concentric.net> <Hy7X8.18$7W6.3@nwrddc02.gnilink.net>
 <S%7X8.311714$R61.268018@rwcrnsc52.ops.asp.att.net>
 <He9X8.241$7W6.122@nwrddc02.gnilink.net>
 <eheX8.177$uw.207@rwcrnsc51.ops.asp.att.net> <3D2EC4E8.80902@csi.com>
 <ago3kv$qo9@dispatch.concentric.net> <3d302ede@excalibur.gbmtech.net>
 <Nf7Y8.350287$R61.330207@rwcrnsc52.ops.asp.att.net>
 <3d317469@excalibur.gbmtech.net> <7LvY8.541163$cQ3.49111@sccrnsc01>
 <3D330FCF.60006@csi.com> <3d3437cd.20872218@news.tiscali.nl>
 <3d356991@excalibur.gbmtech.net> <3d36bb67.23942883@news.tiscali.nl>
 <3d373ef9@excalibur.gbmtech.net> <m3ofd4h7iv.fsf@gauss.totzeit.net>
 <3D382A69.8070302@csi.com>
From: Chris Kirkwood-Watts <kirkwood@totzeit.net>
Date: Fri, 19 Jul 2002 09:42:11 -0700
Message-ID: <m3d6tjhdp8.fsf@gauss.totzeit.net>
Lines: 46
User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2
 (i386-redhat-linux-gnu)
Cancel-Lock: sha1:vQRv2mZUeAcF0hcTCOfpgTaL10I=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Abuse-Report: abuse@nntpserver.com
Organization: http://www.nntpserver.com
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!news5.nntpserver.com!not-for-mail
Xref: news.duke.edu rec.arts.int-fiction:106405

 __ "John Colagioia" <JColagioia@csi.com> _____
| True; I wonder why the parentheses aren't entirely optional, though,
| since, almost by definition, there cannot be any ambiguity.

 __ Chris Kirkwood-Watts <kirkwood@totzeit.net> _____
| Which parens are redundant?

 __ John Colagioia <JColagioia@csi.com> _____
| As I understand it, if you know the number of parameters each function
| takes, and which names are functions (which I remember at least a few LISP
| implementations make you annotate, if not all of them), then they're all
| effectively redundant (due to the simplicity of the prefix notation),
| except in the case where you return a function.

  Ah, now I understand why you might think this.  The statements you have
  written above are logically true; however, many Lisp functions (and most
  arithmetic ones) are of variable arity.  For example, the function + will
  consume as many arguments as you give it:

    (+ a b c d e - + / foo bar ^ mod expt z ? and f)

  But, since you know that the first + above is a function (and not a macro
  or special operator, for example), you can decide that the -, the second
  +, and the rest of the arguments are not used as functions (in this
  context).  To use infix as you say, you would have to restrict the arity
  of functions, which would change the language considerably.

 __ Chris Kirkwood-Watts <kirkwood@totzeit.net> _____
| For what it's worth, a little macrology will get you infix notation for
| mathematical expressions in Common Lisp as well as C-style function
| calling syntax.

 __ John Colagioia <JColagioia@csi.com> _____
| Heh.  Ewwwww...

  Indeed.  It comes out looking like this:

    #I(c[0] += b - 3*(3.0 - a/(b + 40))^^3 - mod(a, b))

  which is transformed into the expression:

    (INCF (AREF C 0) (- B (* 3 (EXPT (- 3.0 (/ A (+ B 40))) 3)) (MOD A B)))

  but it makes some folks feel more comfortable.

Chris.
