Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!solaris.cc.vt.edu!news.vt.edu!newspump.monmouth.com!newspeer.monmouth.com!priapus.visi.com!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!world!not-for-mail
From: buzzard@TheWorld.com (Sean T Barrett)
Subject: Re: what's wrong with some existing IF languages
Sender: news@world.std.com (Mr Usenet Himself)
Message-ID: <Gz47EI.F83@world.std.com>
Date: Fri, 12 Jul 2002 02:39:53 GMT
References: <Xns924696F5A38E7edmewsicSPAMGUARDcom@199.45.49.11> <Xns924755A2D30A1edmewsicSPAMGUARDcom@199.45.49.11> <Gz2t3q.2os@world.std.com> <uu1n69xru.fsf@dfan.thecia.net>
NNTP-Posting-Host: shell01.theworld.com
Organization: The World Public Access UNIX, Brookline, MA
X-Newsreader: trn 4.0-test72 (19 April 1999)
Lines: 34
Xref: news.duke.edu rec.arts.int-fiction:106065

In article <uu1n69xru.fsf@dfan.thecia.net>, Dan Schmidt  <dfan@dfan.org> wrote:
>Eiffel and Ruby both do this - I don't know how mainstream you'd consider
>them.  (Bertrand Meyer calls this the Uniform Access Principle and, being
>Bertrand Meyer, asserts that all true object-oriented languages must
>support it.  See <http://www.elj.com/elj/v1/n1/bm/urp/>, for example.)
>
>I like the idea, but the main practical problem I have with it is that
>it becomes difficult to refer to functions as first-class objects,
>since just naming them will call them by default.

Well, if the latter is true, I think it's a misapplication of the
principle--although every implementation I know of probably works
that way. (For my mud, I had foo.bar return the function instead
of running; foo.bar() would run the function or return the
non-function item. I don't think this was really the right
approach, but at least both things were possible.)

Meyer's page uses such an abstract notation that it's impossible
to see what he thinks should happen for a scenario like obj.foo(1,2).
That's a case that Tads3 doesn't allow; I don't remember what
Inform does.

Anyway, I think it's a misapplication because it shouldn't be
a problem to have first class functions still. If object o offers
feature f, and feature f's type signature is that it *returns*
a first class function that produces a string, then if o.f is a
function that produces a string, return it; if it's a function
that returns a function that produces a string, execute it.

Or, from the other side of the coin, the compiler/language just
needs to offer two different ways of associating functions
with o.f; one means 'run this' and one means 'return this'.

SeanB
