Darklang Release 9 contains all the changes from December 2022. You can read more about the changes listed below in the Changelog, and check out our d

Darklang Release 9

submited by
Style Pass
2023-01-27 16:30:06

Darklang Release 9 contains all the changes from December 2022. You can read more about the changes listed below in the Changelog, and check out our discussion and next month's planning on Youtube.

The big win for users is the new short-circuiting && and || operators. Darklang previously used functions for || and &&, which meant that both expressions were always evaluated. For example: if false && fireTheMissiles would have fired the missiles, and you can now avoid that unfortunate outcome.

Like all things in Dark, this change is backward-compatible. Old uses of the || and && function calls still work as they did before (as does copy-pasted code, calls to existing functions, etc), but are marked as deprecated. A built-in command called convert-to-short-circuiting can be used to automatically convert the old version to the new version.

New uses of || and && will use the short-circuiting versions by default. If you prefer the old version, you can call Bool::and and Bool::or directly.

Leave a Comment