Using main.c as a guide, perhaps I might define my own character io myGet and 
myPut (I'd use that to get and put characters to and from a GUI console, say). 
Then maybe hook them up like so:

   heapAlloc();
   initSymbols();
   InFile = stdin,  Env.get = myGet;
   OutFile = stdout,  Env.put = myPut;

   // ??
   ApplyArgs = cons(cons(consSym(Nil,0), Nil), Nil);
   ApplyBody = cons(Nil,Nil);

   any inv = mkStr( str_in );
   any outv = EVAL( inv );

Then I'd need to not define main(), and remember to call bye(0). 

That's my thinking on how I might do that, so far (embed minipicolisp).

Cheers,

Doug



--- On Sat, 6/18/11, Doug Snead <[email protected]> wrote:

> From: Doug Snead <[email protected]>
> Subject: embedding minipicolisp
> To: [email protected]
> Date: Saturday, June 18, 2011, 8:20 PM
> Another question have I :-)  
> 
> I'd like to embed minipicolisp in C applications.  I'd
> like to be able to create a minipicolisp environment, and
> then pass strings to it (commands) for execution.  It
> would also be great to be able get back the results in a
> string.  In lua, you'd do something like,
> 
>  L = lua_open();
>  luaL_dostring(L, str_in );
>  str_out = l_results_to_string(L);
> 
> What's the (best) way to do this in minipicolisp?  
> 
> Cheers,
> 
> Doug
> 
> 
> 
> 
> 
> 
>  
> -- 
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
>
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to