Re: A subst-antial question



Kip Rugger wrote:
I suspect you are trying to do a simplified version of 2). You have
a set of variables whose values you wish to replicate

That's right. The context in which this question came up has two
interpreters (actually more, but we can treat them pairwise) in which
I'd like to keep certain variables (but not all) in sync. I could
write a bunch of "set" or "array set" statements for the local
interpreter, then write them again for the remote interpreter; I know
how to do that for all the various kinds of things I need to replicate.
But then I thought, why not just take the "script" for the local
interpreter and use it to generate the script for the remote
interpreter? My naive attempt used [subst], and resulted in a
surprising revelation about just what [subst] does and doesn't do.

Maybe what it comes down to is that I'm surprised there's no simple way
to substitute an expression without changing the number of words in it,
like the parser does. Or maybe I'm mistaken about what I think the
parser is doing.

.



Relevant Pages

  • Re: A subst-antial question
    ... interpreter, then write them again for the remote interpreter; ... how to do that for all the various kinds of things I need to replicate. ... surprising revelation about just what [subst] does and doesn't do. ... like the parser does. ...
    (comp.lang.tcl)
  • Re: OFF-TOPIC:: Why Lisp is not my favorite programming language
    ... The interpreter would be written in C. ... It is always possible to beat any interpreted language for speed using ... >at me for calling lisp a parsing language... ... I would write a parser to do so. ...
    (comp.lang.python)
  • Re: Has anyone hand-written a scanner/parser module?
    ... tools to create scanner/parser modules for their compiler projects. ... Wrote an interpreter for a very simple imperative language at university. ... Back then I was given the choice of using lex ... The Parser was a Recursive descent parser ...
    (comp.compilers)
  • Re: How-to on writing an interpreter?
    ... > simple stack-based interpreter. ... Industrial-strength parsers come from parser generators like Lex and Yacc. ... Test-Driven Development by writing tests for each feature and passing each ... A third alternative is to use an OO language with sufficient power and ...
    (comp.programming)
  • Re: I want to create my own language
    ... Ok, so you recommend me, to use read macros and transform the code ... I think the suggestion is to write a parser. ... let you dramatically change the the input language. ... you will then need to create an interpreter ...
    (comp.lang.lisp)