[OpenBIOS] OpenBIOS Array implementation
Segher Boessenkool
segher at kernel.crashing.org
Fri Sep 14 22:58:04 CEST 2012
> You commented on my local variable code a while back. I have remade
> the Array implementation it uses. Let me know what you think.
>
> \ ****** new version *********
> : ARRAY ( cellCount -- )
>
> \ Compile-time behavior
> CREATE CELLS ALLOT ( cellCount -- ) \ Creates and
> initializes the instance
>
> \ Run-time behavior
> DOES> ( index addr )
>
> SWAP CELLS + ( index addr -- addr1 ) \ Calculates
> address to return
> ;
The code is just fine. The comments are useless. In general,
I find such an "array" abstraction more than useless as well
(it tends to be over-used, making the program less clear instead
of more).
Segher
More information about the OpenBIOS
mailing list