Ops, [type? get first reduce [to-word codice-temp]] should be: (type? get first reduce [to-word codice-temp])
Now seems to be solved.
GiuseppeC
Following your code
codice-temp: "C001" do reduce [to-set-word codice-temp copy []]
how do I check dynamically if the series C001 has been created ?
I have tried this > type? get first [codice-temp] == string!
But as you see it does not work
sqlab
type? get to-word codice-temp
sqlab
better to use
do reduce [to-set-word codice-temp 'copy []] or you will
always produce two copies
sorry I just have an non ergonomic keyboard so do reduce [to-set-word codice-temp 'copy []] type? get to-word codice-temp
GiuseppeC
Thanks, I am exploring dynamic table view creations with my small REBOL knowledge
sqlab
a shorter solution is set to-word codice-temp copy []
PeterWood
Is this method of providing "private" words in objects reliable?
>> a: make object! [ b: 1 set-b: func[v] [b: v] get-b: func[][b]] >> o: make object! [set-b: get in a 'set-b get-b: get in a 'get-b] >> unset 'a >> o/get-b == 1 >> o/set-b 2 == 2 >> o/get-b == 2
Maxim
in R3 yes.. in R2 its almost impossible since you can always get a function's body.
but I prefer this pattern: >> o: get in context [ [ priv: 1 [ pub: context [ set-b: func[v] [priv: v] b: func[][get 'priv]] [ ] 'pub >> o/b == 1 >> o/set-b 2 == 2 >> o/b == 2 >> words-of o == [set-b b]