Re: C Struct Support

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...

Arrays currently come in 3 different flavors. There are fixed size, null terminated, and unspecified size. These probably need to be shaken down a bit. I haven't really tackled slicing or assigning sequences to an array.

Matt

Are those structure definitions like types so that one can declare variables of those types and to transfert data from struct to sequence I expect a simple syntax like:

mem_struct numbers  
	integer(8) byte  
	integer(16) word  
	integer(32) dword  
	integer(64) longlong  
	atom(32) float  
	atom(64) double  
end mem_struct  
 
--numbers is a data type 
numbers a 
--  is not a data type 
atom a 
a=alloc(sizeof(numbers)) 
--or better 
atom a=alloc(numbers) 
-- and for transfert of data between sequence and structure 
a={32,65535,-128000,1386836683, 3.1416, 3.1e100} 
-- if length(sequence) < struct_member_count what append? zero trailing members? 
-- the inverse should be as simple as 
sequence  b=a 

jacques

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

Search



Quick Links

User menu

Not signed in.

Misc Menu