4 Dec 2010 01:11
Re: Nested [IFDEF]s not working?
Am 02.12.2010 um 12:25 schrieb Mark Cave-Ayland: > Andreas Färber wrote: >> Hello, >> A construct like: >> [IFDEF] CONFIG_PPC >> [IFDEF] CONFIG_PPC64 >> 5 >> [ELSE] >> 4 >> [THEN] >> [ELSE] >> [IFDEF] CONFIG_SPARC64 >> 6 >> [ELSE] >> 3 >> [THEN] >> [THEN] >> has been seen to return, e.g., 4 3 according to the debug word. >> Is this nesting forbidden in Forth? Easily fixable? A better way to >> do this? I do want a final catch-all since returning no value would >> have unexpected results, and we currently do not have a define >> CONFIG_PPC32 so that a concatenation of independent [IFDEF]... >> [THEN]s wouldn't work. > > IIRC [IFDEF] [ELSE] and [THEN] are simply Forth words that swallow > the input unless the condition is met. > > I suspect it will be similar to the bbranch & friends Fcode > instructions whereby at compile time the current nested state is(Continue reading)
RSS Feed