From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3ac9f1875da23e2a87c944d85ab35e70@collyer.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] multiple inputs From: Geoff Collyer In-Reply-To: <406C42A4.8000607@swtch.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 1 Apr 2004 17:46:41 -0800 Topicbox-Message-UUID: 4d8c4c54-eacd-11e9-9e20-41e7f4b1d025 Actually, writing out alts initialisation by hand has always seemed clumsy to me. void newalt(Alt *ap, ChanOp op, Channel *c, void *v) { ap->op = op; ap->c = c; ap->v = v; } Alts alts[3], *ap = alts; newalt(ap++, CHANRCV, done, nil); newalt(ap++, CHANSND, c, val); newalt(ap, CHANEND, nil, nil); seems a bit more obvious and only requires one additional line per channel.