Sujet : Re: Operator overloading?
De : minforth (at) *nospam* gmx.net (minforth)
Groupes : comp.lang.forthDate : 25. Jul 2024, 15:49:55
Autres entêtes
Organisation : novaBBS
Message-ID : <32b260f4dc1df7ae6f030a05b06b2387@www.novabbs.com>
References : 1 2 3 4
User-Agent : Rocksolid Light
On Thu, 25 Jul 2024 9:06:03 +0000, mhx wrote:
DO you mean something like the below? The code stays the
same but it is possible to choose a different type of
variable (from BYTE to arbitrary precision).
Thank you! Yes, something like that.
If I understand correctly, the intelligence is within LET
which decides which operator matches the type of the operands.
I have also dynamic vector and array types. And 24-bit floats..
The other discussion in the automatic differentiation thread
introduces dual fp-numbers, etc. Overall, working with many
different types would explode the number of type-dependent
operators. So it becomes a natural idea to smarten up the
compiler in this respect.