--- On Tue, 6/21/11, Alexander Burger <a...@software-lab.de> wrote:
> Yes, the Apply* lines are needed (or what does the "??"
> imply?).

I wasn't sure if I needed that for my initialisation - you answered my question 
there. 

> I see one remaining problem: The 'ErrRst' global, the error
> restart jump
> buffer, is not initialized. This may cause a crash if a
> runtime error
> occurs. So I would include something like
>    if (setjmp(ErrRst))
>       error_Message_or_exit()

Ah ha! That explains the crash that happens when it gets errors :-)

> >    return load(NULL, 0, mkStr(str));
> Doesn't this have the disadvantage that 'str' must always
> begin with a minus sign?

Yes it does have that issue.   What I want is to get similar eval/print 
behavior that we get from:

   while (!feof(stdin))
      load(NULL, ':', Nil);

in main(), except I'd like to be able to hand it a s-expression in a string 
like "(+ 1 1)" for evaluation, leaving the I/O unaffected.  

I was hoping I could do this leaving Env.get/.put untouched. 

But due to the character-oriented way LISPs most often parse things, it is 
looking now like I really will indeed need to make  Env.get (at least) read 
from a character buffer.  (And then doEval(doRead()) in place of the load() I 
am using now.)

My goal is to be able to easily embed (mini)picolisp (and pilog) in C/C++ 
projects like people now embed lua in applications when they want to add 
scripting.  :-)  

> Regarding the question of cleanup: I would write a function
>    void miniPicoLisp_stop(void)
> which is identical to bye(), except for the exit() at the end.

Thanks for the guidance!!

Cheers,

Doug

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to