I like this ALLOT!

6 views
Skip to first unread message

The Beez

unread,
Jan 21, 2026, 8:06:08 AMJan 21
to 4tH-compiler
Hi 4tH-ers!

You probably know by now that ALLOT is not supported by 4tH. Of course, there is a thing like ARRAY and STRING - but that's not the same. Until now.

I've added a small preprocessor library that can translate things like this:

create alpha 12 /half + cells allot
create beta  16 K * chars allot
create gamma 32 floats allot

To this:

12 /half + array alpha
16 K * string beta
32 floats array gamma

Which is kind of cool if you want or need full or close to full ANS-Forth syntax compatibility. Note you have to declare a type like CELLS, CHARS or FLOATS in order to make this work. Also, note that declarations like this are NOT supported by this library:

create (mag01) 0 , 0ebfd028 +UL , does> swap cells + @c ;

For those use the alias TABLE : TABLE CREATE ;

Still, I think this can be very useful in certain circumstances. Other types might be added, or may be I'll make something more general for these ones.

Code in SVN.

Hans Bezemer
Reply all
Reply to author
Forward
0 new messages