3 ms·
Are parameter types mandatory or do omitted types imply "any"? Do you support "let" (the example uses "var"?)
by dukoid 11y ago
Are parameter types mandatory or do omitted types imply "any"?
Do you support "let" (the example uses "var"?)
- constexpr 11y agoThere is no "any" type since ThinScript is an ahead-of-time compiled language and emulating dynamic types is a non-goal. Types are required and omitting them is a syntax error. Right now "let" is an alias for "var" and "var" behaves like "let".
- dukoid 11y agoWhat about implicit conversions to boolean? Is "if (1)" legal? Does "==" require equal types (or compatible types) on both sides?
- constexpr 11y agoRight now the only implicit conversions are null to nullable types and smaller integers to larger ones. There is no "===" right now and "==" requires equal types. I may consider aligning this more with JavaScript in the future. There's a live compiler demo at http://evanw.github.io/thinscript/ http://evanw.github.io/thinscript/ where you can try out all of this yourself :)