public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Jim Blandy" <jimb@red-bean.com>
To: "Dave Brolley" <brolley@redhat.com>
Cc: ttn@glug.org, cgen@sources.redhat.com
Subject: Re: [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input
Date: Thu, 11 May 2006 16:45:00 -0000	[thread overview]
Message-ID: <8f2776cb0605110945i75d9402bp6743ae22da38d0cb@mail.gmail.com> (raw)
In-Reply-To: <44634659.60508@redhat.com>

On 5/11/06, Dave Brolley <brolley@redhat.com> wrote:
> 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.

The larger question is, why aren't CGEN machine description files just
arbitrary Scheme code that happens to call some functions to register
machine description pieces?  Then you'd have the full Scheme language
at your disposal, not just pmacros.

None of this would complicate the interesting parts of CGEN --- the
code for producing encoders, decoders, and simulators.  They would
operate on the same data structures they do now.  You'd just have a
lot more flexibility in how those structures are produced.

  reply	other threads:[~2006-05-11 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 17:57 Dave Brolley
2006-05-10 18:11 ` Doug Evans
2006-05-11 11:52   ` Thien-Thi Nguyen
2006-05-11 14:12     ` Dave Brolley
2006-05-11 16:45       ` Jim Blandy [this message]
2006-05-11 20:52         ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f2776cb0605110945i75d9402bp6743ae22da38d0cb@mail.gmail.com \
    --to=jimb@red-bean.com \
    --cc=brolley@redhat.com \
    --cc=cgen@sources.redhat.com \
    --cc=ttn@glug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).