Hi Ladislav, you wrote, >Ciao, Gabriele, to the best of my knowledge, Ciao translates to something like goodbye. ;-) >- a nice idea. The problem here is that this approach is static, i.e. >non-re-entrant, because it uses only static storage for object parameter, >namely the code block of method, so your code wouldn't work for something >like this too: > >a: make object! [ > num: 1 > methods: make object! [ > sumnum: func [other number] [ > switch number [ > 1 [self/num] > 2 [ (do ! other sumnum self 1) + (do ! self sumnum other >1) ] > ] > ] > ] > ] Actually it works exactly as I would expect it to. What did you expect your expression >[ (do ! other sumnum self 1) + (do ! self sumnum other 1) ] would do? Could you explain? TIA, Elan
- [REBOL] Objects: Preventing Code Duplication Re:(8) lmecir
- [REBOL] Objects: Preventing Code Duplication Re:(9) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(10) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(11) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(11) lmecir
- [REBOL] Objects: Preventing Code Duplication Re:(10) lmecir
- [REBOL] Objects: Preventing Code Duplication Re:(11) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(12) lmecir
- [REBOL] Re: Objects: Preventing Code Duplication Re:(9) giesse
- [REBOL] Objects: Preventing Code Duplication Re:(11) lmecir
- [REBOL] Objects: Preventing Code Duplication Re:(13) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(13) lmecir
- [REBOL] Objects: Preventing Code Duplication Re:(14) icimjs
- [REBOL] Objects: Preventing Code Duplication Re:(13) giesse
- [REBOL] Objects: Preventing Code Duplication Re:(12) giesse
- [REBOL] Objects: Preventing Code Duplication Re:(11) icimjs
