From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20036 invoked by alias); 11 May 2006 14:12:46 -0000 Received: (qmail 20027 invoked by uid 22791); 11 May 2006 14:12:45 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 May 2006 14:12:44 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4BECgeG003558; Thu, 11 May 2006 10:12:42 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4BECfuM006654; Thu, 11 May 2006 10:12:42 -0400 Received: from [172.16.14.227] (IDENT:dWmihrWwpuLBoDtkTR1SEajZdGNEmb+t@topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k4BECfAc014240; Thu, 11 May 2006 10:12:41 -0400 Message-ID: <44634659.60508@redhat.com> Date: Thu, 11 May 2006 14:12:00 -0000 From: Dave Brolley User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: ttn@glug.org CC: cgen@sources.redhat.com Subject: Re: [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input References: <44622986.3090309@redhat.com> <17506.11439.818364.259602@casey.transmeta.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00028.txt.bz2 Thien-Thi Nguyen wrote: >why not allow computed `include' instead? (perhaps that is already >supported?) something like: > >(include EXPR) > >then EXPR can be all manner of `if', `cond' or whatever. e.g.: > >(include (if (application-is? SID-SIMULATOR) > "sid-macros.cpu" > "sim-macros.cpu")) > >(include (cond ((application-is? SID-SIMULATOR) > "sid-macros.cpu") > (else "sim-macros.cpu"))) > >(include (case (application->symbol APPLICATION-OBJECT) > ((SIMULATOR) "sid-macros.cpu") > (else "sid-macros.cpu"))) > > > The point isn't really the (include "..."). That's just what I happened to use the 'if' capability for. The true and false expressions could theoretically be any valid top level CGEN construct. Implementing conditional capability for them all seems like a lot more work for no gain and may not even make sense in some cases. Also 'cond' or 'case' could easily be added as top level tests if necessary. Dave