Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ccice6.UUCP Path: utzoo!linus!decvax!genrad!wjh12!harvard!seismo!rochester!ritcv!ccice5!ccice6!dwd From: dwd@ccice6.UUCP (David W. Donald) Newsgroups: net.lang.c Subject: Re: on1 construct Message-ID: <240@ccice6.UUCP> Date: Thu, 8-Nov-84 18:52:12 EST Article-I.D.: ccice6.240 Posted: Thu Nov 8 18:52:12 1984 Date-Received: Sun, 11-Nov-84 20:05:52 EST References: <124@cadvax> Organization: CCI Central Engineering, Rochester, NY Lines: 25 > One contruct that I've always wanted to have is: > function () > { > on1 { > bla, bla, bla... > }; > etc... > } Try: #define on1 static char x = 1; if ( x ? (--x,1) : 0 ) f() { on1 { printf( "first time only\n" ); printf( "even more\n" ); } printf( "first and subsequent times\n" ); } On a VAX with 4.2BSD I get unbeatable code with cc -O. Dave Donald