Doug Coleman <[email protected]> wrote: > In your book, you state that you know about the */ word in Forth, > allowing you to quickly solve the resistor problem. Why not go the > whole hog and ship a new word in every Forth implementation: > : *+/ ( x y -- z ) 2dup + */ ;
Doug, I see your purpose and appreciate it; I think you explained well why Factor separates data flow from operators. However, Forth's */ operator has one additional purpose; it's really merely to be able to avoid typing a space between star and slash. It's actually a scaling operator which uses a double-length intermediate result, so that as long as your final answer fits into a single-length integer, there will be no overflow. In Forth, at that time, that's a very significant guarantee. Factor doesn't need that; it has other ways to avoid integer overflow. -Wm ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
