RosettaCodeData/Task/Naming-conventions/Forth/naming-conventions-2.fth
2023-07-01 13:44:08 -04:00

10 lines
412 B
Forth

\ buffer is a word that creates a named memory space and ends in a ':'
: buffer: ( bytes -- ) create allot ;
hex 100 buffer: mybuffer \ buffer: creates a new WORD in the dictionary call mybuff
\ if object programming extensions are added to Forth they could look like this
class: myclass <super integer
m: get @ ;m \ create the methods with m: ;m
m: put ! ;m
m: clear 0 swap ! ;m
;class