Wren v0.4.0 Release Notes
-
Language
- ➕ Add
continue
keyword - ➕ Add
as
:import "..." for Name as OtherName
- ➕ Add Support positive sign in scientific notation
- ➕ Add Fiber.try(value) to complement Fiber.call(value)
- 👍 Allow
.
to be on a different line (for fluent/builder APIs)
Modules
- Random: Random.sample optimizations
- List:
- add
list.sort()
andlist.sort {|a, b| ... }
(quicksort) - add
list.swap(index0, index1)
for swapping elements within a list - add
list.indexOf(value)
for finding values in a list
- add
- Num:
- add
Num.tau
- add
Num.nan
- add
Num.infinity
- add
min(other)
- add
max(other)
- add
clamp(min, max)
- add
exp
- add
log2
- add
🛠 Fixes
- 🛠 Fix stack corruption related to
Fn
calls - Fix a byte offset bug in CODE_IMPORT_VARIABLE
- 🛠 Fix some stack corruptions related to multiple wrenInterpret calls
- 🛠 Fixed crash when GC collects module during import
- 🛠 Fix
Bool
,Num
andNull
allowing subclassing, which is invalid
API
- 💥 BREAKING: Add
userData
towrenReallocateFn
- 💥 BREAKING: Add
WrenLoadModuleResult
which has aonComplete
callback, allowing freeing module strings - ➕ Add
wrenHasVariable
andwrenHasModule
queries, for use withwrenGetVariable
- ➕ Add
wrenSetListElement
to complementwrenGetListElement
, and allow negative index for both - ➕ Add Map functions to API
- wrenSetSlotNewMap
- wrenGetMapCount
- wrenGetMapContainsKey
- wrenGetMapValue
- wrenSetMapValue
- wrenRemoveMapValue
Other
- 🏗 build; add util/generate_docs.py for regenerating project files
- 🏁 vm; Allow computed goto when using clang on Windows
- vm; WREN_MAX_TEMP_ROOTS default is 8 (instead of 5)
- 🖨 vm; GC debug times are printed in milliseconds, not seconds
- ➕ Add