nsensfel / tonkadur

Narrative scripting/programming tool. Write stories in your favorite editor using a feature-rich language, compile them into a very small and simple language to easily integrate them into your game.
https://tonkadur.of.tacticians.online
Apache License 2.0
3 stars 0 forks source link

Memory allocation should be an instruction #18

Closed nsensfel closed 3 years ago

nsensfel commented 3 years ago

The (new [TYPE]) computation is currently listed as an exception to the rule of computations not modifying the memory. This is a terrible idea and can easily lead to memory being allocated without the user realizing it.

A new instruction, (allocate [POINTER]) should be introduced instead. The type of memory element should be deduced from the type of [POINTER].

nsensfel commented 3 years ago

Implemented in https://github.com/nsensfel/tonkadur/commit/6b224c3d53920effdc8cff5846cfc49b4a358a19