I was playing around with stochastic programming, by which I mean programs that have randomly chosen flow control. The MAYBE branch would randomly be taken or not depending on an underlying statistical event.
Thus the MAYBE branch would be taken say 50% of the times when one entered the branching construct. Since everything in Forth is a WORD i.e. a named subroutine that is passed variables on the parameter stack, including the control constructs, which compile run time routines that look at flags on the stack, it is not difficult to create new or modify the existing control structures. This is great for exploring things like fuzzy logic. One writes a little language that is seamlessly embedded in Forth and which implements the fuzzy constructs. Easy to do; takes only a few lines of code. BobLQ On 1/9/07, Steven E. Harris <[EMAIL PROTECTED]> wrote:
Bob La Quey <[EMAIL PROTECTED]> writes: > One of my favorite syntactical constructs was the > > IF > MAYBE > THEN > > which is really simple to implement in Forth. Can you elaborate, especially on the MAYBE part? What does it do? -- Steven E. Harris -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
-- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
