Re: embedding minipicolisp

2011-06-22 Thread Doug Snead
Hi Alexander, Ha! That last code snippet got me to where I needed to get :-) THANKS!! (Now when I close my eyes I see pilog - what does that mean?) Cheers, Doug --- On Wed, 6/22/11, Alexander Burger wrote: > From: Alexander Burger > Subject: Re: embedding minipicolis

Re: embedding minipicolisp

2011-06-22 Thread Alexander Burger
Hi Doug, > I can then doPrint() on what doRead() returns - although I don't see > the customary parentheses around the list I hand that to doEval(). Calling the high-level Lisp function 'doEval' is not a good idea, because it first evaluates its arguments, which is not what is needed here. The s

Re: embedding minipicolisp

2011-06-21 Thread Doug Snead
", (long)ev); Env.get = getSave; 1 get: '(' 2 get: '+' 3 get: ' ' 4 get: '1' 5 get: ' ' 6 get: '2' 7 get: ')' 8 get: ' ' read ok doPrint(rv): 1 2 eval ok, = 6 ... Segmentation fault But clo

Re: embedding minipicolisp

2011-06-21 Thread Doug Snead
--- On Tue, 6/21/11, Alexander Burger 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

Re: embedding minipicolisp

2011-06-21 Thread Alexander Burger
Hi Doug, > Basically replacing main() with: > ... > void miniPicoLisp_init( const char * home_dir ) > { >heapAlloc(); >initSymbols(); > >if (home_dir) { > int l = strlen(home_dir) + 1; > Home = malloc( l ); > memcpy(Home, home_dir, l ); > Home[ l ] = '\0'; >

Re: embedding minipicolisp

2011-06-20 Thread Doug Snead
; // eval doPrint( v ); // print } return 0; } Doug --- On Sat, 6/18/11, Alexander Burger wrote: > From: Alexander Burger > Subject: Re: embedding minipicolisp > To: picolisp@software-lab.de > Date: Saturday, June 18, 2011, 11:21 PM > Hi Dou

Re: embedding minipicolisp

2011-06-18 Thread Alexander Burger
Hi Doug, hehe, now our mail crossed :) > 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 Yes. See also my mail. > Then I'd need to not define main(), and remember to call bye(0). Yes, main() might con

Re: embedding minipicolisp

2011-06-18 Thread Alexander Burger
Hi Doug, > 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. The mechanism in PicoLisp to execute a string is '

Re: embedding minipicolisp

2011-06-18 Thread Doug Snead
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 = myP