Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: More dialects than you think, validating function input.

From: brett:codeconscious at: 12-Sep-2002 23:32

Hi Ladislav, I was less than clear. The kount stuff was to simulate "other processing". The value needs to be set for processing and to report the type in the error message. My mistake for over simplifying the examples, and for stuffing them up. Here is the actual function I was working on: bayes: function [ {Calculate combined probability.} [catch] probabilities [any-block!] ] [p0 p1 d] [ p0: p1: 1.0 if not parse probabilities [ any [ set value number! (p0: value * p0 p1: 1 - value * p1) | set value any-type! to end skip ] ] [throw make error! reduce ['script 'cannot-use 'bayes mold type? get/any 'value]] if zero? d: add p0 p1 [throw make error! "The probabilities cannot be combined."] divide p0 d ] Sorry for the confusion. Brett.