Skip to content

Support struct splatting #297

@tjpalmer

Description

@tjpalmer

We need struct splatting for making variations on imu data. See below for examples of how it works in js vs doesn't yet in temper.

Temper:

$ class A(public a: Int, public b: Int) {}
interactive#4: A__0
$ { a: 1, b: 2 }
interactive#5: {class: A__0, a: 1, b: 2}
$ { a: 1, ...{ a: 2, b: 3 } }
1: { a: 1, ...{ a: 2, b: 3 } }
   ┗━━━━━━━━━━━━━━━━━━━━━━━━━┛
[interactive#6:1+0-27]@P: Expected a TopLevel here
Interpretation ended due to runtime panic
interactive#6: fail

vs JS:

> { a: 1, ...{ a: 2, b: 3 } }
{ a: 2, b: 3 }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions