Careful when Construct an object

Started by Endo on 5-Jul-2010/18:45:50-7:00
When you construct an object don't forget to use true/false for logic! values instead of using yes/no/on/off. >> o: context [b: true] >> ? o/b O/B is a logic of value: true >> o: context [b: yes] >> ? o/b O/B is a logic of value: true >> o: construct [b: true] >> ? o/b O/B is a logic of value: true >> o: construct [b: yes] >> ? o/b O/B is a WORD of value: yes So, is this the only way to determine Yes is a word which has a value of logic true?
I usually mold/all for such things... o: construct [ a: true b: yes c: on ] >> print mold/all o #[object! [ a: #[true] b: yes c: #[true] ]]
Endo I think this is a bug as it is different in R3 when all are evaluated. I've posted a bug report to Rambo, the R2 bug database
I wrote this function: f: func ['w] [type? get in construct compose [t: (:w)] 't] here is the results: >> f f == word! >> f :f == function! >> f print == word! >> f :print == native! >> f 5 == integer! >> f yes == word! >> f true == logic!
@Graham: I didn't know that. I tried that function on R3 and yes, it behaves different: >> f yes == logic! >> f true == logic!

Reply