At 12:41 PM 12/17/00 -0500, Bradley M. Kuhn wrote:
>Nicholas Clark <[EMAIL PROTECTED]> wrote:
>
> > Something I though of:
> > If you're trying to write an interactive perl inputer - either a perl shell
> > or just the command prompt on the debugger it would be useful if you
> > could tell the parser that the chunk of source you're giving it may be
> > incomplete.
>
>I really like this idea, although I am unsure of how we might implement it.
>I don't recall any of the compiler texts I have read over the years talking
>about formal methods for writing such a "partial programs are acceptable"
>parser.
>
>
>Lisp-like languages handle this, but s-expressions are so trivial to parse
>that it's no help to simply "follow" their example.

BASICs generally allow this.

The rule I was thinking was we'd take source on the fly, and execute bare 
statements and (opionally) print the results. Blocks wouldn't get executed 
until they were closed, and things like "sub" wouldn't get executed, only 
parsed. (Like they are now)

Basically read to the end of a statement and eval the statement, only do it 
with a scopeless eval, so things like lexical variables wouldn't 
immediately disappear.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to