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.

ules. (Jim Callahan, Harvard<br />

Softworks; FD XIIV4).<br />

I believe 1) and 2) above<br />

are related.Without aggres-<br />

sive marketing (of both <strong>Forth</strong><br />

products and FD itself), all<br />

previous creative efforts will<br />

wither on the vine. The 240<br />

million people in this coun-<br />

try have a lot of demands on<br />

their time. If <strong>Forth</strong> doesn't<br />

appear worth the effort,<br />

people won't invest the time<br />

to find out it is. Look at the<br />

success of the C prograrn-<br />

ming community. As a dab-<br />

bler in both languages, I can<br />

vouch that there is no short-<br />

age of public relations on the<br />

C side.<br />

Therefore, I implore you<br />

and your staff to listen to<br />

these vendor complaints and<br />

take action How about some<br />

articles comparing the vari-<br />

ous hardware <strong>Forth</strong>s (Silicon<br />

Cornpasen, etc.). How about<br />

articles comparing the ad-<br />

vantages and disadvantages<br />

of the various softsaxe <strong>Forth</strong>s<br />

(polyFORTH, HS/<strong>Forth</strong>,<br />

MMS-<strong>Forth</strong>, etc.). How about<br />

inviting the vendors to de-<br />

clare the advantages of their<br />

systems in article form (they<br />

would probably be willing<br />

to pay for the opportunity.. .I.<br />

Failure to take action will<br />

lead to suffering what I call<br />

the Atari lesson. In 1985,<br />

when I bought the computer<br />

I'm typing this letter on, the<br />

personal computer industry<br />

was just taking off. 'Ihe Apple<br />

I1 was showing its age, the<br />

overpriced/underpowered<br />

IBM XT was carving a large<br />

market share, and the AT<br />

had just appeared. Probably<br />

the most popular computer<br />

was the very limited Com-<br />

modore 64. The most in-<br />

triguing computer out was<br />

the Apple MacintosLa wr-<br />

friendly machine which cost<br />

over $2000 (with student dis-<br />

count) for the 2% Kbyte<br />

standard. Into this maelstrom<br />

jumped a recently reorga-<br />

nized Atari with the ST. A<br />

window/mouse-driven ma-<br />

chine with a big cdorscreen<br />

and 512 Kbyte, all for less<br />

than $1000. It was a dream<br />

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

: (methid->addr) ( addrl n -- addr2 )<br />

swap 2+ \ Advance to method pointer<br />

begin<br />

@t \ Fetch pointer<br />

dup<br />

while<br />

dup>r \ Save copy<br />

2+ @t \ Fetch id number<br />

over = \ Match?<br />

if drop \ Clear method id #<br />

r> 4+ \ Point to code<br />

exit<br />

endif<br />

r > \ Ready for next loop<br />

repeat<br />

2drop 0 \ Show failure<br />

,<br />

\ find-method-code<br />

\ Expects a method id # atop the method stack and an object<br />

\ pointer atop ostack. Locates the method code and<br />

\ leaves it on dstack. In so doing, the method stack is popped.<br />

: find-method-code ( -- code )<br />

='POP \ Get method id<br />

ostack->dstack \ Fetch the object<br />

@ \ Address in token seg<br />

begin<br />

2dup swap (methid->addr ) \ Get address<br />

? dup \ Didja find it?<br />

if -rot 2drop \ Clear the stack<br />

exit \ Bug out<br />

endif<br />

(>super) \ Not found ...g o to super object<br />

?dup \ Any super object??<br />

0-<br />

until<br />

clear-o&mstacks \ Clear the stacks<br />

abort" Method not found"<br />

I<br />

\ Define a method. This word doesn't do a create ... it<br />

\ loads the method name in the method segment (unless<br />

\ its already there), then compiles the code at the<br />

\ end of the object definition. The code is linked to<br />

\ the preceding method for that object.<br />

: :m<br />

\ We must be defining a class<br />

curr-class-off @ 0=<br />

if clear-o&mstacks<br />

abort" Method def. ouside class"<br />

endif<br />

\ We are the new method tail ... so fix the link<br />

\ code.<br />

here-t new-method-tail<br />

0 I t<br />

\ See if the method is in the method seg. If it is,<br />

\ return the method #...if not, add this method in and<br />

\ assign a number.<br />

blword \ Parse the name<br />

tstring $! \ Put it in tstring<br />

tstring methname-find \ Look for the method<br />

dup -1 = \ Found?<br />

January 1992 February 14 <strong>Forth</strong> Dimensions

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

Saved successfully!

Ooh no, something went wrong!