KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
422 stars 35 forks source link

Reserve more keywords in KCL #4486

Open jtran opened 3 days ago

jtran commented 3 days ago

Before 1.0, we'd like to reserve more keywords so that users don't use them as variable names.

This is the list that was proposed:

I think we should add to this list:

Should we consider others? Here's JavaScript's and Python's.

jtran commented 2 days ago

type is used for the keys of objects in the stdlib. For example, see ImportFormat, which is the options of the import() function. Our options:

  1. Disallow all keywords and types as object members and change all stdlib usage of type to kind, format, type_, or some other alternative.
  2. Allow all keywords and types as object members by changing the parser to accept keywords or types in object literals and in dot notation when accessing members
  3. Special-case type, specifically, to allow it, but not other keywords and types
  4. Never treat type as a keyword. I.e. the proposed change is not wanted.

My inclination is to not special-case things, keep things simple, and go with option 1.