Native complex numbers



any idea to implement native complex numbers in uLisp?
I suppose the standard syntax #C(0 1) (i.e. imaginary unit) should be quite ok with the existing parser (I was thinking about the reader macros and change of base part of source code).

I’m still trying to understand the parsing, I’m not so experienced C programmer, so maybe if it’s something not feasible, sorry for that.

What do you think?



Have a look at this application, which shows one way of doing it:

Fast Fourier Transform


I’d guess there is C-level support for complex numbers on the higher end of what uLisp works on.

I don’t think libc-avr has any, though.

In any case, I think supporting complex numbers as thoroughly as Common Lisp does is what they call “non-trivial”, especially on the machines uLisp targets.


This is a very nice example, and it’s working perfectly.
Anyway, having them as native type can be useful for the performance with all the related operations.