Simple gforth C Interface

This is a discussion on Simple gforth C Interface within the Forth forums in Programming Languages category; As an experiment to start getting my head around this new C interface that Bernd and Anton delivered with their latest snapshot, here's the simplest call I've found. I recommend shipping it with gforth, and documenting the libcc-tmp folder, but that is their call, not mine. #! /usr/bin/env gforth \ Contains: GForth dylib test sample \ \ Usage: gforth sleep.fs \ If these folders do not exist, you must create them \ mkdir ~/.gforth \ mkdir ~/.gforth/libcc-tmp \c #include <unistd.h> \ sleep takes number of seconds and returns an int c-function sleep sleep n -- n ..( Testing sleep for ...

Go Back   Application Development Forum > Programming Languages > Forth

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 08:54 PM
Dennis Ruffer
Guest
 
Default Simple gforth C Interface

As an experiment to start getting my head around this new C interface
that Bernd and Anton delivered with their latest snapshot, here's the
simplest call I've found. I recommend shipping it with gforth, and
documenting the libcc-tmp folder, but that is their call, not mine.

#! /usr/bin/env gforth

\ Contains: GForth dylib test sample
\
\ Usage: gforth sleep.fs

\ If these folders do not exist, you must create them
\ mkdir ~/.gforth
\ mkdir ~/.gforth/libcc-tmp

\c #include <unistd.h>
\ sleep takes number of seconds and returns an int
c-function sleep sleep n -- n

..( Testing sleep for 10 seconds )
10 sleep . cr

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:21 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.