Path: utzoo!attcan!uunet!mcsun!hp4nl!fwi.uva.nl!kim!delft From: delft@fwi.uva.nl (Andre van Delft) Newsgroups: comp.object Subject: code blocks (Was: Re: Objective-C review) Message-ID: <1112@carol.fwi.uva.nl> Date: 28 Jun 90 18:00:14 GMT References: <12396@june.cs.washington.edu> Sender: news@fwi.uva.nl Reply-To: delft@fwi.uva.nl (Andre van Delft) Organization: Faculteit Wiskunde & Informatica, Universiteit van Amsterdam Lines: 22 John Maloney writes: >In reply to Brad Cox's statement: >> what about a C-based varient of Smalltalk Blocks? > >I think that blocks (or "closures", to be technical) are an extremely >valuable language mechanism. They allow all sorts of customized control >structures to be synthesized without extending the language semantics at all. How would code blocks in C look like? A code block should specify its type and its formal parameters. The syntax of a normal function declaration without the function identifier may be appropriate, as in aFunctioncall (1, void(){someCode;} ) A problem is in the typeident "void"; when enclosed in parentheses aFunctioncall (1, (void)(){someCode;} ) the compiler will see "(void)" as casting. Any better ideas?