Message-ID: <3D2EC4E8.80902@csi.com>
Date: Fri, 12 Jul 2002 08:00:40 -0400
From: John Colagioia <JColagioia@csi.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0rc2) Gecko/20020618 Netscape/7.0b1
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: what's wrong with some existing IF languages
References: <Xns924696F5A38E7edmewsicSPAMGUARDcom@199.45.49.11> <agfei1$l7p10$1@ID-60390.news.dfncis.de> <Xns924755A2D30A1edmewsicSPAMGUARDcom@199.45.49.11> <iain-137BC7.21103410072002@socrates.zen.co.uk> <nJ1X8.28523$5f3.16894@nwrddc01.gnilink.net> <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>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Trace: excalibur.gbmtech.net 1026474821 ool-182f30fa.dyn.optonline.net (12 Jul 2002 07:53:41 -0400)
Organization: ProNet USA Inc.
Lines: 33
X-Authenticated-User: jnc
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:106077

Tzvetan Mikov wrote:
[...]
> Anyway, instead of delving into theoretical discussions, can you give an
> example of when you think that modifying the value of a formal parameter
> improves readability and style ?

I won't speak for the original poster, but I think you're trying to
apply C-like semantics to a non-C language, which is what's causing
the problem.

In Inform, it sort of equates to not having parameters; instead, a
routine has local variables, some of which can be initialized by the
calling routine.

In terms of readability, this means that "function calls" only carry
the "parameters" they need, so that you don't have to read through
ugly code like "ret = SomeFunc (obj, routine, 0, 0, nothing, 0,
nothing, 0, 0, 0);" which carries no more useful information than the
two-parameter equivalent, and is harder to grasp because of the extra
(unused) parameters.

> Since there is no semantic difference between modifying the value of a
> parameter in place and copying it to another location, the only possible
> reasons that one might prefer one or the other are:
> - if it saves some typing,
> - if he believes that it improves readability,
> - if he doesn't care.

There's also the rather useful point that this allows parameters to
have convenient default values (also increasing readability over, to
use your example, copying all the parameters to similarly-named
locals).

