How to design a new data type like Complex

Yes, you can do this yourself. There’s no special parsing for im, so you can create your own notation L and C.

The best way to get started is probably looking at the source of complex. Try typing

jl> @edit complex(0, 1)

to see the source.

2 Likes