Files
ueforth/site/classic.html
2022-07-14 21:19:09 -07:00

74 lines
1.9 KiB
HTML

<!DOCTYPE html>
<!--
Copyright 2021 Bradley D. Nelson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<meta charset="UTF-8">
<title>Classic EForth</title>
<link rel="stylesheet" href="static/eforth.css">
</head>
<body>
<h1>Classic EForth</h1>
{{MENU}}
<div class="wrapper">
<p>
EForth is a delightfully minimalist approach to Forth originated by Bill Muench and Dr. C. H. Ting.
</p>
<h2>Classic ESP32forth</h2>
<p>
ESP32forth - Version 6.3 for NodeMCU ESP32S - Tweaked for the Web
</p>
<p>
<a href="https://eforth.storage.googleapis.com/releases/ESP32forth-6.3.0.ino">ESP32forth-6.3.0.ino</a>
- This has Dr. Ting's v6.3 version with WebUI added in to it.
</p>
<h3>Classic EForth Quirks</h3>
<p>
EForth exclusively uses <code>FOR..NEXT</code> in favor of <code>DO..LOOP</code>.
<a href="https://github.com/TG9541/stm8ef/wiki/eForth-FOR-..-NEXT">Details</a>
</p>
<p>
This construct has the odd property that it iterates one "extra" time for zero.
</p>
<pre>
: FOO 10 FOR R@ . NEXT ; FOO
10 9 8 7 6 5 4 3 2 1 0 ok
</pre>
<p>
To permit a more ordinary loop the <code>AFT</code> word is used in the sequence
<code>FOR..AFT..THEN..NEXT</code>.
</p>
<pre>
: FOO 10 FOR ( 1st time only ) AFT R@ . THEN NEXT ; FOO
9 8 7 6 5 4 3 2 1 0 ok
</pre>
<p>
The even more enigmatic <code>FOR..WHILE..NEXT..ELSE..THEN</code>
is used in place of <code>DO..LEAVE..LOOP</code>.
It allows a while condition to early out of a counted loop.
</p>