Go to the first, previous, next, last section, table of contents.


Structs

Muq MUF offers the ability to define and use structs, but in the Muq context they make less sense than they do in the C context: Usually it makes more sense to use MUF classes than MUF structs: Muq structs essentially just offet a subset of the class functionality.

Here is a very sketchy overview. As always, see the MUF reference manual for more details. The ultimate reference is the 140-C-defstruct.t source implementing all this. It is less than 8K long and a good example of extending the MUF compiler without touching the core code.

root:
defstruct: Grunt 'name 'rank 'serialNumber ;
root:
[ :name "tom" :rank "private" :serialNumber 1 | ]makeGrunt
root: #<a Grunt 4d499a1b>
--> _tom
root:
_tom ls
:name	"tom"
:rank	"private"
:serialNumber	1
root: 
"dick" --> _tom.name
root:
_tom ls
:name	"dick"
:rank	"private"
:serialNumber	1
root:
_tom.name 
root: "dick"


Go to the first, previous, next, last section, table of contents.