Recursion
Kye
Posts: 2,200
Can the propeller chip do this? I mean it has a stack, so...
I'm thinking not from hints I've gathered but does anyone have the definitive word.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I'm thinking not from hints I've gathered but does anyone have the definitive word.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Comments
And to be honest, I'd never use recursion on a limited system like the propeller. You can always change recursive code to be iterative.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I've used it a few times, the Spin interpreter gets it correct as always but the
stack limits your function recursion level.
Scott
the propeller does not provide a hardware stack. We have a very RISCy machine. For recursion in assembler you have to implement it in software. Recursion in compiled code depends on the compiler - does it implement the stack or not? (Yes, I'm told that the C-compiler does.) Recursion in interpreted code depends on the interpreter. Here you need an explicit stack data structure anyway. Yes, SPIN provides it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys