🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth.mac
Article #40

Stand-alone code segments in Forth

#40
From: Ken Schalk
Date: Fri, 18 Dec 1992 22:18
27 lines
2236 bytes
    I'm new to Forth and enjoying it immensely, but I have a question
about stand-alone code segments, such as WDEFs and XCMDs.  Let me just
say that I experienced in other languages (Pascal, C, C++, ...) and
the Mac Toolbox, and have written both WDEFs and XCMDs in the past.
    What I'm wondering is, is it possible to build such things with
any of the Mac Forth incarnations?  (Personally, I am toying with
Pocket Forth currently, as it is free.)  If so, how does the
implementation go about building the code resource?  Does it just take
a copy of the dictionary and add some setup code and a jump to the
entry-point word at the beginning?  If not, what the heck does it do?

    My guess is that it probably hasn't been done, as I think it might
be kind of painful to turn a Forth dictionary (or some subset thereof)
into a stand-alone code resource.  However, I think it would be
wonderful if it were possible.  Having written these things in the
past, I think the concept of a WDEF in Forth is a beautiful thing.
(Heck, once you had the basics laid out, you could churn out WDEF
after WDEF all the time, leading to a distinctive look for your apps,
albeit a degeneration of the interface standard. :-)

//////////////////////////////////////////////////////////////////////
\\ Kenneth C Schalk \\\\"Is conciousness just a special form of \\\\\\  //-\
////////////////////////  hallucination?" -- Frank Herbert      ////// //-O|
\\ ken@imsa.edu \\\\\\\\"We're each other fragments...but each  \\\\\\ |   |
// schalk@mcs.anl.gov // fragment reveals the [whole] from a    //////  \_/
\\ k-schalk@uiuc.edu \\\ different angle..." -- William Gibson  \\\\\\
//////////////////////////////////////////////////////////////////////
Technical Details
Message-ID: <BzH7AK.5s7@news.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!schalk

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.forth.mac
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!schalk
From: schalk@symcom.math.uiuc.edu (Ken Schalk)
Subject: Stand-alone code segments in Forth
Message-ID: <BzH7AK.5s7@news.cso.uiuc.edu>
Summary: Is it possible?
Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
Organization: University of Illinois at Urbana
Date: Fri, 18 Dec 1992 22:18:17 GMT
Keywords: Pocket Forth WDEF XCMD blah blah blah
Lines: 27