logoalt Hacker News

halloletoday at 2:02 PM1 replyview on HN

> we write the color associated with a spectral distribution as C[S] where C is the function that takes a distribution and outputs the corresponding color.

Unrelated, but can anyone tell me the purpose of using the square bracket notation here, instead of the usual parentheses?


Replies

Sharlintoday at 2:50 PM

Square brackets are often used in contexts where the function is "higher-order" in some sense, with the type of the parameter itself being a function, distribution, or a similar object with richer structure. I think in this case C[S] is particularly supposed to evoke the expected-value notation E[X], because that's what C[S] essentially is – it gives the expected value of S if you interpret S as a random variable with that distribution.