a-a-maly / kumir2

New home for Kumir2.
GNU General Public License v2.0
21 stars 13 forks source link

Unable to get or modificate fields of types #20

Open NexSqaud opened 3 years ago

NexSqaud commented 3 years ago

There unable to get or modificate fields of embedded types. For example, complex numbers: Screenshot_2230 Error: "Name contains an invalid character"

a-a-maly commented 3 years ago

That is right, currently there is no support in Kumir for structure fields, neither for user-defined structures nor for internal ones. And the "Комплексные числа" type is very experimental. We can initialize a variable with "компл z = 5+3.7i", set a new value with "z := 13-6.8i", or get its parts via Re(z) and Im(z). But currently we can not modify the real or imaginary part separately. There probably should be some functions like SetRe(z, x) and SetIm(z, y). As well as functions to conjugate a number, to calculate its Euclidean norm and angle, and, ideally, all the good functions to work with complex numbers: trigonometric and hyperbolic (with inverses), gamma and its relatives, Bessel's and so on. But currently we implemented only a very limited subset.

By the way, we can see a Kumir crash if we write "Im(z) := 4.2" and leave that line. This bug should be of rather high priority.