ecmarkdown icon indicating copy to clipboard operation
ecmarkdown copied to clipboard

Are "values" semantically distinct from "code"?

Open domenic opened this issue 11 years ago • 2 comments

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-number-type makes the case that NaN is produced by the program expression NaN.

Is this distinction really useful? Or could we use NaN everywhere? (Similarly 0, +Infinity, TypeError, etc.)

If we wanted to prefer typographic compatibility with the existing document we could list a set of "code strings" that always get bolded instead of monospaced.

domenic avatar Sep 26 '14 14:09 domenic

Plan for now: keep the distinction - * for values, ` for code. Eventually, if possible we'll remove the distinction. Otherwise, we can consider a whitelist of strings like "+∞" that can be parsed as ECMAScript values when found inside of backticks.

bterlson avatar Sep 26 '14 16:09 bterlson

Program texts and spec values are certainly distinct concepts, and using different fonts for them helps the reader. For example, if you use monospace for both, 18.1.2 becomes "The value of NaN is NaN", which isn't very clear.

jmdyck avatar Apr 06 '15 04:04 jmdyck