Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or you could be obnoxious and use the syntax that made its way into the EcmaScript standard: 10_000


Nice to see some Perl lineage popping up in JavaScript.


I think the syntax in JS actually allows putting them at arbitrary points, e.g. 1_00_0 or 10_00 (both being identical to 1000).


Same as Perl


Is that where Ruby took it from?


No, they both got it from Common Lisp (ca 1984)


Is that a Common Lisp thing or something that predates the ANSI standard? SBCL doesn't like that syntax:

  * 10_000
  
  debugger invoked on a UNBOUND-VARIABLE: The variable |10_000| is unbound.
According to the Common Lisp HyperSpec, "_" is an alphabetic constituent character:

http://www.lispworks.com/documentation/HyperSpec/Body/02_ad....

http://www.lispworks.com/documentation/HyperSpec/Body/02_adb...


Rather, perhaps, Ada 83.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: