You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(breaking change) Non-abstract structs cannot be inherited anymore (abstract structs can), check the docs to know why. In many cases you can use modules instead.
(breaking change) Class variables are now initialized at the beginning of the program (before "main"), make sure to read the docs about class variables and main
(breaking change) Constants are now initialized at the beginning of the program (before "main"), make sure to read the docs about constants and main
(breaking change) When doing crystal program.cr arg1 arg2 arg3, arg1, arg2 and arg3 are considered arguments to pass to the program (not the compiler). Use crystal run program.cr arg1 ... to consider arg1 a file to include in the compilation.
(breaking change)Int#**(Int) now returns an integer, and raises if the argument is negative. Use a float base or exponent for negative exponents to work.
(breaking change)Slice#to_s and StaticArray#to_s now include their type name in the output
Support for FreeBSD and musl libc has landed (thanks @ysbaddaden)
The .crystal directory is now created at $HOME/cache/.crystal or $HOME/.crystal (or others similar), with a fallback to the current directory
crystal doc and crystal tool hierarchy are now much faster. Additionally, the hierarchy tool shows types for generic types, and doesn't show instantiations anymore (wasn't very useful)
! now does type filtering (for example you can do !x || x.bar, assuming x can be nil and the non-nil type responds to bar)
Named arguments can now match any argument, even if they don't have a default value. Make sure to read the docs
The as operator can now be written as a method: exp.as(Type) in addition to exp as Type. The old syntax will be removed in a few releases.
JSON::PullParser: added #read_raw to read a JSON value as a raw string (useful for delayed parsing). Also added String::RawConverter to be used with JSON.mapping.
JSON and YAML: enums, BigInt and BigFloat are now serializable
ENV: allow passing nil as a value to delete an environment variable
Hash: allow Array | Tuple arguments for #select, #select!, #reject and #reject!
Crypto::Subtle.constant_time_compare now returns Bool, and it can compare two strings in addition to two slices (thanks @skunkworker)
HTTP::Server: reset port zero after listening (thanks @splattael)
Added File#each_line iterator
Added Number.slice, Number.static_array, Slice.[] and StaticArray.[] to easily create slices and static arrays