Computer Science Canada How to access a member variable of a record type in a module |
Author: | davidkazuhiro [ Wed Sep 23, 2009 11:55 am ] | ||
Post subject: | How to access a member variable of a record type in a module | ||
What is it you are trying to achieve? My immediate goal is to figure out how to use my "value" record type in my "complex" module. Ultimately I am trying to write a program which calculates the side lengths and angles of a triangle on the complex plane. If turing has libraries for complex arithmetic which I'm unaware of, please give me a heads up! What is the problem you are having? When I try to get x.realPt, I get a "'x' cannot be followed by a '.'" error. Describe what you have tried to solve this problem I tried all sorts of minor syntax changes and exporting value.realPt etc. This is my first time using Turing =P Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1a |
Author: | DemonWasp [ Wed Sep 23, 2009 1:56 pm ] |
Post subject: | RE:How to access a member variable of a record type in a module |
I can't explain why, but removing the "opaque" from your export line resolves the issue. I blame Turing's probably-buggy implementation, because as near as I can tell, your code should work fine as-is. |
Author: | davidkazuhiro [ Wed Sep 23, 2009 3:02 pm ] |
Post subject: | RE:How to access a member variable of a record type in a module |
weird... you're right. thanks! |