GPTScript / AiScript

A Minimal, Full-Stack, Tool-Assisted Language. Native to Browsers and Bun. Strictly & Strongly-Typed.
https://github.com/GPTScript/AiScript
Mozilla Public License 2.0
9 stars 1 forks source link

No mixing implicit and explicit object structuring #20

Open coolaj86 opened 2 years ago

coolaj86 commented 2 years ago

I believe both Go and Rust behave this way - you have to pick a side (either positional arguments, or named keys).

Bad Example

doStuff({
  name: myName,
  age,
  shoe_size: shoeSize,
})

Good Examples

doStuff({
  name: myName,
  age: age,
  shoe_size: shoeSize,
})
let name = myName;
let shoe_size = shoeSize;
doStuff({
  name,
  age,
  shoe_size,
})