This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Blocks in g++ ?
- To: egcs at egcs dot cygnus dot com
- Subject: Blocks in g++ ?
- From: "Thomas Steffen" <for_replies_only at iname dot com>
- Date: 10 Jun 1999 14:30:22 +0200
hi,
would it be possible to add block support to g++? i mean blocks in
the smalltalk sense, ala:
if sometest then: [ doa ] else: [ dob ]
so blocks are a bit like anonymous functions that can be given as an
argument to a function. the special bit about blocks is that they are
executed by the called function, but they are parsed in the context of
where they are defined. so you have access to local variables etc...
i guess this could make an implementation quite akward, seems like
some fiddling with the stack point or similar is necessary.
still, blocks are the one feature from smalltalk that i am really
missing in other languages. it is a simple solution to a lot of simple
problems. these include user defined control structures, matching
begin_something and end_something functions, short callbacks etc.
please send me a copy if you post a reply.
"Thomas Steffen" <for_replies_only@iname.com>
--
We regret to announce that Windows 2000 wont be ready before 1901.