Files @ 3ffeb97c88a7
Branch filter:

Location: CSY/reowolf/testdata/parser/positive/16.pdl

MH
Add docs for implementing infinite types in a value based language.

Since we are a value based language and do not have the concept of
pointers, then if we want to lay out the memory of datatypes we run
into a problem when the types represent recursive datastructures:
these are infinite in size. So we have an algorithm for turning
some types into pointer-like things, such that we can lay everything
out in memory.
#version 100

composite main() {
	channel xo -> xi;
	new a(xi);
	new c(xo);
}

primitive a(in x) {
	synchronous {
		msg m = get(x);
		assert m.length == 5;
		assert m[0] == 'h';
		assert m[1] == 'e';
		assert m[2] == 'l';
		assert m[3] == 'l';
		assert m[4] == 'o';
	}
}

primitive b(out x) {
	synchronous (msg m) {
		put(x, m);
	}
}
// or
primitive c(out x) {
	synchronous {
		msg m = create(5);
		m[0] = 'h';
		m[1] = 'e';
		m[2] = 'l';
		m[3] = 'l';
		m[4] = 'o';
		put(x, m);
	}
}