To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 163
162  |  164
Subject: 
RE: variables, etc.
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Tue, 2 Nov 1999 19:01:51 GMT
Viewed: 
1437 times
  
Thanks for your answers!

Go ahead and post my message and your reply to the pbFORTH forum -- that
would be great.

Will do shortly...

I'm glad to see hat you agree variables are the way to go. I'll have no
problem with the precision issues. One of the things I like about FORTH
is that it is easy to define new "numeric types" by defining a bunch of
words to operate on a certain storage format. For example, if I decide I
need to use a fixed point format with (say) 1 sign bit, 5 "integer" bits
and 10 "fraction" bits, I can define a whole set of operators to do
arithmetic and conversions with that type. It's almost as good as having
an object-oriented language like Smalltalk.

I'm not sure I want to be known as the guy that hates variables. They
DO have their place, as data structures or to hold information that
is infrequently accessed or is inconvenient to manage on the stack.

The thing that beginning Forthers need to get their head around is when
to use the stack and when to use a variable. I use the stack to keep
similar parameters around for sequential operations. Or to make the
result of one word the input to the next...

Anyway, it'll be a little while before I have something to show, and
I'll post to LUGNET when I do...

I hope you do! Remember to check out hForth at <http://www.forth.org>
This is the prototype of pbForth and it has LOTS of optional stuff like
double precision and floating point words built in!

At some point, I'm going to integrate the fixed point stuff from the ROM
into pbForth. Right now, all the 16 bit math is done in interpreted bytecode.
But I'm not in a rush to do anything until someone screams for it :-)

Cheers,

Ralph Hempel - P.Eng

--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to:      rhempel at bmts dot com
--------------------------------------------------------



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR