Skip to content

Set set range directly on set_a := set_a + [b .. c].

set_a := set_a + [b .. c] (where b or c aren’t both constants) compiles into fpc_varset_set_range + fpc_varset_add_sets.

var
	s: set of byte;
	r, i: int32;

begin
	s := [1 .. 2];
	r := 6 + random(0);
	s := s + [5 .. r]; // generates fpc_varset_set_range to get [5 .. r], and fpc_varset_add_sets to add it to 's'.
	for i in s do write(i, ' ');
end.

It could directly use fpc_varset_set_range.

Edited by Rika
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information