EuRec library for record support in Euphoria, by Adam Weeden.

Use for EuRec:
Define a constant sequence to represent your record description.

Example:
If the record is defined as
	record
		integer x
		atom y
		sequence name (fixed length of 50)
	end record
Then define your constant as

constant recsize = {INT, ATOM, {SEQ, 50}}

Then declare your type as

type mytype(object o)
	return check_rec(recsize, o)
end type

Then whenever you declare an instance of your record assign it an empty value with get_empty

mytype inst

inst = get_empty(recsize)

At this point you can use it just like any other user defined type.

inst[1] = 100
inst[2] = 1.56
inst[3] = "Euphoria"

Use for a CRec:
Define a constant sequence to represent your record description.

Exxample:
If the record is defined as
   record
      unsigned integer x
      long y
      double = mypi
   end record
Then define your constant as

constant crecsize = {CUINT, CLONG, CDOUBLE}

Then declare an atom to represent your record

atom mycrec

Then use resolve to change a value

err = resolve(crecsize, mycrec, 1, 2400)
if err != 1 then
   ? "Error!"
   abort(err)
end if

Then use receive to get your value

val = receive(crecsize, mycrec, 1)

val will now hold value of what you had in the first position of your crec!

In future versions I will be adding the ability to convert from a EuRec to a CRec.