home .. forth .. colorforth mail list archive ..

Re: [colorforth] Dare I say ANS!


On Thursday 15 January 2004 01:19 pm, Howerd Oakford wrote:
> I like for ... next , and can happily live without do ... loop, but
> why does i return 1 to n instead of 0 to n-1 ?
> I don't see how what i does affects the loop itself...

I think the reason is that Chuck is using the LOOP instruction to 
implement NEXT, which checks for ECX to be zero before conditionally 
branching.

Personally, I would check for sign after doing a DEC ECX instruction, 
which would get you your desired behavior.  But that's just me.  :)

> c@ is tricky. You seem to be saying that ANS got it wrong, so we
> should do it right ;)

ANSI is mostly consistent, fortunately.  Just don't use length-prefixed 
strings (unfortunately, WORD produces such a string as its result).

--
Samuel A. Falvo II


---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com