In article <
0de13463afd27f9e6b5693952ccd30dc@www.novabbs.com>,
minforth <
minforth@gmx.net> wrote:
I also use an array stack, with some syntactic sugar:
MinForth 3.6 (32 bit) (fp matrix)
# m[ 10 20 30 40 50 60 70 80 90 ] ok
M: <1> | # m.
[ 10 20 30 40 50 60 70 80 90 ] ok
M: <1> | # ' f+ mreduce ok
M: <1> | f: 450 | # mnumel s>f f/ ok
M: <1> | f: 50 | # ok \ <- average
# mdrop fdrop linspace[ -0.4 +0.4 9 ] ok
M: <1> | # m.
[ -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 ] ok
M: <1> | # ' fsin mmap mtrans m. ok
[ -0.389418
-0.29552
-0.198669
-0.0998334
0
0.0998334
0.198669
0.29552
0.389418 ] ok
M: <2> | #
An array stack, a string stack ...
Honestly I think for these it is preferred to use a heap aka ALLOCATE.
Maybe it is a hassle to FREE them but that at least give more
flexibility. And then there is the possibility of having sloppy
garbage collectors, the once that inspect each possible pointer to
heap space and if they are pointing in heap space, keep the item just in case.
Addition of those is valuable for a host of other things.
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat purring. - the Wise from Antrim -
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)