Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cadence!cadence!barnes From: barnes@cadence.com (Tim Barnes) Newsgroups: comp.lang.c++ Subject: Re: Request for help in simulating an interactive system Message-ID: Date: 23 Oct 90 19:02:05 GMT References: <935@babcock.cerc.wvu.wvnet.edu> Sender: usenet@cadence.com (USENET News) Organization: Cadence Design Systems, Inc. Lines: 28 In-Reply-To: kerrin@cathedral.cerc.wvu.wvnet.edu's message of 22 Oct 90 18:17:56 GMT In article <935@babcock.cerc.wvu.wvnet.edu> kerrin@cathedral.cerc.wvu.wvnet.edu (Kerrin Smith) writes: > I am in the process of developing a constraint management system in G++. I am > interested in being able to dynamically load constraints of a form such > as X = Y + Z, where X, Y and Z are variables. Upon recognizing a variable, > I will create a new "variable" object. Here is where my problem lies. > I would like to be able to *bind* the variable name, say X, to the newly > created object so that later I can reference it directly simply by using the > name X. > I know that what I am trying to do is exactly what separates interpreters > from compilers, but it seems as though there must be a more elegant method > to simulating an interactive system. Any advice or references would be > greatly appreciated. Why don't you simply embed a small interpreter? There's been some work done at MCC where the XLISP (by David Betz) interpreter is embedded in a C++ program; you might also choose a Scheme system. Lisp objects blend very well with an object-oriented implementation, because they "know" about their type, and potentially about their own behaviour. This kind of system would let you use each language as it was intended to be used. -- / / Manager, Framework Technology - Cadence Design Systems -/- o /__ ___ __ ___ ___ ___ 555 River Oaks Parkway / / /\ /\ / / ___/ / / / /__/ /__ San Jose, CA 95134 /__ / / \/ \ /__/ /__/ / / / /__ ___/ barnes@cadence.com (408) 944 7222