Bylx666 / key-lang

目标是最精致的编程语言
https://docs.subkey.top
Mozilla Public License 2.0
111 stars 4 forks source link

语法支持:移动值到属性中 #4

Closed XYZboom closed 6 months ago

XYZboom commented 6 months ago

期望以下的功能:

let a = {};
let c = {};
c.a = 1;
a.x = c;
// 期望一个将c移动到a.x中的功能,不是复制
XYZboom commented 6 months ago

准确来说,这个功能更期望是,将值移动到需要的变量中去

Bylx666 commented 6 months ago

使用take函数:

let a = {};
let c = {};
c.a = 1;
a.x = take(c);
log(a,c)