Just having bought a Apple II from Captain Crunch makes you a legend!
Bought him the Forth not the Apple II!
Yes I could see your extra Words.
Forth people never copy each others code, for one we don't need to, and 2) our systems are all different.
Your code is:
: invert 0= if 1 else 0 then ;
26 output: speaker
: beep
begin
speaker speaker digr invert digw
350 delay.us
key?
until
speaker 0 digw
;
Mine would be something like:
( not inverts all bits)
: beep
begin
speaker dup digr not digw
350 delay.us
key?
until
speaker 0 digw
;
not? Hahaha. Thanks! I'm a beginner, my Forth-fu betters every day, albeit slowly.
Buying anything from Captain Crunch makes you a legend
I'm a Forth beginner also. Forth is easy to learn, but harder to master.
"not" is part of my default dictionary, but ": invert 0= if 1 else 0 then ; " works perfectly. I mention it because Atlast has "not" in its default dictionary also
Oddly the Word "words" only lists part of the actual Wordlist, this is unusual however the "Atlast Primitives: Alphabetical Reference" in the 64 bit html has a complete list of Words, and it is extensive! The Word "WORDSUNUSED" does list all unused Words. These methods are foreign to me, but certainly not wrong, just different to what I'm used to.
To check if a "not" Word is available: the number returned is the memory location of the Word itself
-> ' not .
34378764744 -> words
This fails because there is no such word as xanadu
-> ' xanadu .
'XANADU' undefined
Atlast includes these cool packages: The REAL package. Enables floating point operations. Primitives: (FLIT), F+, F-, F*, F/, FMIN, FMAX, FNEGATE, FABS, F=, F<>, F>, F<, F>=, F<=, F., FLOAT, FIX.
The SHORTCUTA package. Enables shortcut integer arithmetic operations. Primitives: 1+, 2+, 1-, 2-, 2*, 2/.
The SHORTCUTC package. Enables shortcut integer comparison operations. Primitives: 0=, 0<>, 0<, 0>.
The STRING package. Enables string operations. Primitives: (STRLIT), STRING, STRCPY, S!, STRCAT, S+, STRLEN, STRCMP, STRCHAR, SUBSTR, COMPARE, STRFORM, STRINT, STRREAL. If the REAL package is also enabled, the FSTRFORM primitive is available, as well.
The SYSTEM package. Enables submission of commands in strings to the operating system for execution. This package may be enabled only if the implementation of C used to build Atlast provides the system() function. Primitives: SYSTEM.
The TRACE package. Enables runtime word execution trace. Primitives: TRACE.
The WALKBACK package. Enables the walkback through nested invocation of words when an error is detected at runtime. Primitives: WALKBACK.
The WORDSUSED package. Enables the collection of information on which words are used and not used by a program, and the primitives that list words used and words not used. This facility allows you to determine, in the development phase of an Atlast application, which packages are needed and which can be safely dispensed with. Primitives: WORDSUSED, WORDSUNUSED.
I'm very impressed, I may consider using Atlast on this PC for some X86 programs.