Satisfying number parameter requirements
Posted: Tue Sep 11, 2012 9:22 pm
I'm a bit puzzled by CF3's number parameter requirements. Why is the following forbidden
while the following is allowed?
I'd have thought that either both would be verboten (because rand is considered to modify its arguments) or both would be acceptable (because rand is considered not to modify its arguments). What gives?
— Scott
Code: Select all
startshape begin
shape circular (number radius) {
CIRCLE [ s radius ]
}
shape forbidden (number minrad, number maxrad) {
circular(rand(minrad, maxrad)) [ ]
}
shape begin {
forbidden(10, 20) [ ]
}
Code: Select all
Error in restrict.cfdg at line 8 - This expression does not satisfy the number parameter requirement
Code: Select all
startshape begin
shape circular (number radius) {
CIRCLE [ s radius ]
}
shape allowed (number minrad, number maxrad) {
circular(rand(maxrad)) [ ]
}
shape begin {
allowed(10, 20) [ ]
}
— Scott