This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Blocks in g++ ?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]