14 lines
484 B
Text
14 lines
484 B
Text
without js -- (no class under p2js)
|
|
class test
|
|
private string msg = "this is a test"
|
|
procedure show() ?this.msg end procedure
|
|
end class
|
|
test t = new()
|
|
t.show()
|
|
--?t.msg -- illegal
|
|
--t.msg = "this is broken" -- illegal
|
|
include builtins\structs.e as structs
|
|
constant ctx = test -- magic/context
|
|
?structs:fetch_field(t,"msg",ctx)&" (with some magic)"
|
|
structs:store_field(t,"msg","this breaks privacy",ctx)
|
|
t.show()
|