From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4480b39f295c1bb285304c4b2e0f9261@cwru.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] multiple inputs From: Noah Evans In-Reply-To: <8cdad86de9428072d82f8764a903f798@vitanuova.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-nhuknwbulvpcuncxxlcnzijcdy" Date: Thu, 1 Apr 2004 10:58:05 -0500 Topicbox-Message-UUID: 4d12f304-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-nhuknwbulvpcuncxxlcnzijcdy Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I think the idea of the hygenic macro is to implement the macro facility in to the compiler as a change to the parse tree rather than a change to the program text with a preprocessor(sorry if I'm being painfully obvious here). This means that your macros don't have the normal problems associated with macros(precedence problems, multiple evaluation of arguments etc.). I haven't put very much thought into this, but from I'm guessing an implementation would act like a simplified yacc that worked with the compiler directly. Again I'm not sure how practical this would be. The only implementation I know of, in scheme, is aided by scheme's use of prefix notation. Figuring out the precedence order would be a pain. Thoughts? Noah --upas-nhuknwbulvpcuncxxlcnzijcdy Content-Type: message/rfc822 Content-Disposition: inline Return-path: <9fans-admin@cse.psu.edu> Received: from mpspam4.TIS.case.Edu (mpspam4.tis.case.Edu [129.22.104.191]) by ims-msg.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTPS id <0HVI00U0860TW8@ims-msg.cwru.edu> for npe@cwru.edu; Thu, 01 Apr 2004 12:31:42 -0500 (EST) Received: (from localhost [127.0.0.1]) by mpspam4.TIS.case.Edu (MOS 3.4.4-GR) id AEN71584 (forwarded by mail filter of npe); Thu, 01 Apr 2004 12:31:40 -0500 (EST) Received: from mirapoint1.tis.cwru.edu (mirapoint1.TIS.CWRU.Edu [129.22.104.46]) by mpspam4.TIS.case.Edu (MOS 3.4.4-GR) with ESMTP id AEN71575; Thu, 01 Apr 2004 12:31:39 -0500 (EST) Received: from mail.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by mirapoint1.tis.cwru.edu (MOS 3.4.3-CR) with ESMTP id BBV20066; Thu, 01 Apr 2004 12:31:32 -0500 (EST) Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 67C2119F5E; Thu, 01 Apr 2004 12:31:21 -0500 (EST) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 0DDA719F3E; Thu, 01 Apr 2004 12:31:19 -0500 (EST) Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id B668B19F7A; Thu, 01 Apr 2004 12:30:52 -0500 (EST) Received: from rapido.vitanuova.com (unknown [62.254.170.97]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 57B0019F3E for <9fans@cse.psu.edu>; Thu, 01 Apr 2004 12:30:51 -0500 (EST) Date: Thu, 01 Apr 2004 18:36:36 +0100 From: rog@vitanuova.com Subject: Re: [9fans] multiple inputs In-reply-to: <406C42A4.8000607@swtch.com> Sender: 9fans-admin@cse.psu.edu To: 9fans@cse.psu.edu Errors-to: 9fans-admin@cse.psu.edu Reply-to: 9fans@cse.psu.edu Message-id: <8cdad86de9428072d82f8764a903f798@vitanuova.com> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit Precedence: bulk X-BeenThere: 9fans@cse.psu.edu Delivered-to: 9fans@cse.psu.edu X-Mirapoint-Loop-ID: d367b96555615728d51f3e0bf52371dd X-Original-To: 9fans@cse.psu.edu X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on psuvax1.cse.psu.edu X-Spam-Status: No, hits=0.3 required=5.0 tests=NO_REAL_NAME autolearn=no version=2.63 X-Junkmail-Status: score=5/45, host=mpspam4.TIS.case.Edu X-Mailman-Version: 2.0.11 List-Archive: List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> Original-recipient: rfc822;npe@spamfree.cwru.edu > which is much clearer and doesn't require us to wade through > custom macro syntax. i sympathise completely. problem is the moment you have something that's flexible enough to allow alt, you'll get someone that wants to do all kinds of other things with it. remember: LOCAL TREPTR list(flg) { REG TREPTR r; REG INT b; r = term(flg); WHILE r ANDF ((b=(wdval==ANDFSYM)) ORF wdval==ORFSYM) DO r = makelist((b ? TAND : TORF), r, term(NLFLG)); OD return(r); } what you're after, i think, is a different language, one with one or two extra features, not really a way to customise C in an arbitrary way. a pre-processor could do the job, but you'd pay the price. if many people defined syntax like the alt stuff, you'd really struggle to work out what was going on. IMHO a language requires a small, coherently designed set of features, not a way to add every feature under the sun. --upas-nhuknwbulvpcuncxxlcnzijcdy--