16.10.2013 Views

5 - Forth Interest Group

5 - Forth Interest Group

5 - Forth Interest Group

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

y an Engish transla-<br />

tion or summary.<br />

Letters to the Editor<br />

Letters to the editor are,<br />

in effect, short articles, and<br />

so deserve recognition. The<br />

author of a <strong>Forth</strong>-relatedletter<br />

to an editor published in any<br />

magazine except ForCh Di-<br />

mensions is awarded $10<br />

credit toward FIG member-<br />

ship dues, subject to these<br />

conditions:<br />

a. The mdit applies only<br />

to membership dues<br />

for the membership<br />

year following the one<br />

in which the letter was<br />

published<br />

b. The maximum award<br />

in any year to one<br />

person will not ex-<br />

ceed the full cost of<br />

the FIG membership<br />

dues for the following<br />

year.<br />

c. The author must sub-<br />

mit to the <strong>Forth</strong> Inter-<br />

est <strong>Group</strong> a photo-<br />

copy of the printed<br />

letter, including iden-<br />

tification of the<br />

magazine and issue in<br />

which it appeared,<br />

within sixty days of<br />

publication A coupon<br />

worth $10 toward the<br />

following year's<br />

membership wil then<br />

be sent to the author.<br />

d. If the original letter<br />

was published in a<br />

language other than<br />

English, the letter must<br />

be accompanied by<br />

an English translation<br />

or summary.<br />

January 1992 February<br />

(Pcyerk Listing Four, continued.)<br />

\ ......................<br />

\ ** DEFERRED BINDING **<br />

\ ......................<br />

\ Deferred binding allow you to specify the object at runtime,<br />

\ rather than at compile time.<br />

\ { Starts deferred binding. He assumes there's a method # on<br />

\ top of the method stack. He copies that as a literal into<br />

\ inline code (along with an mpush) .<br />

: {<br />

state@<br />

if \ We are compiling<br />

compile (lit) \ Compile literal<br />

mPoP ,t<br />

\ Get method #<br />

compile mpush \ Compile mpush code<br />

endif \ Interpreting--do nothing<br />

; immediate<br />

\ ) Concludes a deferred method. He assumes there will be<br />

\ (at runtime) a method # on top of the method stack and an<br />

\ object pointer atop the data stack. He pushes the object<br />

\ pointer onto the object stack, finds the method, and executes<br />

\ it.<br />

: 1<br />

opush \ Push object pointer<br />

exec-ob j \ Execute it<br />

I<br />

\ .......................<br />

\ ** PATCHES AND MISC. **<br />

\ .......................<br />

\ Following code is the patch to interpret.<br />

\ Allows system to recognize methods and instance variables.<br />

\ NOTE: When we get here, literal? has left 2 zeros on stack.<br />

\ For uniformity's sake. ..we pass them on along.<br />

: <br />

2drop \ Clear stack<br />

\ See if the item in question is a method. If so, leave the<br />

\ method id # on the method stack<br />

here methname-find dup<br />

-1 <br />

if mpush exit \ Push the method #<br />

else drop<br />

endif<br />

\ Not a method -- see if it's an ivar<br />

here search-ivar dup<br />

-1 <br />

if ?comp \ GOTTA be compiling<br />

compile (lit) \ Compile ivar value<br />

, t<br />

compile (do-ivar) \ Compile ivar handler<br />

exit<br />

else drop<br />

endif<br />

(Zisting continues on page 21 .)<br />

18 <strong>Forth</strong> Dimensions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!