On Thu, Nov 18, 2010 at 05:58:48AM -0600, Shaping wrote: > A word could be defined with the following stack effects and the behavior > would be the same: > > : foo ( a quot -- ) > > : foo ( apples bananas -- ) > > : foo ( !...@# @#$ -- )
Yes. > Likewise, with nested stack effect checking, the following are equivalent: > > : bar ( a quot: ( b -- ) -- ) > > : bar ( apples bananas: ( pears -- ) -- ) > > : bar ( !...@# @#$: ( #$% -- ) -- ) Yes. > The point of these examples seems to be that the tokens appearing in the > stack-effect syntax are truly arbitrary, but how then are the > stack-effects count- and type-binding? They're count-binding, but not type-binding. > Ignore for now the fact that you can declare nested effects. Take > the basic case. What if I really want word sum-of-integers to be > able to add only integers and not, say, floats?: Then I suggest you try some other language which has static typing. Miles -- Note that those are the bitwise OR (|) and AND (&) operators, not the more commonly used logical OR (||) and AND ( && ) operators. Getting the two mixed up can lead to hours of interesting debugging. -- Maciej Ceglowski ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
