Re: [csswg-drafts] [css-values] random() function (#2826)

> While the CSSWG just decided #4688 that a direct equivalent of ECMA-262ʼs Math.random() function, which works on a range with static minimum 0.0 and maximum 1.0, was not appropriate for CSS,

That's not what we decided. I purposely omitted `random()` from the discussion about other math functions because *it's not a math function* - it's not a pure function of its arguments, but rather a stateful function that you need to carefully control the invocation of; that's trivial in a traditional eager language like JavaScript, somewhat harder in a lazy language like Haskell, and very complex in a declarative language like CSS.

I've already discussed earlier in the thread what my plans are for random(). At this point I'm inclined instead to first make sure that Houdini Custom Functions can control their evaluation carefully enough that they can create a full-powered random function themselves. Assuming that works out, I can revisit making a standardized version.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2826#issuecomment-578526176 using your GitHub account

Received on Sunday, 26 January 2020 17:53:07 UTC