SPWN (0.8 beta)
Pre-release
Pre-release
0.8: The "a bit of everything" update
Breaking Changes
- Keyword
switch
is nowmatch
- Keyword
case
is removed (in favor of==
patterns) - Unary
..
operator is no longer allowed (for example..10
now needs to be written as0..10
) - The
has
operator has been replaced within
(with the order flipped)
New Features
- Return types for macros with
(arguments) -> return_type { ... }
syntax - You can spread an array in another array with
..
syntax: spwn eval
subcommand for running code in the console
b = [3, 4]
$.assert([1, 2, ..b, 5] == [1, 2, 3, 4, 5])
- Unzip arrays with
*[...]
syntax:
a = [1, "a"]
b = [2, "b"]
c = [3, "c"]
$.assert([*[a, b, c]] == [[1, 2, 3], ["a", "b", "c"]])
- Destructuring additions, including dictionary destruction, and destruction of the syntax mentioned above (
..
and*[...]
) - Big expansion to the pattern system:
is
operator for matching any value to a pattern (10 is @number // true
)- using most boolean operators as unary operators now yield a pattern:
==val
will match any value that equalsval
!=val
will match any value that does not equalval
>val
will match any value that is greater thanval
<val
will match any value that is less thanval
>=val
will match any value that is greater than or equal toval
<=val
will match any value that is less than or equal toval
in val
will match any value that is inval
&
operator for combining two patterns, so that the resulting pattern requires the value to match both patterns_
pattern, which matches any value (wildcard)- pattern ternary operator, which returns a value if it matches a pattern, and otherwise returns the default value:
10 if is >5 else 0 // 10 4 if is >5 else 0 // 0
- You can now remove stuff from dictionaries with
dict.delete(key)
STD Library Features
@chroma
type for color values, this type is now used in for example color triggers instead of RGB argumentslevel
global variable for reading the objects in the current level@log
and@runtime_log
types for debug logging to the console or at runtime@set
type for making groups of objects read from the level that can be rotated, scaled, and pasted in the level- Changes and improvements to many existing types (see the docs)
New Contributors
- @DexterHill0 made their first contribution in #146
- @Fl1pNatic made their first contribution in #154
Full Changelog: v0.7-beta...v0.8-beta
To install, download and run the appropriate installer (from the "Assets" dropdown below):
spwn-0.0.7-x86_64_win2.msi
for windows 64 bit
spwn-0.0.7-x86_32_win2.msi
for windows 32 bit
spwn-0.0.8-x86_64-linux_arch.pkg.tar.zst
for arch linux
spwn-0.0.8-x86_64.tar.gz
for linux (tarball)
spwn-0.8_beta.pkg
for MacOS
(Installers for more platforms coming soon)