eforth | This is a golang simulated EFORTH
kandi X-RAY | eforth Summary
kandi X-RAY | eforth Summary
This is a golang simulated EFORTH.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- _Q_RX pushes to the F_RX channel .
- New creates a new Forth instance
- asint16 converts a uint16
- asuint16 converts a int16 to binary
- _XCHG modifies x and b .
- wordptr returns a wordptr value from the mem .
- Main entry point
- setwordptr sets a wordptr value .
eforth Key Features
eforth Examples and Code Snippets
Community Discussions
Trending Discussions on eforth
QUESTION
I’m trying to learning Forth directly in an embedded system and using Starting Forth by Leo Brodie as a text. The Forth version I’m using is 328eForth (a port of eforth to the ATmega328) which I’ve flashed into an Arduino Uno.
It appears that the DO LOOP words are not implemented in 328eForth - which puts a kink in my learning with Brodie. But looking at the dictionary using “WORDS” shows that a series of looping words exist e.g. BEGIN UNTIL WHILE FOR NEXT AFT EXIT AGAIN REPEAT amongst others.
My questions are as follows:
Q1 Why was DO LOOP omitted from 328eForth?
Q2 Can DO LOOP be implemented in other existing words? If so, how please and if not why? (I guess there must be a very good reason for the omission of DO LOOP...)
Q3 Can you give some commented examples of the 328eForth looping words?
...ANSWER
Answered 2017-Oct-16 at 20:34Q1: A choice was made for a different loop construct.
Q2: The words FOR
and NEXT
perform a similar function that just counts down to 0 and runs exactly the specified number of times, including zero.
The ( n2 n1 -- ) DO ... LOOP
always runs at least once, which requires additional (mental) bookkeeping. People have been complaining
about that as long back as I can remember.
Q3: The 382eforth documentation ForthArduino_1.pdf contains some examples.
Edit: Added some exposé to Q2
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install eforth
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page