October 29, 2003

It's alive!

I decided to do the only sensible thing with Forth strings: dodge the whole damn question. I implemented a p" word instead which puts a parrot string on the stack when the word its compiled into is executed. WIth that, and a few other bits of jiggery-pokery, I was good to go. And I do mean good--this code:


: loadcurses p" library/ncurses.pasm " loadpasm ;
: initscr p" ncurses::initscr " findglobal 0 preg invoke resultP ;
loadcurses
initscr

will, in Parrot Forth (when executed from the main parrot directory at least), load up the ncurses interface library and call the initscr function in it. (Which will lock up your terminal session, but that's a sign that it works!)

The next inevitable step is a full forth-based life program, as that's the inevitable demo. (It's the Programmer Magpie Effect :)

Posted by Dan at October 29, 2003 03:49 PM | TrackBack (0)
Comments

That's beautiful! I can't wait to see how the rest of Parrot Forth turns out.

Posted by: Gnomon at October 30, 2003 03:04 PM