EUPHORIA struct support

new topic     » topic index » view thread      » older message » newer message

Forked from C Struct Support

mattlewis said...

Now that 4.0 is out, it's time to start thinking about...4.1! In fact, there is a wiki page with a high level overview of what's being planned:

EuphoriaRoadmap

One of the items on that list is for support for dealing with C-style structures in memory (not to be confused with data structures of native euphoria objects). Anyone who has dealt with an external API has probably needed to deal with these, managing offsets and data formats, peeking and poking...The goal is to make all of this easier for the euphoria programmer.

Matt

That's going to be really useful for interfacing with C libraries and most of them are written in C. To write the same thing in EUPHORIA for sequences we have to create an enumerated list of constants. Wouldn't it be good to have something similar for sequences?

struct sequence person  
    integer magic 
    sequence name 
    sequence phone_numbers 
end struct 
 
person p1 
p1.magic = "Person" 
p1.name = "Matt Lewis" 
p1.phone_numbers = {} 
-- The following prints 
-- Person 
-- Matt Lewis 
-- 
for i = 1 to length(p1) do 
   ? p1[i] 
end for 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu