On Sep 17, 2009, at 11:53 AM, Paul Moore wrote: > The background is that I'm playing with ideas around game simulation > programs, where die rolls are a common need. I can obviously write a > word dieroll ( n m -- roll ) to roll n m-sided dice and produce a > result - but where n and m are literals (as they often are) the usual > syntax is nDm (for example, 3D6) and it'd be nice to be able to > express that directly in Factor.
The way to do this is to define a syntax word prefix, so your literals would look something like "ROLL: 3D6". Your "ROLL:" syntax word can then read whatever syntax it wants from the incoming source code stream. -Joe ------------------------------------------------------------------------------ Come build with us! The BlackBerry® 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/devconf _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
