🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1061

Re: Proposed: "closures"

#1061
From: Scott Layson Burson
Date: Tue, 30 Apr 1991 20:15
27 lines
1647 bytes
In article <1991Apr28.231328.2064@world.std.com> wmm@world.std.com (William M Miller) writes:
>Sorry, "int (&cl)()" already means something: a reference to a function
>(yes, it is legal).  You'll have to keep looking for a closure syntax.

A reference to a function?  What on earth does it mean???

But it doesn't matter -- I've been chatting with Jerry Schwartz about
this, and it turns out he has already made a suggestion along rather
different lines (in document X3J16/91-0011), which is to treat `extern
"C"' as though it were part of the type of the function or function
pointer; so there would be a distinction between

   extern "C" void (*f)();

and

   void (*f)();

I like this a lot: the ugliness of the solution is exactly symmetrical
with the ugliness of the problem, which to me is the definition of an
elegant solution.  Besides, this approach casts the change in the
correct light, I think: we're not really proposing a new construct
"closures", we're just fixing pointers to functions so they work right
for member functions.

-- Scott
Gyro@Reasoning.COM
Technical Details
Message-ID: <1991Apr30.201532.13706@kestrel.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!petunia!kestrel.edu!gyro
References: <1991Apr23.032208.3264@news.cs.brandeis.edu> <1991Apr26.023303.12141@kestrel.edu> <1991Apr28.231328.2064@world.std.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!petunia!kestrel.edu!gyro
From: gyro@kestrel.edu (Scott Layson Burson)
Newsgroups: comp.std.c++
Subject: Re: Proposed: "closures"
Keywords: proposal, closures, function pointers
Message-ID: <1991Apr30.201532.13706@kestrel.edu>
Date: 30 Apr 91 20:15:32 GMT
References: <1991Apr23.032208.3264@news.cs.brandeis.edu> <1991Apr26.023303.12141@kestrel.edu> <1991Apr28.231328.2064@world.std.com>
Distribution: comp.std.c++
Organization: Kestrel Institute, Palo Alto, CA
Lines: 27