rzimmerman / kal

A powerful, easy-to-use, and easy-to-read programming language for the future.
http://rzimmerman.github.io/kal
MIT License
394 stars 18 forks source link

dynamic delete problem #125

Open dijs opened 11 years ago

dijs commented 11 years ago

Cannot delete using dynamic property key...

For example:

x = {a:0, b:1, c:2}
t = 'a'
delete property t from x

You see the problem?

We need a way of deleting with dynamic keys.

Pomax commented 11 years ago

Salient detail: the "delete" operation forces JIT compilers to completely redo their type trees in most modern browsers. This construction, once translated to native JS, is going to wreck performance.

dijs commented 11 years ago

So, should we just learn to use JS without using the delete operation?

Pomax commented 11 years ago

Pretty much. There isn't really any solid use case for ever using the delete operator. For each use case you might consider it in, there is generally a better solution that doesn't involve using it.