Hi,
I looked at the implementation of cond and case, and I saw the
define-transform and "no-compile" word property. How is it different
from the MACRO: construction ? Is user code supposed to use it at all
?

The context was that I wanted to have a word that randomly execute
quotations, for example
{
   { 0.2 [ do-something ] }
   { 0.1 [ something-else ] }
   [ foo ]
} pcase
would execute the first quot with 0.2 probability, the second with 0.1
probability and the third as a default (so 0.7 probability)

Both solutions use a pcase>quot word (like cond and case) and then one
uses MACRO: and the other uses define-transform. Both seem to work
fine...

Also, maybe this combinator (and others) could ship with factor in
extra/random/combinators ? I'm thinking of a variant where the
probabilities are conditionnal (ie in the previous example, the first
quotation would execute with 0.2 probability, then the second with
0.1, which makes an overall (1-0.2)*0.1 probability, and so on..).
Also, variants of if, when and unless that take a probability instead
of taking a boolean.

What do you think ?
Jon

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to