Structures
- Posted by MAP <ddhinc at ALA.NET> Mar 04, 1998
- 530 views
I have no doubt this has been covered in previous discussions here, but I'm fairly new to Euphoria and wonder if someone might labor over it again with me. Why doesn't Euphoria explicitly provide a C-like structure? Granted, structures aren't as flexible as sequences, they can't be reshaped at will, but in many cases they don't need to be (and would be safer by now being allowed to). I like Euphoria for it's easy readability, and it's clean form that allows you to accomplish much more, much more quickly, than programming an equivilant in C. I think though that where structures are concerned Euphoria falls down a bit. Implementing them as sequences puts the burden on the programmer to design design it well and access it in a readable form, which can often be more of a bother than C's approach. Also, with the new Win32 platform, porting the interfaces to the DLL's is rather complex as well. A special type of struct dedicated to C-style linkages would be of great benifit. i.e. something like this: C_STRUCT My_Structure{ C_INT value1 C_INT value2 some_other_struct structure2 } Allowing you to create a varaible that would automatically allocate memory for, and point to, this structure that's in a form readily passable to your external functions. I think this, as well structures dedicated to euphorias native types, would improve Euphoria alot; Making programs more readable and easier to implement. Christopher D. Hickman