I'm looking for a way to make Jalv2-like pseudo variables in C using the C18 compiler. A pseudo variable is something that acts like a variable but actually is a function.
In Jalv2, it's possible to make a pseudo variable like this:
function the_var'get() return byte is
-- some code
end function
procedure the_var'set(byte in value) is
-- some code
end procedure
Now one can read and write to the_var
, while actually those functions are executed:
the_var = 0x40 -- actually executes the_var'set(0x40)
doSomething(the_var) -- actually executes doSomething(the_var'get)
Is there something similar for C?