From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10682 invoked by alias); 11 May 2006 11:52:18 -0000 Received: (qmail 10669 invoked by uid 22791); 11 May 2006 11:52:18 -0000 X-Spam-Check-By: sourceware.org Received: from mail.agora-net.com (HELO mail.agora-net.com) (67.59.132.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 May 2006 11:51:46 +0000 Received: from ttn by mail.agora-net.com with local (Exim 4.50) id 1Fe9fG-0007H5-3z for cgen@sources.redhat.com; Thu, 11 May 2006 07:49:06 -0400 From: Thien-Thi Nguyen To: cgen@sources.redhat.com In-reply-to: <17506.11439.818364.259602@casey.transmeta.com> (message from Doug Evans on Wed, 10 May 2006 11:10:55 -0700 (PDT)) Subject: Re: [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input Reply-to: ttn@glug.org References: <44622986.3090309@redhat.com> <17506.11439.818364.259602@casey.transmeta.com> Message-Id: Date: Thu, 11 May 2006 11:52:00 -0000 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/msg00027.txt.bz2 From: Doug Evans Date: Wed, 10 May 2006 11:10:55 -0700 (PDT) Blech. Dave Brolley writes: > I've committed the attach patch. I allows the psecification of > > (if (application-is? ) > (true expr) > (false expr)) > > at the top level of the CGEN input. This test corresponds to (eq? > application ) which is found in many places in the CGEN source. > For example > > (if (application-is? SID-SIMULATOR) > (include "sid-macros.cpu") > (include "sim-macros.cpu")) 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"))) going from `if' to `cond' gets you extensibility. going from `cond' to `case' gets you regularity and some namespace separation, providing you are in the mood for a certain style of symbolic manipulation... thi