[M3devel] pointers/arrays?

Jay K jay.krell at cornell.edu
Mon Dec 27 05:37:07 CET 2010


I'm still wrestling with this. I have found a few options that work and they all have glaring problems.


VAR macho_header32_t_fields := ARRAY [0..6] OF field_t{
  field_t{ "magic", 0, 4, enum_table := EnumTable(macho_magic_names)},
...
  field_t{ "flags", 24, 4}};


1) I shouldn't have to give the size of the array.
2) I shouldn't have to copy the enum table to make it an indexable array.


Disappointing..


 - Jay


From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Mon, 27 Dec 2010 02:11:28 +0000
Subject: [M3devel] pointers/arrays?








a: UNTRACED REF T;
i: INTEGER;


a[i] ?
(a + i)^ ?


Or I'm really stuck with
LOOPEHOLE(a + i * BYTESIZE(a^), UNTRACED REF T)


Seems kind of stinky.
I've got some nice efficient readable safe-enough C and it doesn't seem to translate well easily efficiently to Modula-3.


 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101227/a49d44c6/attachment-0002.html>


More information about the M3devel mailing list