Computer Science Canada record syntax. |
Author: | Justin_ [ Wed Jan 18, 2006 6:43 pm ] | ||
Post subject: | record syntax. | ||
Hi, is there anything wrong with this code:
it says syntax error at "flexible" |
Author: | Cervantes [ Wed Jan 18, 2006 6:54 pm ] |
Post subject: | |
Sadly, Turing can't handle flexible arrays within records. It's one of Turing's biggest problems, in my opinion. The best you can do is declare a big hoinking static array ( ![]() |
Author: | Justin_ [ Wed Jan 18, 2006 8:31 pm ] |
Post subject: | |
how unfortunate ![]() |
Author: | Tony [ Thu Jan 19, 2006 12:01 pm ] |
Post subject: | |
Cervantes wrote: Sadly, Turing can't handle flexible arrays within records. It's one of Turing's biggest problems, in my opinion.
How would you go about implementing it? Suddenly you'll have a record type of arbitrary length. There will be a whole bunch of problems with reserving a correct amount of space and then adjusting it on per-record basis. If you are dealing with a lot of data and do want to have it stored in a flexible array, you could declear it outside of the record definition, and point to it from within the record. |
Author: | MysticVegeta [ Thu Jan 19, 2006 12:41 pm ] |
Post subject: | |
Well what you could have is a record inside a record. |
Author: | codemage [ Thu Jan 19, 2006 1:41 pm ] |
Post subject: | |
Why jump through so many hoops to use a special Turing shortcut? Flexible arrays are just a Turing-specific training-wheels-enabled version of dynamic lists. |