doc/changelogs/pre-1.0.md
Enum.from_value? for flag enum with non Int32 base type. (#10303, thanks @straight-shoota)String.new with null pointer and bytesize 0. (#10308, thanks @asterite)Hash in Hash#dup and Hash#clone (reverts #9871). (#10331, thanks @straight-shoota)CRYSTAL_LOAD_DWARF=1. (#10326, thanks @bcardiff)** be right associative. (#9684, thanks @asterite)TypeNode#has_attribute? in favor of #annotation. (#9950, thanks @HertzDevil)%Q, %i, %w, and %x literals in macros. (#9811, thanks @toddsundsted)CRC32, Adler32 top-level. (#9530, thanks @bcardiff)Flate, Gzip, Zip, Zlib top-level. (#9529, thanks @bcardiff)with_color top-level method. (#9531, thanks @bcardiff)SemanticVersion parsing more strict. (#9868, thanks @hugopl)Tuple.new and NamedTuple.new. (#10047, thanks @HertzDevil)OptionParser to handle sub-commands with hyphen. (#9465, thanks @erdnaxeli)OptionParser to not call handler if value is given to none value handler. (#9603, thanks @MakeNowJust)def_equals compare first by reference. (#9650, thanks @waj)def ==(other) fallbacks. (#9571, thanks @MakeNowJust)OptionParser indentation of option descriptions. (#10183, thanks @wonderix)#hash to Log::Metadata, Path, SemanticVersion, Socket::Address, URI::Params, and UUID. (#10119, thanks @straight-shoota)case statements with exhaustive case/in. (#9656, thanks @Sija)Kernel mentions in docs. (#9549, thanks @toddsundsted)Object#dup. (#10053, thanks @straight-shoota)#[]= macro methods. (#10025, thanks @HertzDevil)Complex#exp, Complex#log, etc. to Math.exp, Math.log overloads. (#9739, thanks @cristian-lsdb)Int#times. (#9511, thanks @waj)sprintf for zero left padding a negative number. (#9725, thanks @asterite)BigInt#to_64 and BigInt#hash. (#10121, thanks @oprypin)BigDecimal#to_s for numbers between -1 and 0. (#9897, thanks @dukeraphaelng)Number#step. (#10130, #10295, thanks @straight-shoota, @bcardiff)Complex unary plus returns self. (#9719, thanks @asterite)Int#lcm and Int#gcd. (#9999, thanks @HertzDevil)Math::TAU. (#10179, thanks @j8r)&- x expressions. (#9947, thanks @HertzDevil)String#index not working well for broken UTF-8 sequences. (#9713, thanks @asterite)String: Don't materialize Regex match[0] if not needed. (#9615, thanks @asterite)String#rindex default offset for matching empty regex correctly. (#9690, thanks @MakeNowJust)String#delete_at methods. (#9398, thanks @asterite)null Pointer to String. (#9653, thanks @jgaskins)Regex#capture_count. (#9746, thanks @Sija)Regex::MatchData#[] overloading to Range. (#10076, thanks @MakeNowJust)String documentation. (#9987, thanks @Nicolab)Kernel.sprintf. (#10227, thanks @straight-shoota)Hash#reject!, Hash#select!, and Hash#compact! consistent with Array and return self. (#9904, thanks @caspiano)Hash#delete_if in favor of Hash#reject!, add Dequeue#reject! and Dequeue#select!. (#9878, thanks @caspiano)Set#delete to return Bool. (#9590, thanks @j8r)Enumerable#grep. (#9711, thanks @j8r)Hash#key_index . (#10016, thanks @asterite)StaticArray#[]=(value) in favor of StaticArray#fill. (#10027, thanks @HertzDevil)Set#{sub,super}set? to {sub,super}set_of?. (#10187, thanks @straight-shoota)Array#shift and Array#unshift. (#10081, thanks @asterite)Array#rotate optimization for small arrays. (#8516, thanks @wontruefree)Hash#dup and Hash#clone to return correct type for subclasses. (#9871, thanks @vlazar)Iterator#cons_pair return type. (#9788, thanks @asterite)Hash#merge block. (#9495, thanks @MakeNowJust)Range#step. (#10203, thanks @straight-shoota)Range#step delegate to begin.step and allow float based ranges to be stepped. (#10209, thanks @straight-shoota)Indexable#join with IO. (#10152, thanks @straight-shoota)Flatten for value-type iterators. (#10096, thanks @f-fr)Indexable.range_to_index_and_count to not raise IndexError. (#10191, thanks @straight-shoota)def_clone, Hash, Array, Dequeue. (#9800, thanks @asterite)BitArray#dup. (#9550, thanks @andremedeiros)Iterator#zip to take multiple Iterator arguments. (#9944, thanks @HertzDevil)Iterator#with_object(obj, &). (#9956, thanks @HertzDevil)BitArrays. (#10008, thanks @HertzDevil)Enumerable#sum(initial, &) docs. (#9860, thanks @jage)Array#unsafe_build. (#10092, thanks @straight-shoota)#sum and #product. (#10151, thanks @straight-shoota)combinations, permutations, etc., from Array to Indexable. (#10235, thanks @wonderix)Enumerable. (#10129, thanks @HertzDevil)Set#add in Set#add documentation. (#9441, thanks @hugopl)Hash#values_at docs. (#9955, thanks @j8r)JSON.mapping. (#9527, thanks @bcardiff)YAML.mapping. (#9526, thanks @bcardiff)Int64. (#10145, thanks @straight-shoota)infinity and NaN. (#9780, thanks @asterite)JSON::Serializable.use_json_discriminator macro. (#9222, thanks @voximity)YAML::Serializable.use_yaml_discriminator macro. (#10149, thanks @straight-shoota)JSON serialization to big number types. (#9898, #10054, thanks @dukeraphaelng, @Sija)JSON::Serializable and YAML::Serializable. (#9733, thanks @jgaskins)YAML::Field(converter) argument docs. (#9557, thanks @dscottboggs)content instead of value when inspect XML::Attribute. (#9592, thanks @asterite)JSON::PullParser#on_key yield self and return value. (#10028, thanks @straight-shoota)YAML/JSON Any#dig methods. (#9415, thanks @j8r)JSON::PullParser. (#9983, thanks @erdnaxeli)Time::Span.new variants. (#10051, thanks @Sija)Time::Span#duration, use Time::Span#abs. (#10144, thanks @straight-shoota)%Z time format directive. (#10141, thanks @straight-shoota)Time::Location#load. (#10140, thanks @straight-shoota)Time::Span arithmetic specs. (#10143, thanks @straight-shoota)File.size and FileInfo#size be Int64 instead of UInt64. (#10015, thanks @asterite)FileUtils.cp_r when destination is a directory. (#10180, thanks @wonderix)Dir.glob when readdir doesn't report file type. (#9877, thanks @straight-shoota)Path#stem. (#10037, thanks @straight-shoota)File#fsync, File#flock_exclusive, File#flock_shared, and File#flock_unlock methods to IO::FileDescriptor. (#9794, thanks @naqvis)IO#flush on builder finish methods. (#9321, thanks @straight-shoota)Path in MIME and File::Error APIs. (#10034, thanks @Blacksmoke16)FileUtils specs. (#9902, thanks @oprypin)HTTP::Params to URI::Params. (#10098, thanks @straight-shoota)URI#full_path to URI#request_target. (#10099, thanks @straight-shoota)URI::Params#[]= replaces all values. (#9605, thanks @asterite)HTTP::Server::Response#closed? to Bool. (#9489, thanks @straight-shoota)Socket#accept to obey read_timeout. (#9538, thanks @waj)Socket to allow datagram over unix sockets. (#9838, thanks @bcardiff)HTTP::Headers#== and HTTP::Headers#hash. (#10186, thanks @straight-shoota)HTTP::StaticFileHandler serve pre-gzipped content. (#9626, thanks @waj)Content-Encoding and Content-Length headers after decompression in HTTP::Client::Response. (#5212, thanks @maiha)HTTP::CompressHandler until content is written. (#9625, thanks @waj)HTTP::Client to work with any IO. (#9543, thanks @waj)HTTP::Server don't override content-length if already set. (#9726, thanks @asterite)URI::Params. (#9641, thanks @jgaskins)HTTP::Cookie::SameSite::None. (#9262, thanks @j8r)HTTP::Client logging and basic instrumentation. (#9756, thanks @bcardiff)HTTP::Request#hostname+ utils. (#10029, thanks @straight-shoota)URI#authority. (#10100, thanks @straight-shoota)Socket::IPAddress#private?. (#9517, thanks @jgillich)Socket::IpAddress a bit more type-friendly. (#9528, thanks @asterite)Encoding. (#9724, thanks @asterite)RemoteAddressType private alias. (#9777, thanks @bcardiff)HTTP::WebSocket. (#9761, #9778, thanks @ibraheemdev, @bcardiff)HTTP docs. (#9612, #9627, #9717, thanks @RX14, @asterite, @3n-k1)Logger. (#9525, thanks @bcardiff)Log::Entry initializer. (#9570, thanks @Sija)Log.setup. (#9497, #9559, thanks @caspiano, @jjlorenzo)"force-peer" verify_mode setup. (#9668, thanks @PhilAtWysdom)Digest and introduce Digest::MD5, Digest::SHA1, Digest::SHA256, Digest::SHA512 backed by openssl. (#9864, thanks @bcardiff)OpenSSL::SSL::Context#set_modern_ciphers and related methods to set ciphers and cipher suites in a more portable fashion. (#9814, #10298, thanks @bcardiff)OpenSSL::SSL::Context#security_level. (#9831, thanks @bcardiff)OpenSSL::digest add require for OpenSSL::Error. (#10173, thanks @wonderix)Channel#close returns true unless the channel was already closed. (#9443, thanks @waj)spawn macro. (#10234, thanks @HertzDevil)Process.find_executable to check the found path is executable and add Windows support. (#9365, thanks @oprypin)Process.parse_arguments and fix CRYSTAL_OPTS parsing. (#9518, thanks @MakeNowJust)IO::Error to Process methods. (#9894, thanks @straight-shoota)User/Group from_name?/from_id? as not found. (#10182, thanks @wonderix)SC_PAGESIZE constant on more platforms. (#9821, thanks @carlhoerberg)Exception::CallStack.print_frame and crash stacktraces. (#9792, #9852, thanks @bcardiff)MachO: Handle missing LC_UUID. (#9706, thanks @bcardiff)WeakRef to compile with -Dgc_none. (#9806, thanks @bcardiff)Crystal.main docs. (#9736, thanks @hugopl)CRYSTAL_LOAD_DWARF=0. (#10261, thanks @bcardiff)#inspect_with_backtrace. (#10086, thanks @straight-shoota)crystal spec CLI. (#9951, thanks @KevinSjoberg)--link-flags to be used. (#6243, thanks @bcardiff)spec --profile. (#10044, thanks @straight-shoota)at_exit. (#10106, thanks @straight-shoota)VaList and disable va_arg for AArch64. (#9422, thanks @jhass)select as an opening keyword in macros. (#9624, thanks @asterite)frame-pointer. (#9361, thanks @kubo39)__crystal_raise_overflow error more clear. (#9686, thanks @3n-k1)do end blocks inside parenthesis. (#10189, #10207, thanks @straight-shoota, @Sija)case/when. (#10274, thanks @asterite)Bool/Enum values. (#10194, thanks @HertzDevil)--mcpu native. (#10264, #10276, thanks @BlobCodes, @bcardiff)Process.run uses in compiler to handle exec failure. (#9893, #9911, #9913, thanks @straight-shoota, @bcardiff, @oprypin)Command#report_warnings to gracefully handle missing Compiler#program. (#9866, thanks @straight-shoota)Program#host_compiler. (#9920, thanks @straight-shoota)Crystal::Path#name_size implementation. (#9380, thanks @straight-shoota)call_error.cr. (#9376, thanks @straight-shoota)Crystal::Exception to Crystal::CodeError. (#10197, thanks @straight-shoota)check_single_def_error_message. (#10196, thanks @straight-shoota)a-b -c incorrectly parsed as a - (b - c). (#9652, #9884, thanks @asterite, @bcardiff)nil. (#9872, thanks @asterite)Pointer(T)#value= stricter for generic arguments. (#10224, thanks @asterite)def self./ and def self.%. (#9721, thanks @asterite)ASTNode#to_s for parenthesized expression in block. (#9629, thanks @MakeNowJust)typeof(@ivar). (#9723, thanks @asterite)expanded.transform self. (#9506, thanks @asterite)super as special only if it doesn't have a receiver (i.e.: allow super user defined methods). (#10011, thanks @asterite)previous_def and super. (#9834, thanks @asterite)offsetof support Tuples. (#10218, thanks @hugopl)foo:bar. (#9740, thanks @asterite)select when/else. (#10002, thanks @MakeNowJust)begin ... end. (#9741, thanks @MakeNowJust)"location" and "args_html" in doc JSON. (#10122, #10200, thanks @oprypin)"aliased_html" in doc JSON, make "aliased" field nullable. (#10117, thanks @oprypin)undef as a keyword, it's not. (#10216, thanks @rhysd)bin/crystal wrapper. (#9505, thanks @jhass)CRYSTAL_PATH in bin/crystal wrapper . (#9632, thanks @bcardiff)RedBlackTree sample to use an enum instead of symbols. (#10233, thanks @Sija)name: nightly in docs-versions.sh for HEAD. (#9915, thanks @straight-shoota)Hash#each type restriction to allow working with splats. (#9456, thanks @bcardiff)IO#write changes in 0.35.0 and let it return Nil. (#9469, thanks @bcardiff)Digest::Base block argument type restrictions. (#9500, thanks @straight-shoota)Log.context.set docs for hash based data. (#9470, thanks @bcardiff){foo: X, typeof: Y} type. (#9453, thanks @MakeNowJust)of key type. (#9458, thanks @MakeNowJust)case when be non-exhaustive, introduce case in as exhaustive. (#9258, #9045, thanks @asterite)->@ivar.foo and ->@@cvar.foo expressions. (#9268, thanks @MakeNowJust)+=, ||=, etc.) inside macros. (#9409, thanks @asterite)IO. (#9134, #9289, #9303, #9318, thanks @straight-shoota, @bcardiff, @oprypin)Enum#to_s for private enum. (#9126, thanks @straight-shoota)Benchmark::IPS::Entry to use UInt64 in bytes_per_op. (#9081, thanks @jhass)Experimental annotation and doc label. (#9244, thanks @bcardiff)OptionParser. (#9009, #9133, thanks @RX14, @Sija)NamedTuple#sorted_keys public. (#9263, thanks @waj)assert_responds_to macro. (#9085, thanks @bcardiff)parallel macro. (#9097, thanks @bcardiff)host_flag? macro method, not affected by cross-compilation. (#9049, thanks @oprypin).each and .each_with_index to various macro types. (#9120, thanks @Blacksmoke16)StringLiteral#titleize macro method. (#9269, thanks @MakeNowJust)TypeNode methods to check what "type" the node is. (#9270, thanks @Blacksmoke16)TypeNode.name(generic_args: false) for generic instances. (#9224, thanks @Blacksmoke16)Int#digits, reverse BigInt#digits result. (#9383, thanks @asterite)BigInt#factorial using GMP. (#9132, thanks @peheje)String#titleize. (#9204, thanks @hugopl)Regex#matches? and String#matches?. (#8989, thanks @MakeNowJust)IO overloads to various String case methods. (#9236, thanks @Blacksmoke16)Regex::MatchData. (#9010, thanks @MakeNowJust)String methods. (#8447, thanks @jan-zajic)Enumerable#first with fallback block. (#8999, thanks @MakeNowJust)Array#delete_at bug with negative start index. (#9399, thanks @asterite)Enumerable#{zip,zip?} when self is an Iterator. (#9330, thanks @mneumann)Range#each and Range#reverse_each work better with end/begin-less values. (#9325, thanks @asterite)Hash. (#8887, thanks @rdp)JSON.mapping and YAML.mapping. (#9272, thanks @straight-shoota)INI a module. (#9408, thanks @j8r)record macro and JSON::Serializable/YAML::Serializable regarding default values. (#9063, thanks @Blacksmoke16)XML.parse invalid mem access in multi-thread. (#9098, thanks @bcardiff, @asterite)XML::Node#content=. (#9300, thanks @straight-shoota)JSON and YAML serialization to Path. (#9156, thanks @straight-shoota)libyaml. (#9426, thanks @jhass)libxml2. (#9436, thanks @Blacksmoke16)File.utime precision from second to 100-nanosecond on Windows. (#9344, thanks @kubo)Flate, Gzip, Zip, Zlib to Compress. (#8886, thanks @bcardiff)File & FileUtils. (#9175, thanks @bcardiff)File#pos, File#seek and File#truncate over 2G on Windows. (#9015, thanks @kubo)File.rename to overwrite the destination file on Windows, like elsewhere. (#9038, thanks @oprypin)File's specs and related exception types on Windows. (#9037, thanks @oprypin)Path arguments to multiple methods. (#9153, thanks @straight-shoota)Path#each_part iterator. (#9138, thanks @straight-shoota)Path#relative_to. (#9169, thanks @straight-shoota)Path pattern to Dir.glob. (#9420, thanks @straight-shoota)File#fsync on Windows. (#9257, thanks @kubo)Path regarding empty and .. (#9137, thanks @straight-shoota)IO#skip, IO#write returns the number of bytes it skipped/written as Int64. (#9233, #9363, thanks @bcardiff)HTTP::Server. (#9115, #9034, thanks @waj, @straight-shoota)HTTP::Request#remote_address type to Socket::Address?. (#9210, thanks @waj)flush methods to always flush underlying IO. (#9320, thanks @straight-shoota)HTTP::Server sporadic failure in SSL handshake. (#9177, thanks @waj)WebSocket shouldn't reply with same close code. (#9313, thanks @waj)WebSocket handshake. (#9418, thanks @waj)sync or flush_on_newline for standard I/O on Windows. (#9207, thanks @kubo)HTTP::Server (aka: WebSockets). (#9243, thanks @waj)URI::Punycode, HTTP::WebSocketHandler, HTTP::Status documentation. (#9068, #9130, #9180, thanks @Blacksmoke16, @dscottboggs, @wontruefree)HTTP::Params::Builder#to_s, use underlying IO directly. (#9319, thanks @straight-shoota)NO_TLS_V1_3 option. (#9350, thanks @lun-4)Log::Severity::Warning to Warn. Drop Verbose. Add Trace and Notice. (#9293, #9107, #9316, thanks @bcardiff, @paulcsmith)Log::Metadata and redesign Log::Context. (#9118, #9227, #9150, #9157, thanks @bcardiff, @waj)Log::Metadata from Log::Metadata::Value, drop immutability via clone, improve performance. (#9295, thanks @bcardiff)Log.setup_from_env and defaults. (#9145, #9240, thanks @bcardiff)Log.capture spec helper. (#9201, thanks @bcardiff)Log::Formatter. (#9211, thanks @waj)to_json for Log::Context. (#9101, thanks @paulcsmith)Log::IOBackend#new with formatter named argument. (#9105, #9434, thanks @paulcsmith, @bcardiff)nil as context raw values. (#9121, thanks @bcardiff)Log#with_context. (#9058, thanks @bcardiff)Concurrent::Future and top-level methods delay, future, lazy. Use crystal-community/future.cr. (#9093, thanks @bcardiff)Process#kill, use Process#signal. (#9006, thanks @oprypin, @jan-zajic)Process raises IO::Error (or subclasses). (#9340, thanks @waj)Process.quote and fix shell usages in the compiler. (#9043, #9369, thanks @oprypin, @bcardiff)Process support on Windows. (#9047, #9021, #9122, #9112, #9149, #9310, thanks @oprypin, @RX14, @kubo, @jan-zajic)dup3/clock_gettime methods definition. (#9407, thanks @asterite)Int64 as portable Process.pid type. (#9019, thanks @oprypin)fork. (#9136, thanks @bcardiff)Debug to Crystal namespace. (#9176, thanks @bcardiff)at_exit inside at_exit. (#9388, thanks @asterite)Crystal::System::Process to split out system-specific implementations. (#9035, thanks @oprypin)CallStack to Exception::CallStack. (#9076, thanks @bcardiff)libevent. (#9395, thanks @jhass)be_a macro. (#9066, thanks @asterite)-h short flag to spec runner. (#9164, thanks @straight-shoota)crystal spec file paths on Windows. (#9234, thanks @oprypin)#!. (#9171, thanks @RX14)Process.quote for crystal env output. (#9428, thanks @MakeNowJust)Link annotation handling. (#8972, thanks @RX14)foo:"bar" inside call or named tuple. (#9033, thanks @asterite)unless inside macro. (#9024, #9167, thanks @MakeNowJust)\ (backslash + space) inside regex literal to (space). (#9079, thanks @MakeNowJust){[] of Foo, self.foo} expressions. (#9329, thanks @MakeNowJust)CRYSTAL_OPTS. (#9018, thanks @straight-shoota)Process.run("which") from compiler. (#9141, thanks @straight-shoota)CrystalPath::Error. (#9359, thanks @straight-shoota)RegexLiteral#to_s output when first character of literal is whitespace. (#9017, thanks @MakeNowJust)as? when type is a union. (#9417, #9435, thanks @asterite)type_vars works for generic modules. (#9161, thanks @toddsundsted)DIBuilder to LLVMExt. (#9114, thanks @bcardiff)&.!. (#9391, thanks @MakeNowJust)String default values. (#9200, thanks @bcardiff):ditto: in macro. (#9341, thanks @bcardiff)is_crystal_repo based on project name. (#9070, thanks @straight-shoota)Docs::Generator source link generation. (#9119, #9305, thanks @straight-shoota)lib directory in the CRYSTAL_PATH. (#9315, thanks @waj)SOURCE_DATE_EPOCH only to determine compiler date. (#9088, thanks @straight-shoota)crystal spec command for running a particular spec. (#9103, thanks @paulcsmith)case expression check added, for now it produces warnings. (#8424, #8962, thanks @asterite, @Sija)Proc(T) be used as a Proc(Nil). (#8969, #8970, thanks @asterite)Errno, WinError, IO::Timeout with RuntimeError, IO::TimeoutError, IO::Error, File::Error, Socket::Error, and subclasses. (#8885, thanks @waj)Logger module in favor of Log module. (#8847, #8976, thanks @bcardiff)Adler32 and CRC32 to Digest. (#8881, thanks @bcardiff)DL module. (#8882, thanks @bcardiff)SemanticVersion::Prerelease comparable. (#8991, thanks @MakeNowJust)flag?(:i386) instead of obsolete flag?(:i686). (#8863, thanks @bcardiff)vsnprintf. (#8942, thanks @oprypin)OptionParser example to exit on --help. (#8927, thanks @vlazar)Float32#to_s corner-case. (#8838, thanks @toddsundsted)Big*#to_u raise on negative values. (#8826, thanks @Sija)BigDecimal#to_big_i regression. (#8790, thanks @Sija)Complex#round. (#8819, thanks @miketheman)Int#bit_length and BigInt#bit_length. (#8924, #8931, thanks @asterite)Int#gcd. (#8894, thanks @nard-tech)with_color in favor of Colorize.with. (#8892, #8958, thanks @bcardiff, @oprypin)String#ljust, String#rjust and String#center that take an IO. (#8923, thanks @asterite)Regex#hash and Regex::MatchData#hash. (#8986, thanks @MakeNowJust)String#codepoint_at. (#8902, thanks @vlazar)Iconv to Crystal namespace. (#8890, thanks @bcardiff)Range#size raise on an open range. (#8829, thanks @Sija)Enumerable#empty?. (#8960, thanks @Sija)Array#fill for zero Values. (#8903, thanks @toddsundsted)Reflect to an Enumerable private definition. (#8884, thanks @bcardiff)YAML::Builder.new with block to YAML::Builder.build. (#8896, thanks @straight-shoota)XML.build_fragment. (#8813, thanks @straight-shoota)CSV#rewind. (#8912, thanks @asterite)Deque#from_json and Deque#to_json. (#8850, thanks @carlhoerberg)IO#flush on CSV, INI, JSON, XML, and YAML builders. (#8876, thanks @asterite)Object.from_yaml. (#8800, thanks @wowinter13)Time::Span initialization API with mandatory named arguments. (#8257, #8857, thanks @dnamsons, @bcardiff)Time::Span#total_microseconds. (#8966, thanks @vlazar)fd to -1 on closed File/Socket. (#8873, thanks @bcardiff)File.dirname with unicode chars. (#8911, thanks @asterite)IO::Buffered#flush_on_newline back and set it to true for non-tty. (#8935, thanks @asterite)IO::Hexdump to underlying IO. (#8908, thanks @carlhoerberg)HTTP::Client return empty body_io if content-length is zero. (#8503, thanks @asterite)UDP specs in the case of a local firewall. (#8817, thanks @RX14)MIME spec examples to not collide with actual registry. (#8795, thanks @straight-shoota)UNIXServer, and HTTP::WebSocket specs to ensure server is accepting before closing. (#8755, #8879, thanks @bcardiff)tls argument in HTTP. (#8678, thanks @j8r)Location to HTTP::Request common header names. (#8992, thanks @mamantoha)Future regarding exceptions. (#8860, thanks @rdp)Thread specs on musl. (#8801, thanks @straight-shoota)src/signal.cr. (#8805, thanks @lbguilherme)AtExitHandlers to Crystal namespace. (#8883, thanks @bcardiff)disable_overflow compiler flag. (#8772, thanks @Sija)CRYSTAL_OPTS environment variable as default compiler options. (#8900, thanks @bcardiff)--exclude-warnings value if some is specified. (#8899, thanks @bcardiff)LIBRARY_PATH as default library path, and allow linking with no explicit /usr/lib:/usr/local/lib paths. (#8948, thanks @bcardiff)Object.to_s in interpolation in compiler's code. (#8947, thanks @veelenga)NoReturn if calling method on abstract class with no concrete subclasses. (#8870, thanks @asterite)crystal init name validation. (#8737, thanks @straight-shoota)pretty_json sample. (#8816, thanks @asterite)TypeNode#name(generic_args : BoolLiteral) to return TypeNode's name with or without type vars. (#8483, thanks @Blacksmoke16)PartialComparable, Crypto::Bcrypt::Password#==, HTTP::Server::Response#respond_with_error, JSON::PullParser::Kind#==, Symbol#==(JSON::PullParser::Kind), JSON::Token#type, String#at, Time.new, Time.now, Time.utc_now, URI.escape, URI.unescape. (#8646, #8596, thanks @bcardiff, @Blacksmoke16)Object#in?. (#8720, #8723, thanks @Sija)VaList#next for getting the next element in a variadic argument list. (#8535, #8688, thanks @ffwff, @RX14)ARGF implementation. (#8593, thanks @arcage)Colorize on dumb terminal. (#8673, thanks @oprypin)BigInt#unsafe_shr. (#8763, thanks @asterite)Float#fdiv to use binary primitive. (#8662, thanks @bcardiff)\u0000 wrongly added on String#sub(Hash) replaces last char. (#8644, thanks @mimame)Enumerable#zip to work with union types. (#8621, thanks @asterite)Hash's initial_capacity. (#8569, thanks @r00ster91)JSON::PullParser overflow handling. (#8698, thanks @KimBurgess)JSON::Any#dig?/YAML::Any#dig? on non-structure values. (#8745, thanks @Sija)Time#shift over date boundaries with zone offset. (#8742, thanks @straight-shoota)File::Info#owner, and File::Info#group; use owner_id, and group_id. (#8007, thanks @j8r)Path.new receiving Path as first argument. (#8753, thanks @straight-shoota)File.size and File.info to work with Path parameters. (#8625, thanks @snluu)Path specs when ENV["HOME"] is unset. (#8667, thanks @straight-shoota)Dir.mkdir_p to use Path#each_parent and make it work on Win32. (#8668, thanks @straight-shoota)IO::MultiWriter specs to close file before reading/deleting it. (#8674, thanks @oprypin)IO when resuming readable/writable event. (#8707, #8733, thanks @bcardiff)HTTP::Cookie to support Int64 max-age values. (#8759, thanks @asterite)getaddrinfo failure. (#8498, thanks @rdp)IO::SysCall#wait_readable and IO::SysCall#wait_writable public, yet :nodoc:. (#7366, thanks @stakach)StaticFileHandler to use Path. (#8672, thanks @straight-shoota)TCPServer spec. (#8702, thanks @straight-shoota)Crypto::Bcrypt::Password check for invalid hash value. (#6467, thanks @miketheman)Random::Secure. (#8484, thanks @straight-shoota)Future(Nil) when the block raises. (#8650, thanks @lbguilherme)IO closing in multi-thread mode. (#8733, thanks @bcardiff)Fiber. (#8739, thanks @straight-shoota)system module for Win32 in prelude. (#8661, thanks @straight-shoota)__crystal_sigfault_handler. (#8743, thanks @waj)LibUnwind::Exception struct is not atomic. (#8728, thanks @waj)Crystal::System.print_error to use printf like format. (#8786, thanks @bcardiff)assert. (#8767, thanks @Blacksmoke16)Spec::JUnitFormatter output and options enhancements. (#8599, #8692, thanks @Sija, @bcardiff)memset and memcpy that matches target machine. (#8746, thanks @bcardiff)typeof in an unused block. (#8695, thanks @asterite)CRYSTAL_PATH to allow shards to override std-lib. (#8752, thanks @bcardiff)Proc pointer. (#8757, thanks @asterite)begin/rescue if all rescue are unreachable. (#8758, thanks @asterite)crystal init to handle .. (#8681, thanks @jethrodaniel)exp.!. (#8768, thanks @asterite)ditto and nodoc in favor of :ditto: and :nodoc:. (#6362, thanks @j8r)docs/ dir when not needed. (#8718, thanks @Sija)Makefile to use lld if present (Linux only). (#8641, thanks @bcardiff)Enumerable#each_cons_pair and Iterator#cons_pair. (#8585, thanks @arcage)HTTP::WebSocket's on_close callback is called for all errors. (#8552, thanks @stakach)expr.!. (#8445, thanks @jan-zajic)TypeNode#class_vars to list class variables of a type in a macro. (#8405, thanks @jan-zajic)TypeNode#includers to get an array of types a module is directly included in. (#8133, thanks @Blacksmoke16)ArrayLiteral#map_with_index and TupleLiteral#map_with_index. (#8049, thanks @Blacksmoke16)ArrayLiteral#reduce. (#8379, thanks @jan-zajic)lower: named argument to StringLiteral#camelcase. (#8429, thanks @Blacksmoke16)Readline from std-lib. It's now available as a shard at crystal-lang/crystal-readline (#8364, thanks @ftarulla)Number#clamp to Comparable#clamp. (#8522, thanks @wontruefree)abort without arguments. (#8214, thanks @dbackeus)Enum.valid?. (#5716, thanks @MakeNowJust)TERM=dumb. (#8271, thanks @ilanpillemer)% and Int#remainder edge case of min int value against -1. (#8321, thanks @asterite)Int#gcd types edge case and improve performance. (#7996, #8419, thanks @yxhuvud, @j8r)Int#bits for accessing bit ranges. (#8165, thanks @stakach)Number#round with UInt argument. (#8361, thanks @igor-alexandrov)String.interpolation. (#8400, thanks @asterite)String#codepoint_at, use char_at(index).ord. (#8475, thanks @vlazar)String#presence. (#8345, #8508, thanks @igor-alexandrov, @Sija)String#center. (#8557, thanks @hutou)String#to_utf16 optimizing for ascii-only. (#8526, thanks @straight-shoota)Levenshtein module. (#8386, thanks @katafrakt)Regex::Options. (#8448, thanks @jan-zajic)Enumerable#grep, use Enumerable#select. (#8452, thanks @j8r)Enumerable#minmax, #min, #max for partially comparable values. (#8490, thanks @TedTran2019)Hash#rehash. (#8450, thanks @asterite)Array range assignment index out of bounds. (#8347, thanks @asterite)String#[]? and Array#[]?. (#8567, thanks @KarthikMAM)Hash#compare_by_identity and Set#compare_by_identity. (#8451, thanks @asterite)Enumerable#each_cons_pair and Iterator#cons_pair yielding a tuple. (#8332, thanks @straight-shoota)offset argument to all map_with_index methods. (#8264, thanks @asterite)Tuple#to_a. (#8265, thanks @asterite)Hash.merge!(other : Hash, &). (#8380, thanks @jan-zajic)Hash.select. (#8391, thanks @jan-zajic)Enumerable.reduce. (#8378, thanks @jan-zajic)XML::Reader#expand raise, introduce XML::Reader#expand? for former behavior. (#8186, thanks @Blacksmoke16)JSON.mapping & YAML.mapping converter attribute to be applied to Array and Hash. (#8156, thanks @rodrigopinto)use_json_discriminator and use_yaml_discriminator to choose type based on property value. (#8406, thanks @asterite)self restriction from Object.from_json and Object.from_yaml. (#8489, thanks @straight-shoota)~) by default in File.expand_path and Path#expand, now opt-in argument. (#7903, thanks @didactic-drunk)Path regarding #dirname, #each_part, #each_parent. (#8415, thanks @jan-zajic)GZip::Reader and GZip::Writer to handle large data sizes. (#8421, thanks @straight-shoota)File::Info#same_file? by providing access to 64 bit inode numbers. (#8355, thanks @didactic-drunk)HTTP::Response#mime_type returns nil on empty Content-Type header. (#8464, thanks @Sija)HTTP::Client#write_timeout. (#8507, thanks @Sija).js files to text/javascript and include image/webp. (#8342, thanks @mamantoha)OpenSSL::DigestBase#base64digest via Base64.strict_encode. (#8215, thanks @j8r)Channel successful sent and raise behavior. (#8284, thanks @firejox)Channel#close to be thread-safe. (#8249, thanks @firejox)select with receive? and closed channels. (#8304, thanks @bcardiff)Mutex implementation and policy checks. (#8295, #8563, thanks @waj, @ysbaddaden)Channel#send and Channel#close. (#8356, thanks @lbarasti)Thread#gc_thread_handler for Windows support. (#8519, thanks @straight-shoota)-Dgc_none -Dpreview_mt. (#8280, thanks @bcardiff)callstack_spec. (#8308, #8395, thanks @straight-shoota, @Sija)--fail-fast behaviour. (#8453, thanks @asterite)should_not be_nil and others. (#8412, thanks @asterite)--order random|<seed-value>. (#8310, thanks @Fryguy)Spec filters. (#8242, thanks @Fryguy)no target defs error. (#8417, thanks @asterite)--mcmodel option to compiler. (#8363, thanks @ffwff)instance_sizeof on union. (#8399, thanks @asterite)crystal <command> --help in help. (#3628, thanks @rdp)sizeof(Bool). (#8273, thanks @asterite):ditto:. (#8389, thanks @Blacksmoke16)!, as, nil?, etc.. (#8327, #8371, thanks @straight-shoota)& instead of &block for signature of yielding method. (#8394, thanks @j8r)bionic and LLVM 8.0. (#8442, thanks @bcardiff)Random::Secure. (#8224, thanks @oprypin)IO::Evented#evented_write invalid IndexError error. (#8239, thanks @bcardiff)Channel to use records instead of tuples. (#8227, thanks @asterite)before_suite and after_suite hooks. (#8238, thanks @asterite)uninitialized. (#8221, thanks @asterite)& : T -> U. (#8117, thanks @asterite)@type is devirtualized inside macros. (#8149, thanks @asterite)Markdown from the std-lib. (#8115, thanks @asterite)OptionParser#parse!, use OptionParser#parse. (#8041, thanks @didactic-drunk)/ the arithmetic division for all types. (#8120, thanks @bcardiff)BigDecimal#** and BigRational#** (pow operator). (#7860, thanks @jwbuiter)Number#round(digits, base). (#8204, thanks @bcardiff)Int#divisible_by? for clarity. (#8045, thanks @yxhuvud)String#lchop? ASCII-only optimization. (#8052, thanks @r00ster91)Array#*. (#8087, thanks @asterite)Hash#to_a, Hash#keys and Hash#values. (#8042, thanks @asterite)Hash#put and optimize Set#add?. (#8116, thanks @asterite)Slice#== for some generic instantiations, add Slice#<=>. (#8074, thanks @asterite)Iterator. (#8053, thanks @KimBurgess)Set#+. (#8121, thanks @sam0x17)Hash to use integer division instead of float division. (#8104, thanks @asterite)XML::Type to XML::Node::Type, introduce XML::Reader::Type. (#8134, thanks @asterite)NamedTuple with nilable fields. (#8109, thanks @asterite)Path#join by precomputing capacity if possible. (#8078, thanks @asterite)Path#join for the case of joining one single part. (#8082, thanks @asterite)Dir.glob. (#8081, thanks @asterite)File.basename off-by-one corner-case. (#8119, thanks @ysbaddaden)Path.home on Path.expand. (#8128, thanks @asterite)Zip::Writer STORED compression. (#8142, thanks @asterite)ARGF if read_count is zero. (#8177, thanks @Blacksmoke16)HTTP::Server::Response#respond_with_error with #respond_with_status. (#6988, thanks @straight-shoota)HTTP::Request.from_io and remove HTTP::Request::BadRequest. (#8013, thanks @straight-shoota)SSL_new if ssl_accept fails. (#8088, thanks @rdp)URI#query_params method. (#8090, thanks @rodrigopinto)URI#resolve and URI#relativize. (#7716, thanks @straight-shoota)#clear, #delete, and #size methods to HTTP::Cookies. (#8107, thanks @sam0x17)http/server_spec. (#8056, thanks @straight-shoota)Crystal::Scheduler.init_workers block until workers are ready. (#8145, thanks @bcardiff)Crystal::ThreadLocalValue thread-safe. (#8168, thanks @waj)exec_recursive use a thread-local data structure. (#8146, thanks @asterite)Process.times. (#8097, thanks @jgaskins)focus. (#8125, #8178, #8208, thanks @asterite, @straight-shoota, @bcardiff)name_location of some calls. (#8192, thanks @asterite)for expression error. (#7641, thanks @r00ster91)Proc types. (#8159, thanks @asterite)offsetof on reference types. (#8137, thanks @mcr431)Number#humanize digits. (#8027, thanks @straight-shoota)HTTP::Client#socket. (#8025, thanks @straight-shoota)sizeof(Nil) and other empty types. (#8040, thanks @asterite)args/named_args macro methods to Annotations. (#7694, thanks @Blacksmoke16)resolve and types macro methods API for Type and Path for convenience. (#7970, thanks @asterite)UUID#to_slice in favor of UUID#bytes to fix dangling pointer issues. (#7901, thanks @ysbaddaden)Box of reference types. (#8016, thanks @waj)Random::ISAAC. (#7977, thanks @asterite)Benchmark.memory. (#7835, thanks @r00ster91)StringPool. (#7899, thanks @carlhoerberg)INI. (#7831, thanks @j8r)Logger docs. (#7898, thanks @dprobinson)Int#% overflow. (#7980, thanks @asterite)Float#to_s and BigFloat#to_s, always show .0 for whole numbers. (#7982, thanks @Lasvad)Enumerable#tally. (#7921, thanks @kachick)Enumerable#reduce? overload with not initial value. (#7941, thanks @miketheman)Enumerable#min_by?. (#7919, thanks @kachick)XML::Builder. (#7965, thanks @Blacksmoke16)Hash(Int32, String).from_json). (#7944, thanks @asterite)alias/merge methods to YAML::Builder and YAML::Nodes::Builder. (#7949, thanks @Blacksmoke16)File.readlink to match File.symlink. (#7858, thanks @didactic-drunk)URI.escape and URI.unescape are renamed to URI.encode_www_form and URI.decode_www_form. Add URI.encode and URI.decode. (#7997, #8021, thanks @straight-shoota, @bcardiff)HTTP::Server response double-close. (#7908, thanks @asterite)HTTP::Client host argument is just a host. (#7958, thanks @asterite)HTTP::Params.encode to encode an arrays of values for a key. (#7862, thanks @rodrigopinto)read_timeout/write_timeout in ssl socket to underlying socket. (#7820, thanks @carlhoerberg)IO::Buffered. (#7930, thanks @carlhoerberg)OpenSSL::SSL::Socket spec. (#7871, thanks @j8r)sysconf call on OpenBSD. (#7879, thanks @jcs)System::User and System::Group. (#7725, thanks @woodruffw, @chris-huxtable)Process::Status.exit_status (#7873). (#8014, thanks @UlisseMini)pointer.as(Nil). (#8019, thanks @asterite)concrete_types for virtual metaclass and modules. (#7951, thanks @bcardiff)remove_indirection in TypeDefType. (#7971, thanks @bcardiff)CRYSTAL_SPEC_COMPILER_FLAGS usage in some more specs. (774768, thanks @bcardiff)LLVMId from CodeGenVisitor to Program. (#7973, thanks @bcardiff)bin/check-compiler-flag helper script. Add make clean_cache. (da3892, thanks @bcardiff)record macro. (#7811, thanks @asterite)puts macro output. (#7734, thanks @asterite)String#to_u methods for the case of a negative number. (#7446, thanks @r00ster91)String#at, use String#char_at. (#7633, thanks @j8r)String#to_i to parse octals with prefix 0o (but not 0 by default). (#7691, thanks @icy-arctic-fox)String#to_i arguments to be Bool. (#7436, thanks @j8r)downcase option to String#camelcase. (#7717, thanks @wontruefree)Unicode not showing up in the API docs. (#7720, thanks @r00ster91)Slice#pointer. (#7581, thanks @Maroo-b)Slice. (#7597, thanks @Maroo-b)Slice#[]?. (#7701, thanks @Sija)Slice#[]. (#7780, thanks @Sija)File::DEVNULL to File::NULL. (#7778, thanks @r00ster91)~ in Path#expand. (#7768, thanks @byroot)Dir.glob(match_hidden: false) not hiding hidden files properly. (#7774, thanks @ayazhafiz)IO#copy return UInt64. (#7660, thanks @asterite)openssl.cr. (#7803, thanks @RX14)IO::MultiWriter#flush. (#7765, thanks @mamantoha)OpenSSL::SSL::Socket#cipher and #tls_version. (#7445, thanks @carlhoerberg)URI#normalize. (#7635, thanks @straight-shoota)URI methods. (#7796, thanks @r00ster91)StaticFileHandler specs for Last-Modified header. (#7640, thanks @straight-shoota)Crypto::Bcrypt::Password#== to #verify. (#7790, thanks @asterite)Channel. (#7673, thanks @j8r)Union(...) and keep more accurate type information. (#7815, thanks @asterite)offsetof not being usable with macros. (#7703, thanks @malte-v)call &.@ivar. (#7754, thanks @asterite)Def#to_s with **options and &block. (#7854, thanks @MakeNowJust)pointerof inner expression for errors. (#7755, thanks @asterite)pointerof(self) parser error. (#7542, thanks @r00ster91)sizeof on abstract structs and modules. (#7801, thanks @asterite)@ivar initializer. (#7750, thanks @asterite)T.class over Class in method lookup. (#7759, thanks @asterite)if with &&. (#7785, thanks @asterite)NoReturn in if. (#7792, thanks @asterite)while and rescue. (#7806, thanks @asterite)NoReturn type in named args. (#7761, thanks @asterite)with ... yield. (#7746, thanks @asterite); or ,, the latter being deprecated and reformatted to a newline. (#7607, #7618, thanks @asterite, and @j8r)array[5..]. (#7179, thanks @asterite)offsetof(Type, @ivar) expression. (#7589, thanks @malte-v)Type#annotations to list all annotations and not just the last of each kind. (#7326, thanks @Blacksmoke16)ArrayLiteral#sort_by macro method. (#3947, thanks @jreinert)None enum flag with Enum.from_value. (#6516, thanks @bew)PartialComparable. Its behaviour has been fully integrated into Comparable. (#7664, thanks @straight-shoota)Signal::CHLD.reset not clearing previous handler. (#7409, thanks @asterite)Object.getter? and Object.property? macros. (#7322, thanks @Sija)-1, 0 and 1 by Comparable#<=>. (#7277, thanks @r00ster91)require statements to samples in the API docs. (#7564, thanks @Maroo-b)@[Flags] and @[Link] annotations. (#7665, thanks @bcardiff)Bool. (#7651, thanks @wontruefree)$errno GLIBC_PRIVATE symbol. (#7496, thanks @felixvf)#to_s and #inspect. (#7528, thanks @wontruefree)Int#/. It will return a Float in 0.29.0. Use Int#// for integer division. (#7639, thanks @bcardiff)Number#inspect to not show the type suffixes. (#7525, thanks @asterite)Int#leading_zeros_count and Int#trailing_zeros_count. (#7520, thanks @Sija)Big*#//, BigInt#&-ops and missing #floor, #ceil, #trunc. (#7638, thanks @bcardiff)OverflowError message. (#7375, thanks @r00ster91)String#compare in case of ASCII only. (#7352, thanks @r00ster91)Number#format, Number#humanize, and Int#humanize_bytes. (#6314, thanks @straight-shoota)String#rchop? and String#lchop?. (#7328, thanks @j8r)options argument to String#camelcase and String#underscore. (#7374, thanks @r00ster91)Unicode::CaseOptions. (#7513, thanks @r00ster91)String#each_line and IO#each_line. (#7419, thanks @straight-shoota)Array#sort only use <=>, and let <=> return nil for partial comparability. (#6611, thanks @asterite)Iterator#rewind. Implement #cycle by storing elements in an array. (#7440, thanks @asterite)Enumerable#each_cons support for Deque as a reuse buffer. (#7233, thanks @yxhuvud)Range#bsearch / 2 to >> 1 for faster performance. (#7531, thanks @Fryguy)Slice#clone for non-primitive types and deep copy. (#7591, thanks @straight-shoota)Indexable#zip and Indexable#zip? to Enumerable and make it work with any number of Indexable or Iterable or Iterator. (#7453, thanks @asterite)Slice#[](Range). (#7439, thanks @asterite)#[]?(Range) to Array and String. (#7338, thanks @j8r)Set#add?. (#7495, thanks @Sija)Hash regarding ordering of items. (#7594, thanks @straight-shoota)YAML#libyaml_version to SemanticVersion. (#7555, thanks @asterite)BigDecimal.from_yaml. (#7398, thanks @Sija)Time constructors. Deprecate Time.now to encourage usage Time.utc or Time.local (#5346, #7586, thanks @straight-shoota)Time#add_span to Time#shift for changing a time instance by calendar units and handle other units. (#6598, thanks @straight-shoota)Time#date to return a Tuple of {year, month, day}. Use Time#at_beginning_of_day if a Time instance is wanted. (#5822, thanks @straight-shoota)Time methods. (#6581, thanks @straight-shoota)IO#flush_on_newline and only sync on STDOUT/STDIN/STDERR when they are TTY devices. (#7470, thanks @asterite)Path type. (#5635, thanks @straight-shoota)(breaking-change) Move HTTP::Multipart to MIME::Multipart. (#7085, thanks @m1lt0n)
(breaking-change) Stop parsing JSON in OAuth2 errors. (#7467, thanks @asterite)
(breaking-change) Fix RequestProcessor connection reuse logic. (#7055, thanks @straight-shoota)
(breaking-change) Replace HTTP.default_status_message_for(Int) with HTTP::Status.new(Int).description. (#7247, thanks @dwightwatson)
(breaking-change) Fix issues in URI implementation. URI#opaque method is merged into URI#path, which no longer returns Nil. #parse/#to_s normalization and default port handling has changed. (#6323, thanks @straight-shoota)
Fix write buffering in OpenSSL sockets. (#7460, thanks @carlhoerberg)
Fix leaks in HTTP::Server #bind_* and specs. (#7197, thanks @straight-shoota)
Add HTTP::Request#remote_address. (#7610, thanks @asterite)
Add HTTP::Status and Response#status. (#7247, #7682, thanks @dwightwatson, and @bcardiff)
Add support for OAuth 2.0 resource owner password credentials grant type. (#7424, thanks @Blacksmoke16)
Add support for IIS date format in cookies. (#7405, thanks @Sija)
Allow calls to IO::Syscall#wait_readable and IO::Syscall#wait_writable. (#7366, thanks @stakach)
Fix spec of HTTP::Client to not write server response after timeout. (#7402, thanks @asterite)
Fix spec of TCP::Server for musl. (#7484, thanks @straight-shoota)
OpenSSL::Algorithm instead of symbols for digest/hexdigest. Expose LibCrypt's PKCS5_PBKDF2_HMAC. (#7264, thanks @mniak)-D preview_mt. (#7546, thanks @bcardiff, @waj, and @ysbaddaden)Fiber::StackPool from Fiber. (#7417, thanks @ysbaddaden)IO::Syscall as IO::Evented. (#7505, thanks @ysbaddaden)execvp error message. (#7511, thanks @straight-shoota)CTRL+C. (#7426, thanks @asterite)pending and it to accept constants. (#7646, thanks @straight-shoota)--threads=1. (#7397, thanks @asterite)->foo.[] and other operators . (#7334, thanks @asterite)asm with 3 colons and a variable. (#7627, thanks @r00ster91)@[Deprecated] methods. (#7596, #7626, #7661, thanks @bcardiff)CRYSTAL_LIBRARY_PATH for lookup static libraries. (#7562, thanks @bcardiff)with ... yield scope, if any) on undefined method error. (#7384, thanks @asterite)next when trying to break from captured block . (#7406, thanks @r00ster91)// and &-ops in multiple places. (#7628, thanks @bcardiff)Crystal::Config.version to use read_file macro. (#7081, thanks @Sija)as, as? and unions and empty types. (#7475, thanks @asterite)protected initialize, define a protected new. (#7510, thanks @asterite)Nil | T return type to Nil return type. (#7527, thanks @asterite)travis.yml. (#7138, thanks @KCErb)1\n.as(Int32). (#7347, thanks @asterite)@[Deprecated] is used. (#7653, thanks @bcardiff)CONTRIBUTING.md. (#7617, thanks @straight-shoota)Thread specs. (#7403, thanks @asterite)HTTP::Client support exception on missing Content-Type. (#7371, thanks @bew)UUID from String. (#7030, thanks @jgaskins)SemanticVersion operations. (#7234, thanks @j8r)Time.now. (#7155, thanks @straight-shoota)Nil#not_nil! raise NilAssertionError. (#7330, thanks @r00ster91)Bool#to_unsafe other than for C bindings. (#7320, thanks @oprypin)#to_s to be independent of the name method. (#7295, thanks @asterite)ArrayLiteral#unshift. (#7127, thanks @Blacksmoke16)Annotation#[] to accept String and Symbol as keys. (#7153, thanks @MakeNowJust)NamedTupleLiteral#[] to raise a compile error for invalid key type. (#7158, thanks @MakeNowJust)getter/property macros to work properly with Bool types. (#7313, thanks @Sija)read_file macro method. (#6967, #7094, thanks @Sija, @woodruffw)StringLiteral#count. (#7239, thanks @Blacksmoke16)BigDecimal. (#7218, thanks @Sija)String passed to Big* constructors. (#7107, thanks @Sija)Complex. (#5440, thanks @Sija)Int128, UInt128. (#7173, thanks @bcardiff)value.to_X!/T.new!/Int#&**. (#7226, thanks @bcardiff)ECR location error reported. (#7137, thanks @MakeNowJust)String#to_i to avoid future overflow. (#7172, thanks @bcardiff)Hash#from. (#7210, thanks @r00ster91)Enumerable#chunks and Iterator#chunk. (#6941, thanks @r00ster91)Hash to JSON serialization. (#7053, thanks @MakeNowJust)Iterator#slice_after. (#7146, thanks @asterite)Iterator#slice_before. (#7152, thanks @asterite)Iteratory#slice_when and Iterator#chunk_while. (#7159, thanks @asterite)Enumerable#to_h(&block). (#7150, thanks @Sija)Enumerable#one?. (#7166, thanks @asterite)Enumerable, Iterator and Array overloads that accept a pattern. (#7174, thanks @asterite)#as_T/#as_T? methods between JSON::Any/YAML::Any. (#6556, thanks @j8r)Set#from_yaml. (#6310, thanks @kostya)Time::Span initializer and sleep for big seconds. (#7221, thanks @asterite)Float#weeks method similar to Int#weeks. (#7165, thanks @vlazar)mkstemps support on aarch64. (#7300, thanks @silmanduin66)System::File.utime (Unix). (#7156, thanks @straight-shoota)HTTP::Client edge case of exception during in TLS initialization. (#7123, thanks @asterite)OpenSSL::SSL::Error.new to not raise Errno. (#7068, thanks @straight-shoota)URI encoding in StaticFileHandler::DirectoryListing. (#7072, thanks @Sija)MIME::MediaType for parsing mime media types. (#7077, thanks @straight-shoota)HTTP::Server::Response. (#6912, thanks @jreinert)HTTP::Server docs. (#7251, thanks @straight-shoota)OpenSSL specs to reduce chances of failing. (#7202, thanks @bcardiff)OpenSSL::Cipher#authenticated? to see if the cipher supports aead. (#7223, thanks @danielwestendorf)Crystal::System for Win32. (#6972, thanks @markrjr)Errno#errno_message getter. (#6702, thanks @r00ster91)it and pending at run-time. (#7297, thanks @MakeNowJust)LLVM::Type.const_int emit Int128 literals. (#7135, thanks @bcardiff)Enum.new. (#7266, thanks @asterite)nil? error on pointer types. (#7180, thanks @asterite)Float32, Float64 values. (#7134, thanks @bcardiff)interpret_run. (#7051, thanks @Sija)Crystal::Codegen::Target and consolidate triple handling. (#7282, #7317, thanks @RX14, @bcardiff)typeof appears inside generic type. (#7176, thanks @asterite)&.foo in call. (#7240, thanks @MakeNowJust)crystal tool format command. (#7257, thanks @MakeNowJust)source_link field. (#7033, thanks @bcardiff)Doc::Highlighter. (#7054, thanks @MakeNowJust)--format option to docs command. (#6982, thanks @mniak)Generic#resolve and Generic#resolve? macro methods. (#6617, thanks @asterite)v1, v2, v3, v4, v5 methods of UUID. (#6952, thanks @r00ster91)Pointer/UInt subtraction. (#6994, thanks @damaxwell)Nil#not_nil!. (#6712, thanks @yeeunmariakim)Enum#parse/Enum#parse? to String arguments. (#6654, thanks @vladfaust)property?. (#6682, thanks @epergo)StringLiteral#gsub and #tr errors. (#6925, thanks @r00ster91)rand with zero value. (#6686, thanks @oprypin)== and != compare the values instead of bits when dealing with signed vs unsigned integers. (#6689, thanks @asterite)Int#downto with unsigned int. (#6678, thanks @gmarcais)&+ &- &*. (#6890, thanks @bcardiff)Int#// and Float#//. (#6891, thanks @bcardiff)BigInt. (#6687, thanks @oprypin)Float::Printer::*. (#5438, thanks @Sija)String::Builder#chomp! returns self. (#6583, thanks @Sija):default to colorize and document ColorRGB, Color256. (#6427, thanks @r00ster91)String::Formatter support for c flag and improve docs. (#6758, thanks @r00ster91)Indexable#at with #fetch. Remove Hash#fetch(key) as alias of Hash#[]. (#6296, thanks @AlexWayfer)Hash/Indexable#dig/dig?. (#6719, thanks @Sija)Iterator.chain to chain array of iterators. (#6570, thanks @xqyww123)NamedTuple#to_h over empty tuples. (#6628, thanks @icyleaf)Indexable#join when all elements are strings. (#6635, thanks @asterite)Array#skip. (#6946, thanks @asterite)YAML::Schema::FailSafe.parse and parse_all. (#6790, thanks @r00ster91)xmlns and prefix in XML::Builder#namespace. (#6743, thanks @yeeunmariakim)CSV.build quoting of Char and Symbol. (#6904, thanks @maiha)JSON::Serializable. (#6950, thanks @Heaven31415)XML::Attributes#delete. (#6910, thanks @joenas)CSV.build. (#6723, thanks @maiha)JSON::Serializable and YAML::Serializable. (#6539, thanks @r00ster91)Time#epoch to Time#to_unix. Also #epoch_ms to #to_unix_ms, and #epoch_f to #to_unix_f. (#6662, thanks @straight-shoota)Time::Location.load_local with TZ=nil. (#6740, thanks @straight-shoota)Time. (#6681, thanks @straight-shoota)Time::Format support for %G, %g, %V. (#6681, thanks @straight-shoota)Time::Location loader support for Windows. (#6363, thanks @straight-shoota)Time#to_local_in to change time zone while keeping wall clock. (#6572, thanks @straight-shoota)Time::UNIX_EPOCH and drop private UNIX_SECONDS constant. (#6908, thanks @j8r)Time::DayOfWeek to ISO ordinal numbering based on Monday = 1. (#6555, thanks @straight-shoota)Int#microsecond alias. (#6297, thanks @Sija)Tempfile. Use File.tempfile or File.tempname. (#6485, thanks @straight-shoota)ChecksumReader.write error message. (#6889, thanks @r00ster91)File#delete, Dir#tempdir and improve File docs. (#6485, thanks @straight-shoota)File#fsync to flush all data written into the file to the disk device. (#6793, thanks @carlhoerberg)DEVNULL to docs. (#6642, thanks @r00ster91)Zlib::Reader, Gzip::Reader and Flate::Reader by including IO::Buffered. (#6916, thanks @asterite)Crystal::System::FileDescriptor to use @fd ivar directly. (#6703, thanks @straight-shoota){Zlib,Gzip,Flate}::Reader#unbuffered_rewind to use check_open. (#6958, thanks @Sija)HTTP::Server#bind_ssl. Use HTTP::Server#bind_tls. (#6699, thanks @straight-shoota)Socket::Address#pretty_print and #inspect. (#6704, thanks @straight-shoota)Socket::IPAddress loopback, unspecified and broadcast methods/constants. (#6710, thanks @straight-shoota)Socket#reuse_port? if SO_REUSEPORT is not supported. (#6706, thanks @straight-shoota)TCPServer handling of reuse_port. (#6940, thanks @RX14)HTTP::Client. (#5145, thanks @HCLarsen)Socket::Server#accept. (#6705, thanks @straight-shoota)socket_spec.cr into separate files. (#6700, thanks @straight-shoota)HTTP::Client to remove inheritance for test server. (#6909, thanks @straight-shoota)HTTP::Server#close. (#5958, thanks @straight-shoota)Channel. (#6714, thanks @asterite)Fiber/Scheduler to isolate responsibilities. (#6897, thanks @ysbaddaden)Fiber.yield behavior. (#6953, thanks @ysbaddaden)IO on a TTY if it can't be reopened. (#6660, thanks @Timbus)Process in preparation for Windows support. (#6744, thanks @RX14)pending to be used without blocks. (#6732, thanks @tswicegood)be_empty expectation. (#6614, thanks @mamantoha)super inside macros will honor arguments. (#6638, thanks @asterite)ASTNode#to_s of non-unary operator call without argument. (#6538, thanks @MakeNowJust)ASTNode#to_s for multiline macro expression. (#6666, thanks @MakeNowJust)ASTNode#to_s for {% verbatim do %} ... {% end %}. (#6665, thanks @MakeNowJust)// corner cases. (#6927, thanks @bcardiff)ProcNotation restriction. (#6932, thanks @MakeNowJust)return, next and break. (#6633, thanks @asterite)asm operands. (#6688, thanks @RX14){% verbatim do %} ... {% end %} outside macro. (#6667, thanks @MakeNowJust)// corner cases. (#6927, thanks @bcardiff)asm operands. (#6688, thanks @RX14):nodoc: marker. (#6627, thanks @Sija)VERSION file and support for specifying the build commit. (#6966, thanks @bcardiff)README.md. (#6911, thanks @r00ster91)self to be eager evaluated when including modules. (#6557, thanks @bcardiff)accepts_block? macro method to Def. (#6604, thanks @willhbr)Object#def_hash can receive symbols. (#6531, thanks @Sija)Hash#transform_keys and Hash#transform_values. (#4385, thanks @deepj)JSON::Serializable and YAML::Serializable clashing with custom initializers. (#6458, thanks @kostya)Time::Format. (#6578, thanks @straight-shoota)HTTP::Server#bind_ssl in favor of HTTP::Server#bind_tls. (#6551, thanks @bcardiff)HTTP::Server#bind. (#6533, thanks @straight-shoota)HTTP::Server crash with self-signed certificate. (#6590, thanks @bcardiff)HTTP::Server specs to use free ports. (#6530, thanks @straight-shoota)STDIN/STDOUT/STDERR handling to avoid breaking other programs. (#6518, thanks @Timbus)DotFormatter to flush after every spec. (#6562, thanks @asterite)break when. (#6509, thanks @asterite)~ methods are now able to be called as foo.~. (#6541, thanks @MakeNowJust)&.method in call. (#6535, thanks @MakeNowJust)pkg-config as Linux package dependency. (distribution-scripts#16, thanks @bcardiff)self). (#6414, thanks @asterite)// operator parsing. NB: No behaviour is assigned to this operator yet. (#6470, thanks @bcardiff)&+ &- &* &** operators parsing. NB: No behaviour is assigned to these operators yet. (#6329, thanks @bcardiff)case without when. (#6367, thanks @straight-shoota)Random#rand(Range(Float, Float)) to return Float. (#6445, thanks @straight-shoota)String#from_utf16(pointer : Pointer(UInt16)) returns now {String, Pointer(UInt16)}. (#6333, thanks @straight-shoota)String#check_no_null_byte to customize error message. (#6333, thanks @straight-shoota)ECR.render for rendering directly as String. (#6371, thanks @straight-shoota)Char (#6487, thanks @r00ster91)StaticArray. (#6404, #6488, thanks @straight-shoota, @r00ster91, @hinrik)Array#concat. (#6493, thanks @fxn)YAML::Builder and JSON::Builder. (#6322, thanks @asterite).... (#6287, thanks @straight-shoota)XML::Reader. (#5740, #6332, thanks @felixbuenemann)JSON::Any, JSON::Serialization and YAML::Serialization. (#6460, #6491, thanks @delef, @bmulvihill)Time.parse. (#6369, thanks @straight-shoota)Time.parse!, Time.parse_utc, Time.parse_local. (#6369, thanks @straight-shoota)File.each_line method that returns an iterator. Use IO#each_line. (#6301, thanks @asterite)File.join when path separator is a component argument. (#6328, thanks @icyleaf)Dir.glob can now list broken symlinks. (#6466, thanks @straight-shoota)File and Dir support for Windows. (#5623, thanks @RX14)HTTP::Server#tls in favor of HTTP::Server#bind_ssl. (#5960, thanks @straight-shoota)HTTP::Handler::Proc to HTTP::Handler::HandlerProc. (#6453, thanks @jwoertink)Socket#accept? base implementation. (#6277, thanks @ysbaddaden)IO read. IO#sync only affect writes, introduce IO#read_buffering?. (#6304, #6474, thanks @asterite, @bcardiff)HTTP::Server::Response. (#6477, thanks @straight-shoota)Socket::Addrinfo. (#6388, thanks @faustinoaq)HTTP::Client will set connection: close header on one-shot requests. (#6410, thanks @asterite)OpenSSL::Digest for multibyte strings. (#6471, thanks @RX14)Host header when using HTTP::Client#exec. (#6481, thanks @straight-shoota)HTTP::Server#bind(URI|String) that infers protocol from scheme. (#6500, thanks @straight-shoota)HTTP::Params.new and HTTP::Params#empty?. (#6241, thanks @icyleaf)If-None-Match header for HTTP::Request and HTTP::StaticFileHandler. (#6219, thanks @straight-shoota)OpenSSL::SSL::Socket. (#6306, thanks @paulkass)application/wasm to the default MIME types of HTTP::StaticFileHandler. (#6377, thanks @MakeNowJust)URI#absolute? and URI#relative?. (#6311, thanks @mamantoha)Crypto::Bcrypt::Password#== was hiding Reference#==(other). (#6356, thanks @straight-shoota)Atomic#swap with reference types. (#6428, thanks @Exilor)Errno if Process.new fails to exec. (#6501, thanks @straight-shoota, @lbguilherme)WinError UTF-16 string messages. (#6442, thanks @straight-shoota)ENV to Crystal::System::Env and implement for Windows. (#6333, #6499, thanks @straight-shoota)not and inlinable values. (#6452, thanks @asterite)\A (and others) inside %r{...} inside macros. (#6282, thanks @asterite)return inside a constant's value. (#6347, thanks @asterite)NoReturn type. (#6411, thanks @asterite)JSON::Serializable instead of JSON.mapping. (#6308, thanks @kostya)Crystal::Call#check_visibility and extract type methods. (#6484, thanks @asterite, @bcardiff)Foo.class instead of Foo:Class. (#6439, thanks @RX14)crystal init. (#6317, thanks @straight-shoota){ {1}.foo, ...} like expressions. (#6300, thanks @asterite)when with numbers. Use right alignment only if all are number literals. (#6392, thanks @MakeNowJust)system_spec does no longer emit errors messages on BSD platforms. (#6289, thanks @jcs)Object.delegate is now able to be used with []= methods. (#6178, thanks @straight-shoota)p! pp! are now able to be used with tuples. (#6244, thanks @bcardiff)#copy_with method to structs generated by record macro. (#5736, thanks @chris-baynes)ArrayLiteral#push and #unshift. (#6232, thanks @MakeNowJust)Indexable#zip and #zip? methods. (#5734, thanks @rodrigopinto)#dup and #clone for JSON::Any and YAML::Any. (6266, thanks @asterite)YAML.builder. (#6097, thanks @kalinon)Time. (#6208, #6214, thanks @r00ster91 and @straight-shoota)Time internals for future Windows support. (#6181, thanks @RX14)Time::Span#microseconds, Int#microseconds and Float#microseconds. (#6272, thanks @asterite)File.extname edge case. (#6234, thanks @bcardiff)FileInfo#flags return value. (#6248, thanks @fgimian)IO#write(slice : Bytes) won't write information if slice is empty. (#6269, thanks @asterite)HTTP::Server#bind_tcp method. (#6179, #6233, thanks @straight-shoota and @MakeNowJust)HTTP::StaticFileHandler. (#6145, thanks @emq)mmap usage on OpenBSD 6.3+. (#6250, thanks @jcs)big/big_int, big/big_float, etc are now able to be included directly. (#6267, thanks @asterite)Crystal::Hasher to avoid load order issues. (#6184, thanks @ysbaddaden)begin/rescue were present. (#6274, thanks @asterite)Time. (#5324, #5819, thanks @straight-shoota)HTTP.rfc1123_date in favor of HTTP.format_time and add time format implementations for ISO-8601, RFC-3339, and RFC-2822. (#5123, thanks @straight-shoota)crystal deps is removed, use shards. (#5544, thanks @asterite)Hash#key was renamed as Hash#key_for. (#5444, thanks @marksiemers)JSON::Any and YAML::Any have been re-implemented solving some inconsistencies and avoiding the usage of recursive aliases (JSON::Type and YAML::Type have been removed). (#5183, thanks @asterite)File.join with empty path component. (#5915, thanks @straight-shoota)Colorize#push in favor of Colorize#surround and allow nested calls across the stack. (#4196, thanks @MakeNowJust)File.stat was renamed to File.info and a more portable API was implemented. (#5584, #6161, thanks @RX14 and @bcardiff)HTTP::Server to bind to multiple addresses. (#5776, #5959, thanks @straight-shoota)loop. (#6026, thanks @asterite)typeof in type restrictions. (#5192, thanks @asterite)IO::Buffered#sync = true. (#5849, thanks @RX14)when _ support. (#6150, thanks @MakeNowJust)DivisionByZero exception was renamed to DivisionByZeroError. (#5395, thanks @sdogruyol)Foo::Bar = 1. (#5883, thanks @bew)= in symbol literals. (#5969, thanks @straight-shoota)None to 0 for @[Flags] enum. (#6160, thanks @bew)pp) and showing the expression (!): p, pp, p!, pp!. (#6044, thanks @asterite)Number#round to rounds to the nearest whole number. (#5397, thanks @Sija)Int#bits_set? to easily check that certain bits are set. (#5619, thanks @RX14)Float32 and Float64 constants. (#4787, thanks @konovod)Benchmark.ips. (#5522, thanks @asterite)String#to_utf16 and String.from_utf16. (#5541, #5579, #5583 thanks @asterite, @RX14 and @straight-shoota)String#starts_with?(re: Regex). (#5485, thanks @MakeNowJust)Regex.needs_escape?. (#5962, thanks @Sija)Hash#last_key and Hash#last_value. (#5760, thanks @j8r)Indexable. (#4584, thanks @cjgajard)Time#at_{beginning,end}_of_second (#6167, thanks @straight-shoota)IO::Stapled to combine two unidirectional IOs into a single bidirectional one. (#6017, thanks @straight-shoota)JSON.mapping generated code. (#5932, thanks @straight-shoota)JSON::Serializable and YAML::Serializable attribute powered mappings. (#6082, thanks @kostya)mode param to File.write. (#5754, thanks @woodruffw)HTTP::Client#options method. (#5824, thanks @mamantoha)Last-Modified and other cache improvements to HTTP::StaticFileHandler. (#2470, #5607, thanks @bebac and @straight-shoota)BigDecimal and BigFloat. (#5437, #5390, #5589, #5582, #5638, #5675, thanks @Sija and @mjago)BigDecimal and UUID JSON support. (#5525, #5551, thanks @lukeasrodgers and @lachlan)UUID#inspect. (#5574, thanks @ngsankha)Logger configuration in initializer. (#5618, thanks @Sija)CSV.build. (#5998, #6008 thanks @Sija)INI.build to emit INI files. (#5298, thanks @j8r)Process.chroot. (#5577, thanks @chris-huxtable)Tempfile.tempname to create likely nonexisting filenames. (#5360, thanks @woodruffw)FileUtils#ln, ln_s, and ln_sf. (#5421, thanks @woodruffw)Colorize. (#5902, thanks @MakeNowJust)at_exit. (#5906, thanks @MakeNowJust)#clear method to ArrayLiteral/HashLiteral for macros. (#5265, thanks @Sija)Bool#to_unsafe for C bindings. (#5465, thanks @woodruffw)starts_with, ends_with. (#5881, thanks @kostya)--include and --exclude options to restrict directories. (#4635, thanks @straight-shoota)String#sub handling of negative indexes. (#5491, thanks @MakeNowJust)String#gsub in non-ascii strings. (#5350, thanks @straight-shoota)String#dump for UTF-8 characters higher than \uFFFF. (#5668, thanks @straight-shoota)String#tr edge case optimization bug. (#5913, thanks @MakeNowJust)String#rindex when called with Regex. (#5594, thanks @straight-shoota)Time::Span precision loss and boundary check. (#5563, #5786, thanks @petoem and @straight-shoota)Array#sample was fixed to use the provided random number generator (instead of the default) in all cases. (#5419, thanks @c910335)Deque#rotate! for singleton and empty queues. (#5399, thanks @willcosgrove)Slice#reverse! was optimised to be up to 43% faster. (#5401, thanks @larubujo)Regex#inspect when escaping was needed. (#5841, thanks @MakeNowJust)JSON.mapping now generates type restriction on getters. (#5935, thanks @Daniel-Worrall)JSON.mapping documentation regarding unions. (#5483, thanks @RX14)JSON.mapping and YAML.mapping to allow properties property. (#5180, #5352, thanks @maxpowa and @Sija)YAML int and float parsing. (#5699, #5774, thanks @straight-shoota)HTTP::Client is able to use ipv6 addresses. (#6147, thanks @bcardiff)HTTP::Client. (#5630, thanks @straight-shoota)HTTP::ChunkedContent will raise on unterminated content. (#5928, #5943, thanks @straight-shoota)URI#to_s now handles default ports for lots of schemes. (#5233, thanks @lachlan)HTTP::Cookies is able to deal with spaces in cookies. (#5408, thanks @bararchy)HTTP::StaticFileHandler. (#5605, thanks @damianham)StaticFileHandler#redirect_to. (#5628, thanks @straight-shoota)before_request callbacks to be executed right before writing the request in HTTP::Client. (#5626, thanks @asterite)Dir.glob was re-implemented with performance improvements and edge cases fixed. (#5179, thanks @straight-shoota)File.extname edge case for '.' in path with no extension. (#5790, thanks @codyjb)OpenSSL clients, this has been fixed. (#5494, thanks @jhass)Process.fork now print their backtrace correctly. (#5431, thanks @RX14)Zip no longer modifies deflate signature. (#5376, thanks @luislavena)INI parser edge cases and performance improvements. (#5442, #5718 thanks @woodruffw, @j8r)LibXML. (#5587, thanks @lbguilherme)sa_mask. (#5677 thanks @ysbaddaden)llvm-config-5.0 command. (#5531, thanks @Vexatos)at_exit handlers chaining. (#5413, thanks @bew)parallel macro. (#5726, thanks @lipanski)UNIXSocket created by UNIXServer. (#5869, thanks @straight-shoota)Object.delegate over setters. (#5964, thanks @straight-shoota)pp will now use the same width on every line. (#5978, thanks @MakeNowJust)ensure block. (#5396, thanks @MakeNowJust)--static compiler flag. (#5385, thanks @jreinert)ProcNotation and ProcLiteral introspection in macros. (#5206, thanks @javanut13)--emit and avoid generating bc_flags in current directory. (#5521, thanks @asterite)ASTNode#raise macro method. (#5670, thanks @asterite)spawn over expression with receivers. (#5781, thanks @straight-shoota)method_added macro hook. (#5159, thanks @MakeNowJust)cond node in visitor. (#6032, thanks @veelenga)--threads has invalid value. (#6039, thanks @r00ster91)self receiver. (#6075, thanks @MakeNowJust)crystal init and template improvements. (#5475, #5355, #4691, #5788, #5644, #6031 thanks @woodruffw, @faustinoaq, @bew, @kostya and @MakeNowJust).[] methods. (#5424, thanks @MakeNowJust)begin/end. (#5922, thanks @MakeNowJust)doc directory. (#5406, thanks @GloverDonovan)Crystal::Doc::Highlighter has specs now (#5368, thanks @MakeNowJust)File and IO::FileDescriptor were moved to Crystal::System, as part of preparation for the Windows port. (#5333, #5553, #5622 thanks @RX14)Dir were moved to Crystal::System, as part of preparation for the Windows port. (#5447, thanks @RX14)sh instead of bash for greater portability. (#5468, thanks @j8r)LDFLAGS and EXTRA_FLAGS in Makefile. (#5423, #5860, thanks @trofi, @jirutka)String#to_json when chars don't need escaping. (#5456, thanks @larubujo)Time#add_span when arguments are zero. (#5787, thanks @straight-shoota)String#pretty_print to output by splitting newline. (#5750, thanks @MakeNowJust)\a escape sequence. (#5864, thanks @r00ster91)Index out of bounds raised during at_exit (#5224, #5565, thanks @ysbaddaden)Dir#each so it complies with Enumerable (#5458, thanks @bcardiff)SSL::Context bug verifying certificates (#5266, #5601, thanks @waj)skip_file macro docs (#5488, thanks @straight-shoota)build script's LIBRARY_PATH (#5457, #5461, thanks @bcardiff)fun names (#5432, #5434, thanks @bew)UUID type. Random::Secure.uuid has been replaced with UUID.random. (#4453, thanks @wontruefree)BigDecimal class for arbitrary precision, exact, decimal numbers. (#4876 and #5255, thanks @vegai and @Sija)Set to work as a case condition, which matches when the case variable is inside the set. (#5269, thanks @MakeNowJust)Time::Format codes to allow more robust options for parsing sub-second precision times. (#5317, thanks @bcardiff)Time.utc, an alias of Time.new which shortens creating UTC times. (#5321, thanks @straight-shoota)Tempfile. (#5264, thanks @jreinert)reduce method to TupleLiteral and ArrayLiteral when using macros. (#5294, thanks @javanut13)gc/none garbage collection compile again and allow it to be enabled using -Dgc_none compiler flag. (#5314, thanks @ysbaddaden)String#[] unable to read out-of-bounds when the string ends in a unicode character. (#5257, thanks @Papierkorb)URI#full_path not to append a ? unless the query params are nonempty. (#5340, thanks @paulcsmith)HTTP::Params.parse to parse && correctly. (#5274, thanks @akiicat)ENV keys and values. (#5216, thanks @Papierkorb)XML::Node names and content. (#5200, thanks @RX14)IO#blocking= on OpenBSD. (#5283, thanks @wmoxam)super method. (#5202, thanks @lbguilherme); directly after a call (ex p /;/). (#5208, thanks @MakeNowJust)Expressions#to_s could produce invalid output, causing macro expansion to fail. (#5226, thanks @asterite)self is used at the top level. (#5227, thanks @MakeNowJust)instance_sizeof on a generic type without providing it's type arguments. (#5209, thanks @lbguilherme)&.foo) is followed by a newline. (#5237, thanks @MakeNowJust)%w()) sits at the end of a file. (#5241, thanks @asterite){{yield}}) outside a macro. (#5307, thanks @MakeNowJust)foo(+1) as foo + 1 instead of foo(1) where foo was a local variable. (#5336, thanks @MakeNowJust)begin/end block. (#5198, thanks @MakeNowJust)$1?. (#5313, thanks @MakeNowJust){ and % characters to avoid forming {% macros. (#5278, thanks @MakeNowJust)Makefile, CI, and gitignore to use the new documentation path after #4937. (#5217, thanks @straight-shoota)Random::PCG32 generator (See #4536, thanks @konovod)IO (See #4661, thanks @oprypin)Logger#formatter takes a Severity instead of a String (See #4355, #4369, thanks @Sija)IO.select (See #4392, thanks @RX14)Crystal::System::Random namespace (See #4450, thanks @ysbaddaden)Path#resolve? macro method (See #4370, #4408, thanks @RX14)BitArray (See #4397, #3968, thanks @RX14)System.cpu_cores (See #4449, #4226, thanks @miketheman)separator and quote_char to CSV#each_row (See #4448, thanks @timsu)map_with_index! to Pointer, Array and StaticArray (See #4456, #3356, #3354, thanks @Nephos)headers parameter to HTTP::WebSocket constructors (See #4227, #4222, thanks @adamtrilling)unlink to XML::Node (See #4515, #4331, thanks @RX14 and @MrSorcus)Math.frexp (See #4560, thanks @akzhan)Regex::MatchData support for negative indexes (See #4566, thanks @MakeNowJust)captures, named_captures, to_a and to_h to Regex::MatchData (See #3783, thanks @MakeNowJust)| as a string delimiter to allow q|string| syntax (See #3467, thanks @RX14)Float::Printer based on Grisu3 to speed up float to string conversion (See #4333, thanks @will)Object.unsafe_as to unsafely reinterpret the bytes of an object as being of another type (See #4333, thanks @asterite).downcase(Unicode::CaseOptions::Fold) option which convert strings to casefolded strings for caseless matching (See #4512, thanks @akzhan)OpenSSL::DigestIO to wrap an IO while calculating a digest (See #4260, thanks @spalladino)zero? to numbers and time spans (See #4026, thanks @jellymann)TypeNode#has_method? method (See #4474, thanks @Sija)Regex::MatchData#size renamed to #group_size (See #4565, thanks @MakeNowJust)HTTP::StaticFileHandler can disable directory listing (See #4403, #4398, thanks @joaodiogocosta)bin/crystal now uses /bin/sh instead of /bin/bash (See #3809, #4410, thanks @TheLonelyGhost)crystal init generates a .editorconfig file (See #4422, #297, thanks @akzhan)man page for crystal command (See #2989, #1291, thanks @dread-uo)Random::System into a module (See #4542, thanks @oprypin)Regex::MatchData pretty printed (See #4574, thanks @MakeNowJust)String.underscore treats digits as downcase or upcase characters depending previous characters (See #4280, thanks @MakeNowJust)SomeClass.class.is_a?(SomeConst) causing an "already had enclosing call" exception (See #4364, #4390, thanks @rockwyc992)HTTP::Params.parse query string with two = gave wrong result (See #4388, #4389, thanks @akiicat)Class.class.is_a?(Class.class.class.class.class) 🎉 (See #4375, #4374, thanks @rockwyc992)IO::FileDescriptor#seek from current position (See #4558, thanks @ysbaddaden)IO::Memory#gets_to_end to consume the IO (See #4415, thanks @jhass)Process.new(pid) is now private (See #4197)WeakRef#target to WeakRef#value (See #4293)HTTP::Params.from_hash to HTTP::Params.encode (See #4205)'\"' is now invalid, use '"' (See #4309)pp and p, the printed value is returned (See #4285, #4283, thanks @MakeNowJust)SecureRandom#random_bytes(Bytes) (See #4191, thanks @konovod)XML::Node (See #3902, thanks @bmmcginty)File.touch and FileUtils.touch methods (See #4069, thanks @Sija)#values_at for CSV (See #4157, thanks @need47)Time#clone (See #4174, thanks @Sija)ancestors macro method (See #3875, thanks @david50407)skip macro method (#4237, thanks @mverzilli)Colorize.on_tty_only! for easier toggling (See #4075, #4271, thanks @MakeNowJust)WebSocket#on_binary to receive binary messages (See #2774, thanks @lbguilherme)Iterator.of stops iterating when Iterator.stop is returned (See #4208)String#insert for non-ascii Char (See #4164, thanks @Papierkorb)File.link now creates a hard link (#4116, thanks @KCreate)#to_h over empty NamedTuple (See #4076, thanks @karlseguin)NamedTuple#to_h does no longer call to value's #clone (See #4203)Math#gamma and Math#lgamma (See #4229, thanks @KCreate)TCPSocket creation for 0 port for Mac OSX (See #4177, thanks @will)self resolution when including a generic module (See #3972, thanks @MakeNowJust)--no-color option in spec (See #4306, thanks @luislavena)malloc_atomic (see #4081)crystal --version reports also the LLVM version (see #4095, thanks @matiasgarciaisaia)crystal play was broken (see #4061)Atomic can be set to nil (see #4062)GZip::Header extra byte (see #4068, thanks @crisward)ASTNode#to_s for Attribute (see #4098, thanks @olbat){{ run(...) }} is only re-run if the code changesassert { ... } is now it { ... } (thanks @TheLonelyGhost)Set#merge! to Set#concatZlib was split into Flate, Gzip and Zlib (bda40f)Crypto::MD5 is now Digest::MD5String#chop is now String#rchopString#to_slice now returns a read-only SliceString can now hold invalid UTF-8 byte sequences, and they produce a unicode replacement character when traversedString#lchomp. Use String#lchop\xHH escape sequence in string literalsChar::Reader can now traverse a string backwardsEnum#to_s now uses pipes instead of commas for flag enumsIO#read_string is now encoding-awareOAuth2::Client now sends application/json Accept header, and considers the expires_in access token property as optionalSlice can now be read-onlyTCPServer no longer set SO_REUSEPORT to true by defaultHTTP::Multipart and HTTP::FormData (thanks @RX14)File::Stat#pipe?File.utimeIO#peekString#strip(arg), String#lstrip(arg), String#rstrip(arg)String#lchop, String#lchop(prefix), String#rchop and String#rchop(suffix)String#hexbytes and String#hexbytes?String#scrub and String#valid_encoding?include? macro method for StringLiteral, SymbolLiteral and MacroId (thanks @karlseguin)String#index, String#rindex due to Rabin-Karp algorithm (thanks @MakeNowJust).Crypto::Bcrypt (see #3880, thanks @ysbaddaden).expect_raises returns raised exception (thanks @kostya).Zip::File, Zip::Reader and Zip::Writer. Native readers for zip files that delegate compression to existing zlib module.Hash#delete with block (see #3856, thanks @bmulvihill).String#[](char : Char) (see #3855, thanks @Sija).crystal tool expand to expand macro call in a given location (see #3732, thanks @MakeNowJust).crystal play is able to show compilation errors again.crystal doc recognizes crystal-lang/crystal in any remote (thanks @MaxLap).to_json(builder : JSON::Builder) instead of to_json(io : IO). The same is true for custom JSON converters. If you are using JSON.mapping then your code will continue to work without changes.finalize method on a struct now gives a compile errordef foo(x : Int32 = nil) will now fail to compile if foo is invoked without arguments) (thanks @MakeNowJust)each methods now return NilIO#skip(bytes) will now raise if there aren't at least the given amount of bytes in the IO (previously it would work well if there were less bytes, and it would hang if there were more)MemoryIO was removed (use IO::Memory instead)Number#step now requires named arguments, to and by, to avoid argument order confusionYAML::Emitter was renamed to YAML::Builder, and some of its methods were also renamedXML::Node#[] now always returns a String (previously it could also return Nil, which was incorrect)XML::Node#content now returns an empty String when no content is availableHTTP::Client now automatically reconnects on a dropped keep-alive connectionwith ... yield now works well with method_missingEnum.each and Enum#each (thanks @ysbaddaden)Hash#compact and Hash#compact! (thanks @MakeNowJust)IO#read_string(bytesize)IO#skip_to_endIterator#flat_map (thanks @MakeNowJust)JSON.build and JSON::BuilderNamedTuple#has_key?(String) (thanks @Sija)p(NamedTuple) (thanks @splattael)Regex::MatchData#== (thanks @MakeNowJust)String#sub(Regex, NamedTuple) (thanks @maiha)XML.build and XML::BuilderIO#gets, IO#each_line, String#lines, String#each_line, etc. now chomp lines by default. You can pass chomp: false to prevent automatic chomping. Note that chomp is true by default for argless IO#gets (read line) but false if args are given.HTTP::Handler is now a module instead of a class (thanks @andrewhamon)forall, a single uppercase letter will not work anymorelibs directory is no longer in the default CRYSTAL_PATH, use lib (running crystal deps should fix this)private can now be used with macros inside types (thanks @MakeNowJust)-s/--stats option now also shows execution time (thanks @MakeNowJust)-t/--time to show execution time (thanks @MakeNowJust)Socket now allows any family/type/protocol association, and many other improvements (thanks @ysbaddaden)IO can now be passed to from_yaml (thanks @MakeNowJust)class_getter, class_setter, class_property, etc. (thanks @Sija)String#lchomp (thanks @Sija)IO#read_fully?Iterator#flatten (thanks @MakeNowJust)HTTP::WebSocket#ping, pong, on_ping, on_pong, and now a ping message is automatically replied with a pong message (thanks @Sija)File#empty? and Dir#empty? (thanks @dylandrop)Time::Span#/(Time::Span) (thanks @RX14)String#split versions that accept a block (thanks @splattael)URI#normalize and normalize! (thanks @taylorfinnell)reuse optional argument to many Array, Enumerable and Iterable methods that allow you to reuse the yielded/return array for better performance and less memory footprint:debug flag is now present when compiled with --debug, useful for doing flag?(:debug) in macros (thanks @luislavena)Set#merge as renamed to Set#merge!Slice.new(size) no longer works with non primitive integers and floatsargify was renamed to splatp and pp now use it. To get the old behaviour use puts obj.inspectArrayLiteral#[]=, TypeNode#constant, TypeNode#overrides? and HashLiteral#double_splat in macrosfinished macro hook that runs at the end of the programSlice.emptynone? methodIO::ByteFormat has now methods to encode/decode to/from a Sliceit block can now be inside any line of that blockCallConvention attribute can now also be applied to a lib declaration, and all funs inside it will inherit itmethod_missing hook can now define a method, useful for specifying block arguments{{**...}})ifdef from the languagePointerIObody property of HTTP::Request is now an IO? (previously it was String). Use request.body.try(&.gets_to_end) if you need the entire body as a String.MemoryIO has been renamed to IO::Memory. The old name can still be used but will produce a compile-time warning. MemoryIO will be removed immediately after 0.20.0.Char#digit? was split into Char#ascii_number? and Char#number?. The old name is still available and will produce a compile-time warning, but will be removed immediately after 0.20.0.Char#alpha? was split into Char#ascii_letter? and Char#letter?. The old name is still available and will produce a compile-time warning, but will be removed immediately after 0.20.0.Iterable module is now genericString and Char methods are now unicode-aware, for example String#downcase, String#upcase, Char#downcase, Char#upcase, Char#whitespace?, etc.__END_LINE__ magic constant in method default arguments: will be the last line of a call (if the call has a block, it will be the last line of that block)@def inside macros that takes the value of the current methodBenchmark.ips (thanks @RX14)HTTP::Client block initializer to be used when passing an URI (thanks @philnash)JSON.mapping and YAML.mapping getter/setter generation can now be controlled (thanks @zatherz)Time is now serializable to JSON and YAML using ISO 8601 date-time formatIO::MultiWriter (thanks @RX14)String#index(Regex) and String#rindex(Regex) (thanks @zatherz)String#partition and String#rpartition (thanks @johnjansen)FileUtils.cd, FileUtils.mkdir, FileUtils.mkdir_p, FileUtils.mv, FileUtils.pwd, FileUtils.rm, FileUtils.rm_r, FileUtils.rmdir (thanks @ghivert)JSON::Builder#raw_field (thanks @kostya)Enumerable#chunks and Iterator#chunk (thanks @kostya)Iterator#with_indexArray#sort by using introsort (thanks @c910335)require works for the upcoming shards release (this is backwards compatible). See https://github.com/crystal-lang/crystal/pull/2788Atomic and exposed all LLVM atomic instructions to Crystal (needed to implemented multiple-thread support)Process.executable_path (thanks @kostya, @whereami and @ysbaddaden)HTML.unescape (thanks @dukex)Char#+(Int) and Char#-(Int)crystal eval now accepts some flags like --stats, --release and --helpFile.chown and File.chmod (thanks @ysbaddaden)Time::Span.zero (useful for doing sum) (thanks @RX14)OAuth and OAuth2class Gen(Foo) is now possible)def foo(x : T) forall T. The old rule of single-letter name still applies but will be removed in the future.@[Extern] attribute to mark regular Crystal structs as being able to be used in C bindingsChar#to_s when it's ASCII: this improves the performance of JSON and CSV parsingcrystal spec: allow passing --release and other optionscrystal spec: allow running all specs in a given directorycrystal playground: support custom workbook resources (thanks @bcardiff)crystal playground: standard output now understands ANSI colors (thanks @bcardiff)--error-trace to show the full trace (the trace is often useless and makes it harder to understand error messages)private.WeakRef (thanks @bcardiff)select keywordT, T1, U, etc., are now disallowed at the top level, to avoid conflicts with free variablesFoo::Bar::Baz) had some incorrect behaviour that now is fixed. This can break existing code that relied on this incorrect behaviour. The fix is to fully qualify types (::Foo::Bar::Baz)class Bar < Foo(Baz) and include Moo(Baz), all of Foo, Moo and Baz must be defined before that point (this was not always the case in previous versions)x as TString#matchIO#read_nonblockInt#/ now performs floored division. Use Int#tdiv for truncated division (see their docs to learn the difference)|| now does type filteringNamedTuple can now be accessed with strings too (thanks @jhass)Base64 can now encode and decode directly to an IO (thanks @kostya)BigInt now uses GMP implementation of gcd and lcm (thanks @endSly)ECR now supports removing leading and trailing whitespace (<%-, -%>)HTTP::Request#path now never returns nil: it fallbacks to "/" (thanks @jhass)String#tr(..., "") is now the same as String#deletetool hierarchy now supports --format json (thanks @bmulvihill)Char#ascii?Class#nilable? and Union#nilable?Hash#has_value? (thanks @kachick)IO::Sized and IO::Delimited (thanks @RX14)IO::Hexdump (thanks @ysbaddaden)IO#noecho and IO#noecho! (thanks @jhass)Logger.new(nil) to create a null loggerOptionParser#missing_option and OptionParser#invalid_option (thanks @jhass)Process.exists?, Process#exists? and Process#terminated? (thanks @jhass)Process.exec (thanks @jhass)Slice#copy_to, Slice#copy_from, Slice#move_to and Slice#move_from (thanks @RX14)URI#== and URI#hash (thanks @timcraft)YAML#parse(IO)Indexable module that Array, Slice, Tuple and StaticArray includeindent parameter to to_pretty_jsongetter and property macroscompile command was renamed back to build. The compile command is deprecated and will be removed in a future versionrequire "ecr"T? is now parsed as Union(T, Nil) outside the type grammarString#sub overloads for replacing an index or range with a char or stringOpenSSL::SSL::Socket#alpn_protocolIO#copy(src, desc, limit) (thanks @jreinert)TypeNode#instance macro methodTypeNode: added <, <=, > and >= macro methods--profile shows the slowest 10 specs (thanks @mperham)StringLiteral#> and StringLiteral#< in macrosIniFile was renamed to INI, and its method load renamed to parseProcess.getpgid was renamed to Process.pgidException's backtrace is now set when it's raised, not when it's created: it's backtrace method raises if it's not set, and there's backtrace? to get it as a nilable arraydup is now correctly implemented in all types. clone is not defined by default, but some types in the standard library do. Also check Object#def_clonemethod_missing macro only accepts a single argument: a Call now. The form that accepted 3 arguments was removed.delegate macro must now be used like delegate method1, method2, ..., methodN, to: objectHash#each_with_index and Hash#each_with_object now yield a tuple (pair) and an index, because Hash is now Enumerable. Use do |(key, value), index| for this.{"foo": 1} denotes a named tuple literal now, not a hash literal. Use {"foo" => 1} instead. This also applies to, for example HTTP::Headers{...}nil fillers on the yield side (this makes it more explicit that nil was intended to be a block argument value)OpenSSL::SSL::Context and OpenSSL::SSL::Socket can no longer be used directly anymore. Use their respective subclasses OpenSSL::SSL::Context::Client,
with OpenSSL::SSL::Socket::Client, OpenSSL::SSL::Context::Server with OpenSSL::SSL::Socket::Server.HTTP::Client.ssl option was renamed to tls in HTTP::Client, HTTP::Server, HTTP::WebSocket, OAuth::Consumer, OAuth::Signature and OAuth2::AccessToken.dns_timeout setting in a few classes like HTTP::Client and TCPSocket is now ignored until a next version supports a non-blocking getaddrinfo equivalentOpenSSL::SSL::Socket::Client supports server name indication now.build command was renamed to compile. The build command is deprecated and will be removed in a future version--cross-compile flag no longer takes arguments, use --target and -DUnion type that represents the type of a union, which can have class methodsVoid now return NilNil are not checked for a correct return type, they always return nil nowas fails at runtime it now includes which type couldn't be castlib and enum declarationsTuple(*T), Proc(*T)) but there was no syntax to define such types.yield can now be usedsizeof and instance_sizeof can now be used as generic type arguments (mostly useful combined with StaticArray)Hash, HTTP::Headers, HTTP::Params and ENV now include the Enumerable moduleProc is now Proc(*T, R)Tuple(*T).new and NamedTuple(**T).new now correctly match the given T (#1828)Float64#to_s now produces an ever more accurate outputJSON parsing now correctly handle floats with many digitsJSON.mapping and YAML.mapping now also accept named arguments in addition to a hash literal or named tuple literalInt#chr now raises if the integer is out of a char's range. The old non-raising behaviour is now in Int#unsafe_chr.pp x is now x # => ... instead of x = ...debug() macro method now tries to format the code (pass false to disable this)JSON and YAML parsing and mapping for unionsFileUtils.cp_r (thanks @Dreauw)Tuple.from and NamedTuple.from (thanks @jhass)XML.escape (thanks @juanedi)HTTP::Server::Response#respond_with_error (thanks @jhass)TCPServer#accept?base argument to Char#digit? and Char#hex? (thanks @mirek)flag? macro method, similar to using ifdef. ifdef is deprecated and will be removed in a future version.YAML::PullParser#read_rawProc#partialSocket.ip?(str) to validate IPv4 and IPv6 addressesBytes as an alias of Slice(UInt8)RangeLiteral macro methods: begin, end, excludes_end?, map and to_aArrayLiteral#[range] and ArrayLiteral#[from, to] in macros (applicable for TupleLiteral too)Generic macro methods: name, type_vars, named_argstls option in HTTP::Client can now take a OpenSSL::SSL::Context::Client in addition to true.HTTP::LogHandler logs exceptions now (thanks @jhass)HTTP::ErrorHandler does not tell the client which exception occurred by default (can be enabled with a verbose flag) (thanks @jhass)%q{...} and <<-'HEREDOC'. Also added %Q{...} with the same meaning as %{...}.@type inside a macro expression is now automatically detected as being a macro defFloat64#to_s now produces a more accurate outputCrystal::VERSION and other compiler-metadata constantsObject.from_json(string_or_io, root) and a root option to JSON.mappingSystem.hostname (thanks @miketheman)property, getter and setter macros now also accept assignments (property x = 0)record macro now also accepts assignments (record Point, x = 0, y = 0)MacroId and StringLiteral or SymbolLiteral now work as expected (compares the id representation)def initialize(&@block)Tuple.new)NamedTuple.new)foo { |(x, y)| ... }NamedTupleLiteral#map and HashLiteral#map in macros (thanks @jhass){% begin %} .. {% end %} if you needed that behaviouris_a?, for example tuple.is_a?({Int32, String}){foo: 1, bar: 2} now denotes a NamedTuple, not a Hash with symbol as keys. Use {:foo => 1, :bar => 2} insteadexp as Type is now deprecated and will be removed in the next version. Use crystal tool format to automatically upgrade your code!, is_a?, responds_to?, nil?, as or as?NamedTuple typeas?: similar to as, but returns nil when the type doesn't matchNumber::Primitive aliasTuple#+(Tuple)ArrayLiteral#+(ArrayLiteral) in macrosCrypto::MD5 now allows Slice(UInt8) and a block form (thanks @will)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.Int#**(Int) now returns an integer, and raises if the argument is negative. Use a float base or exponent for negative exponents to work.Slice#to_s and StaticArray#to_s now include their type name in the output.crystal directory is now created at $HOME/.cache/crystal or $HOME/.crystal (or others similar), with a fallback to the current directorycrystal 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)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.@x : Int32 = 1 syntax (declaration + initialization)new/initialize logic now works more as one would expectBigRational (thanks @will)BigFloat (thanks @Exilor)String#insertTime::EpochConverter and Time::EpochMillisConverter%s (unix epoch) directive to Time::FormatTime now honours Dayling Saving and ENV["TZ"]HTTP::Server::Response#cookies (thanks @jhass)Array#bsearch, Array#bsearch_index and Range#bsearch (thanks @MakeNowJust)Range#reverse_each iterator (thanks @omninonsense)JSON::Any: added as_...? methods (thanks @DougEverly)JSON::Any is now EnumerableYAML::Any is now EnumerableJSON.parse_raw that returns a JSON::TypeJSON::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 serializableENV: allow passing nil as a value to delete an environment variableHash: 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)File#each_line iteratorNumber.slice, Number.static_array, Slice.[] and StaticArray.[] to easily create slices and static arraysSlice#hexdump (thanks @will)Enumerable#product (thanks @dkhofer)out with Void* pointersXML::Node#namespace_scopes (thanks @Hamdiakoguz)INIFile (thanks @EvanHahn)! has now its meaning hardcoded in the language. If you defined it for a type it won't be invoked as a method anymore.nil? has now its meaning hardcoded in the language. If you defined it for a type it won't be invoked as a method anymore.typeof is now disallowed in alias declarationscrystal tool format --check to check that source code is properly formattedcrystal play (playground) added workbooks support, as well as improvements and stabilizationsTempfile.dirname (thanks @DougEverly)Path#resolve method in macros{{...}} arguments to a macro call are now expanded before macro invocation (#2392)$~ and $?) are now accessible after being defined in blocks (#2194)def foo(arg : Type = default_value). The old def foo(arg = default_value : Type) was removed.Enumerable#take(n) and Iterator#take(n) were renamed to first(n)Socket#addr and Socket#peeraddr were renamed to local_address and remote_address respectivelyComparable#between?(a, z). Use a <= x <= z insteadHTTP::WebSocketHandler callbacks can now access the HTTP::Context. If you had a forwarding method to it you'll need to update it. See #2313.crystal play that opens a playground for you to play in the browser :-) (thanks @bcardiff)crystal env that prints environment informationSpec: you can now run multiple files with specified line numbers, as in crystal spec file1.cr:10 file2.cr:20 ...FileUtils.cp (thanks @Dreauw)Array#first(n) and Array#last(n) (thanks @greyblake)WebSocket#close and properly handle disconnectionsUDPSocket#send and UDPSocket#receive (thanks @tatey)Char#uppercase? and Char#lowercase? (thanks @MaloJaffre`)sync_close property to OpenSSL::SSL::Socket, Zlib::Inflate and Zlib::DeflateXML::Node#encoding and XML::Node#versionHTTP::Client::Response#success? (thanks @marceloboeira)StaticArray#shuffle!(random) (thanks @Nesqwik)Splat#exp method in macrosMutexInt types (except BigInt) can now be used in JSON and YAML mappings (thanks @marceloboeira)Matrix was moved to a separate shard: https://github.com/Exilor/matrixdef foo(arg : Type = default_value). Run crystal tool format to automatically upgrade existing code to this new syntax. The old def foo(arg = default_value : Type) syntax will be removed in a next release.case with a tuple literal. See #2258.property end : Time works as expected.module Moo; @x : Int32; end)module Moo; @x = 1; end)Spec: allow setting multiple output formatters (thanks @marceloboeira)StringScanner: improved performancefoo.[0] = 1 and foo.[0] as valid syntax, similar to the one in &. blocks (thanks @MakeNowJust)CSV: allow separate and quote characters different than comma and double quote (thanks @jreinert)YAML: support merge operator (<<) (thanks @jreinert)Int32#+(other : Int32)[]Levenshtein: improved performance (thanks @tcrouch)HTTP::Client: fixed incorrect parsing of chunked bodyHTTP::Client: added a constructor with an URI argument (thanks @plukevdh)String: sub and gsub now understand backreferences (thanks @bjmllr)Random: added Random#rand(Float64) and Random#rand(Range(Float, Float)) (thanks @AlexWayfer)HTML: HTML.escape includes more characters (thanks @Ryuuzakis)TypeNode.class method in macros (thanks @waterlink)run inside macros now also work with absolute paths (useful when used with __DIR__)Math and StaticArray (thanks @Zavydiel, @HeleneMyr)property, getter, setter, etc., declare instance variables with those types.JSON.mapping and YAML.mapping declare instance variables with the given types.YAML.load was renamed to YAML.parse, and it now returns a YAML::Any.embed_ecr and ecr_file were renamed to ECR.embed and ECR.def_to_s (the old methods now produce a warning and will be removed in the next release).IO#set_encoding, String#encode, and HTTP::Client charset check.record macro can now accept type declarations (for example record Point, x : Int32, y : Int32)Iterator#step (thanks @jhass)Array#push and Array#unshift can now accept multiple values and add the elements in an efficient way (thanks @arktisklada)default option to JSON.mapping (thanks @kostya)default option to YAML.mapping (thanks @jreinert)case foo; when Foo.class (and Foo(T) and Foo(T).class) in case expressions.Class#| so a union type can be expresses as Int32 | Char in regular code.File.real_path (thanks @jreinert)dns_timeout for HTTP::Client (thanks @kostya)sprintf (thanks @gtramontina)Markdown now supports blockquotes and 1 level of list nesting (thanks @SebastianSzturo)p now accepts multiple argumentsproperty x :: Int32 to property x = uninitialized Int32var :: Type to var : Type. The old syntax is still allowed but will be deprecated in the next version (run crystal tool format to automatically fix this)var :: Type, is now var = uninitialized Type. The old syntax is still allowed but will be deprecated in the next version (run crystal tool format to automatically fix this)HTTP::Server refactor to support streaming. Check the docs of HTTP::Server for upgrade instructionsHTTP::WebSocketSession to HTTP::WebSocket.Enumerable#inject to Enumerable#reducenext and return semantic inside captured block has been swapped (#420)libpcl is no longer usedHTTP::StaticFileHandler (thanks @MakeNowJust)seek, tell, pos and pos= from File to IO::FileDescriptor (affects Tempfile)URI.parse is now faster (thanks @will)Int#popcount (thanks @rmosolgo)@[Naked] attribute for omitting a method's preludedef arguments must always be enclosed in parenthesesDir.working_dir to Dir.currentHTML::Builder to its own shardString#split now always keeps all results (never drops trailing empty strings)Array#buffer, StaticArray#buffer and Slice#buffer. Use to_unsafe instead (so unsafe usages are easier to spot)String#cstr. Use to_unsafe instead (so unsafe usages are easier to spot)Int#to_s(base) for base = 62 (thanks @jhass)JSON.parse now returns JSON::Any, which allows traversal of JSON objects with less castsOpenSSL::PKCS5 (thanks @benoist)Object#!~ (the opposite of =~)at_exit now receives that exit status code in the block (thanks @MakeNowJust)Set in JSON mappings (thanks @benoist)File.executable?, File.readable? and File.writeable? (thanks @mverzilli)Array#sort_by and Array#sort_by! now use a Schwartzian transform (thanks @radarek)Array#each_permutation, Array#each_combination and Array#each_repeated_combination iteratorsArray#sample and Array#shuffledelegate macro can now delegate multiple methods to an object (thanks @elthariel)OpenSSL::Cipher and OpenSSL::Digest (thanks @benoist)Char#+(String) (thanks @hangyas)Hash#key and Hash#key? (thanks @adlerhsieh)Time::Span#* and Time::Span#/ (thanks @jbaum98)Slice#reverse_each (thanks @omninonsense)Random and Tempfile (thanks @adlerhsieh)CGI module's functionality has been moved to URI and HTTP::ParamsIO#read() is now IO#gets_to_end. Removed IO#read(count), added IO#skip(count)json_mapping is now JSON.mapping. yaml_mapping is now YAML.mappingStringIO is now MemoryIOcrystal tool format that automatically formats your codeprotected methods can now be invoked between types inside a same namespacecurses, you can use https://github.com/jreinert/ncurses-crystalto_unsafe and numeric conversions are now also automatically performed in C struct and union fields{% begin %} ... {% end %} as an alternative to {% if true %} ... {% end %}~! operatorDir.glob now works well with recursive patterns like ** (thanks @pgkos)read_timeout and connect_timeout to HTTP::Client (thanks @benoist)Zlib (thanks @datanoise and @bcardiff)HTTP::DeflateHandler (thanks @bcardiff)ENV#fetch (thanks @tristil)Hash#new now accepts an initialize capacity argumentHTTP::Request provides access and mutation of query, path and query_params (thanks @waterlink)XML::Node#content= and #name=HTTP::Server (thanks @RX14)crystal init now tries to use your github username if available (thanks @jreinert)Hash#select, Hash#reject and their bang variant, and Hash#each_with_object (thanks @devdazed)Hash#select(*keys) and Hash#reject(*keys) and their bang variant (thanks @sdogruyol)Set#-, Set#^, and Set#subtract (thanks @js-ojus)TypeNode#has_constant? and TypeNode#type_vars in macros (thanks @jreinert)String#compare that allows case insensitive comparisonsFile#truncate (thanks @porras)CSV is now a class for iterating rows, optionally with headers accessbefore_request callbacks to an HTTP::ClientDir.cd(&block) (thanks @rhysd)Class#cast (thanks @will)SemanticVersion class (thanks @technorama)loop now yields a counterArray#[]=(index, count, value) and Array#[]=(range, value)sleepIO#write(slice) now writes the full slice or raises on errorChannelClosed -> Channel::ClosedError,
UnbufferedChannel -> Channel::Unbuffered, BufferedChannel -> Channel::Buffered,
DayOfWeek -> Time::DayOfWeek, MonthSpan -> Time::MonthSpan, TimeSpan -> Time::Span,
TimeFormat -> Time::Format, EmptyEnumerable -> Enumerable::EmptyError, SocketError -> Socket::Error,
MatchData -> Regex::MatchData, SignedInt -> Int::Signed, UnsignedInt -> Int::Unsigned,
FileDescriptorIO -> IO::FileDescriptor, BufferedIO -> IO::Buffered, CharReader -> Char::Reader,
PointerAppender -> Pointer::Appender.DomainError raise ArgumentError now.Type.cast to Type.new (for example, Int32.new instead of Int32.cast)@typeundeflength() and count() methods from collections. The only method for this is now size.crystal deps now delegates to shards. Removed Projecfile support.initialize as privatemethod_added macro hook (thanks @MakeNowJust)ArrayLiteral#includes?(obj) in macrosASTNode#symbolize in macros (thanks @kirbyfan64)yaml_mappingEnumerable#max, Enumerable#min, and others (thanks @technorama)Iterator#flatten (thanks @jpellerin)HTTP::Client (thanks @benoist)Array#delete_at(index, count) and Array#delete_at(range) (thanks @tebakane)HTTP::Cookies (thanks @netfeed)Tuple#reverse (thanks @jhass)Number#clamp (thanks @technorama)WebSocket.open (thanks @kumpelblase2)Enum.flags macrofuture, lazy and delay concurrency methods (thanks @technorama)fork now returns a Process (thanks @technorama)Set, and added a couple of methods (thanks @will)Benchmark.ips, and interactive mode (thanks @will)-f format output is now honored in compiler errors (thanks @kirbyfan64)crystal build command (thanks @MakeNowJust)TypeCastError instead of Exception (thanks @will)Process.run to allow configuring input, output and error, as well as behaving well regarding non-blocking IO (thanks @technorama)alias_method macro.if... this of course didn't work, but incorrectly compiled).require is now only allowed at the top-level, never inside other types or methods.Nil#to_iChannel#select toward a thread-safe one.read(slice : Slice(UInt8)) and write(slice : Slice(UInt8)).browser, hierarchy and types to crystal tool ...crystal tool context and crystal tool implementations for IDEs (thanks @bcardiff!!)Int#>>(amount) and Int#<<(amount) now give zero when amount is greater than the number of bits of the integer representation.\% escape sequence inside macros.Iterator#in_groups_of (thanks @PragTob)offset argument to Hash#each_with_index (thanks @sergey-kucher)Array#combinations, Array#each_combination, Array#repeated_combinations, Array#each_repeated_combination, Array#repeated_permutations, Array#each_repeated_permutation, Array.product and Array.each_product (thanks @kostya)Array#rotate and Array#rotate! (thanks @kostya)MatchData#pre_match and MatchData#post_match (thanks @bjmllr)Array#flattenRange.reverse_each, along with Int#pred and Char#pred (thanks @BlaxPirit)XML.parse_html (thanks @ryanworl)ENV.keys andENV.values (thanks @will)StaticArray==(other : StaticArray) (thanks @tatey)String#sub in many variants (thanks @jhass)Readline.bind_key, Readline.unbind_key, Readline.done and Readline.done= (thanks @daphee)Hash#all?, Hash#any? and Hash#inject (thanks @jreinert)File#pos and File#pos=Enum.from_value and Enum.from_value?Deque (thanks @BlaxPirit)StringScanner, and documented it, making it usable (thanks @will)StringIO now quacks like a File.WebSocket, and sending long data (thanks @kumpelblase2)File.new now accepts an optional perm argument (thanks @technorama)FileDescriptorIO now has configurable read/write timeouts (thanks @technorama)WebSocket close packet (thanks @bebac)seek and tell in buffered IOs (thanks @lbguilherme)crystal init for the "app" case (thanks @krisleech)sleep and IO timeouts can receive TimeSpan as arguments (thanks @BlaxPirit)HTTP::Response without content-length (thanks @lbguilherme)while/until (read this)Enumerable#drop to Enumerable#skipTime.at to Time.epoch, and Time#to_i and Time#to_f to Time#epoch and Time#epoch_finherited macro now runs before a class' body--no-build flag to --no-codegenString#% and sprintf (thanks @zamith)SecureRandom.base64, SecureRandom.urlsafe_base64 and SecureRandom.uuid (thanks @ysbaddaden)File.link, File.symlink and File.symlink? (thanks @ysbaddaden)Enumerable#in_groups_of (thanks @jalyna)Array#zip? (thanks @yui-knk)Array#permutations and Array#each_permutation (thanks @jalyna and @kostya)IO#gets(limit : Int) and IO#gets(delimiter : Char, limit : Int)Iterator#compact_map, Iterator#take_while and Iterator#skip_while (thanks @PragTob)StringLiteral#to_i macro methodCrypto::Bcrypt (thanks @akaufmann)Time.epoch_ms and Time#epoch_msBitArray#toggle and BitArray#invert (thanks @will)IO#reopen swapped semantic (thanks @technorama)0 is not a prefix for octal numbers anymore. Use 0oMissingKey to KeyErrorIndexOutOfBounds to IndexError_ (underscore), give error when trying to read from itAnd, Or, Case, RangeLiteral and StringInterpolation. And and Or have left and right methods.-e option to hierarchy command to filter types by a regex-v as an alias of --version-h as an alias of --helpArray#transpose (thanks @rhysd)Benchmark#ips (thanks @will)Hash#merge(&block) and Hash#merge!(&block) (thanks @yui-knk)Hash#invert (thanks @yui-knk)Bool#^ (thanks @yui-knk)Enumerable#drop, Enumerable#drop_while and Enumerable#take_while (thanks @PragTob)Enumerable#none? (thanks @yui-knk)Set#subset?, Set#superset? and Set#intersects? (thanks @yui-knk)Set#new(Enumerable) (thanks @yui-knk)String#succ (thanks @porras and @Exilor)Array#* (thanks @porras)Char#===(Int) and Int#===(Char) (thanks @will)StringLiteral#camelcase and StringLiteral#underscore in macrosExpressions#expressions in macrosCast#obj and Cast#to in macrosASTNode#class_name in macros (thanks @yui-knk)Array#push/Array#<< and Array#unshift in macros (thanks @ysbaddaden)Def#visibility in macros (thanks @ysbaddaden)String#codepoints and String#each_codepoint (thanks @jhass)Char#to_i(base) now supports bases from 2 to 36Set#| now correctly accepts a set of a possible different type (thanks @yui-knk)STDERR on exit (thanks @jbbarth)HTTP::Client methods accept an optional block, which will yield an HTTP::Response with a non-nil body_io property to consume the response's IOURI, UDPSocket (thanks @davydovanton)URI class (thanks @will)$~ in String#gsub and String#scan$? in Process.run0o as a prefix for octal numbers (thanks @asb)String#split(Regex) now includes captures in the resultsunion?, union_types and type_params in macro methodsMatchData#to_s to show named groups (thanks @will)ARGFnil instead of an empty string (thanks @will)$1?, $2?, etc., as a nilable alternative to $1, $2, etc.HTTP::Client.exec now honors user/password info from URIHTTP::ClientString#chopcrystal deps behaviour with empty git repositories (thanks @tkrajcar)HTTP::Headers and HTTP::Request parsing.FileDescriptorIO (superclass of File and Socket) has now buffering capabilities (use sync= and sync? to turn on/off). That means there's no need to use BufferedIO for these classes anymore.pointerof with class and global variables, and also foo.@bar access.crystal cache dir is now configurable with an ENV variable (thanks @jhass)Tuple.from_json and Tuple.to_jsonmethod_missing macro now accepts a 1 argument variant that is a Call node. The 3 arguments variant will be deprecated.print not showing any output)Time#to_utc and Time#to_local (thanks @datanoise)IO#gets(delimiter : String)String#chomp(Char) and String#chomp(String)debug() inside a macro to see what's being generated.IO#puts and IO#print now receive a splat (thanks @rhysd)Process.kill and Process.getpgid (thanks @barachy)Signal is now an enum. Use it like Signal::INT.trap { ... } instead of Signal.trap(Signal::INT) { ... }CSV.each_row (both in block and iterator forms)crystal init (thanks @niftyn8)%x and %X in sprintf (thanks @yyyc514)Int#to_s (thanks @yyyc514)upcase option to Int#to_s, and use downcase by default.String#to_i and fixed the many variants (to_i8, to_u64, etc.)Time.at (thanks @jeromegn)Int#upto, Int#downto, Int#to iterators.Iterator#cons and Enumerable#each_cons (thanks @porras)Iterator.of, Iterator#chain and Iterator#tap.private macro (similar to top-level private def)BufferedIO writing performance and memory usage.Channel#close, Channel#closed?, Channel#receive? and allow them to send/receive nil values (thanks @datanoise).Process#run after introducing non-blocking IO (thanks @will)Tuple#map now returns a Tuple (previously it returned an Array)Tuple#class now returns a proper Class (previously it returned a Tuple of classes)spawn and Channel.crystal init to quickly create a skeleton library or application (thanks @waterlink)--emit flag to the compiler. Now you can easily see the generated LLVM IR, LLVM bitcode, assembly and object files.--no-color flag to suppress color output, useful for editor tools.%var and %var{x, y} create uniqely named variables inside macros.Iterator and many methods that return iterators, like Array#each, Hash#each, Int#times, Int#step, String#each_char, etc.sprintf and improved String#% to support floats and float formatting.String#gsub.Pointer#clear and use it to clear an Array's values when doing pop and other shrinking methods.BigInt#to_s(base), BigInt::cast and bit operators (thanks @Exilor)lib and adding more @[Link] attributes to it, even allowing duplicated attributes.->LibC.getenv)ditto for a doc comment to reuse the previous comment.%: previously it meant remainder, not it means modulo, similar to Ruby and Python. Added Int#remainder.#to_s and #inspect now work for a union class.before_each and after_each hooks, which will simplify the use of mocking libraries like timecop.cr and webmock.cr.Range(T) is now Range(B, E) again (much more flexible).class method now works in all cases. You can now compare classes with == and ask their hash value.Range(B, E) is now Range(T).Number::[]. Now you can do Int64[1, 2, 3] instead of [1_i64, 2_i64, 3_u64].Crypto::Blowfish (thanks @akaufmann)Matrix (thanks @Exilor)CallConvention attribute for funs.constants so you can inspect a type's constants at compile time.methods, which lists a type's methods (without including supertypes).has_attribute? for enum types, so you can check if an enum has the Flags attribute on it.$~ and $? are now method-local and concurrent-safe.Tuple is now correctly considered a structPointer is now correctly considered a structFunction to ProcRandom is now a module, with static methods that default to the Random::MT19937 class.Random::ISAAC engine (thanks @ysbaddaden!)String#size (thanks @zamith!)limit to all String#split variants (thanks @jhass!)path option to Projectfile for crystal deps (thanks @naps62!)HTML.escape(String) (thanks @naps62!)%w[...], %w{...}, %w<...> as alternatives to %w(...). Same goes for %i(...) (thanks @zamith!)Enumerable#min_of, Enumerable#max_of and Enumerable#minmax_of, Enumerable#to_h, Dir.chdir and Number#fdiv (thanks @jhass!)String#match, String#[], String#[]? and MatchData#[]? related to regexes (thanks @jhass!)T::Bar when T is a generic type argument.subclasses and all_subclasses in macros.to_s and inspect on C structs and unions, making debugging C bindings much easier!#to_f and #to_i to Time and TimeSpan (thanks @epitron!)IO.select (thanks @jhass!)ifdef inside C structs and unions.include inside C structs, to include other struct fields (useful for composition and avoiding an explicit indirection).Char#in_set?, String#count, String#delete and String#squeeze (thanks @jhass!)-D flag option to the compiler to set compile-time flags to use in ifdef.Function primitives in Crystal itself, and added methods for obtaining the pointer and closure data, as well as for recreating a function from these.Logger class (thanks @ysbaddaden!)Random and Random::MT19937 (Mersenne Twister) classes (thanks @rhysd).!= bug.doc command had some hardcoded paths and didn't workprivate def at the top-level of a file is only available inside that filecrystal doc command to automatically generate documentation for a project using Markdown syntax. The style is still ugly but it's quite functional. Now we only need to start documenting things :-)@: attribute syntax.{{yield}} inside macros now preserve the yielded node location, leading to much better error messages.Float#nan?, Float#infinite? and Float#finite?.src and crystal compiler libs directory from CRYSTAL_PATH.require "foo" always looks up in CRYSTAL_PATH. require "./foo" looks up relative to the requiring file.Json to JSON, Xml to XML and Yaml to YAML to follow a convention.require "http/client" instead of the old require "net/http".alias_method macro (thanks @Exilor and @jtomschroeder).Complex number methods and many math methods, refactors and specs (thanks @scidom).[] of Thread) is now possible.alias F = Int32 ->, &block : F).json_mapping macro supports a simpler syntax: json_mapping({key1: Type1, key2: Type2}).be_a(type) matcher.be > ... and similar matchers for >=, < and <=.File::file? and File::directory?.crystal foo.cr -o foo the build command is assumed instead of run.:+, :*, :[], etc.).TimeSpan#ago, TimeSpan#from_now, MonthSpan#ago and MonthSpan#from_now.should or should_not fail, the filename and line number, including the source's line, is included in the error message.-l switch to be able to run a spec defined in a line.crystal spec file:lineproperty name :: Type.lib. They inherit Enum, can have methods and can be marked with @[Flags].lib enums and regular enums.class, def, etc. inside a call block.enum Name < BaseType has been deprecated. Use enum Name : BaseType.Array#<=> and make it comparable to other arrays.crystal build ..., crystal run ..., crystal spec, etc.). The default is to compiler and run a program.crystal eval without arguments reads from standard input.crystal deps command.__FILE__, __DIR__ and __LINE__, when used as def default arguments, resolve to the caller location (similar to D and Swift)as to determine a type even if the casted value doesn't have a type yet.is_a? in macros. The check is against an AST node name. For example node.is_a?(HashLiteral).emit_null property to json_mapping.converter property to json_mapping.pp in macros.to_pretty_json.CSV.parse.Regex.escape.String#scan.-e switch to spec, to run specs that match a pattern.--fail-fast switch to spec.HTTPClient#basic_auth.DeclareVar, Def and Arg macro methods.Time and TimeSpan structs. TimeWithZone will come later.Array#fill (thanks @Exilor).Array#uniq.File.read_lines.{% ... %} so that you can interpret code without outputting the result.\ at the end of a line.if and unless inside macro expressions.fun/def as @[Raises] (useful when a function can potentially raise from a callback).@[Raises].OAuth2::Client supports getting an access token via authorization code or refresh token.\ with a newline between them.Set {1, 2, 3} and HTTP::Headers {"content-type": "text/plain"}. These just create the type and use << or []=.Dir::glob and Dir::Entries (thanks @jhass)ensure as an expression suffix.no block given message with new.{"foo": "bar"} # :: Hash(String, String)ifdef as a suffix.DivisionByZero exception.type Name : Type syntax (use type Name = Type instead).lib Lib("libname"); end syntax. Use @[Link] attribute instead.require issues.record macro is now variadic, so instead of record Vec3, [x, y, z] write record Vec3, x, y, z.def_equals, def_hash and def_equals_and_hash macros are now variadic.property, getter and setter macros are now variadic.String#length returns the number of characters, while String#bytesize return the number of bytes (previously length returned the number of bytes and bytesize didn't exist).String#[](index) now returns a Char instead of an UInt8, where index is counted in characters. There's also String#byte_at(index).\x escape sequence in char and string literals. Use \u instead.initialize methods are now protected.IO#gets_to_end....) and %x(...) for command execution.%r(...) for regular expression literals.--release sets a release flag that you can test with ifdef.type Name = Type (type Name : Type will be deprecated).@[Attr(...)] instead of @:Attr. The old syntax will be deprecated in a future release.@[Link("name")] (uses name as pkg-config name if available or -lname instead), @[Link(ldflags: "...")] to pass raw flags to the linker, @[Link("name", static: true)] to try to find a static library first, and @[Link(framework: "AppKit")] (for Mac OSX).exec method to execute shell commands. Added the system and backtick similar to Ruby ones.be_truthy and be_falsey spec matchers. Added Array#zip without a block. (thanks @mjgpy3)getter? and property? macros to create methods that end with ?.CGI module.cc for compiling (removed dependency to llc, opt, llvm-dis and clang).IO#tty?.yield and block.call crashes the compiler.\u unicode escape sequences inside strings and chars (similar to Ruby). \x will be deprecated as it can generate strings with invalid UTF-8 byte sequences.String#chars.initialize.private and protected visibility modifiers, with the same semantics as Ruby. The difference is that you must place them before a def or a macro call.-e flag stopped working.@length compile-time variable available inside tuples that allows to do loop unrolling.make_named_tuple macro to record.def_equals, def_hash and def_equals_and_hash macros to generate them from a list of fields.Slice(T), which is a struct having a pointer and a length. Use this in IO for a safe API.StaticArray fixes and enhancements.-> operator for pointers of structs/unions: instead of foo->bar use foo.value.bar; instead of foo->bar = 1 use foo.value.bar = 1.colorize file that provides methods to easily output bash colors.x = [] of IO).for.method_missing now works in generic types.responds_to? wasn't working with generic types.String#replace(Regex, String)Box(T) class, useful for boxing value types to pass them to C as Void*.def foo(x : {_, _}).generate_hash macro that generates a hash methods based on some AST nodes.previous_def: similar to super, but uses the previous definition of a method. Useful to decorate existing methods (similar to alias_method_chain). For now the method's type restrictions must match for a previous definition to be found.env in macros, to fetch an environment value. Returns a StringLiteral if found or NilLiteral if not.return 1, 2 be the same as return {1, 2}. Same goes with break and next.Pointer#as_enumerable(size : Int) to create an Enumerable from a Pointer with an associated size, with zero overhead. Some methods removed from Pointer: each, map, to_a, index.StaticArray::new, StaticArray::new(value), StaticArray::new(&block), StaticArray#shuffle! and StaticArray#map!.Char#to_s(io : IO)to_unsafe method. This removed the hardcoded rule for converting a String to UInt8* and also allows passing an Array(T) to an argument expecting Pointer(T)..is_a?(Class) not working (#162)macro def name(args) : ReturnType instead of def name(args) : ReturnType, which was a bit confusing.Int#to_s(radix : Int) (was renamed to to_s_in_base in the previous release) by also specifying a restriction in Int#to_s(io : IO).expect_raises macros in specs@name inside macros with @class_name.@ symbols in their names.Array#each_indexString#* for the case when the string has length one.GC.malloc_atomic for String and String::Buffer (as they don't contain internal pointers.)PointerAppender struct to easily append to a Pointer while counting at the same time (thanks @kostya for the idea).Base64 module (thanks @kostya)new on a function type. For example: alias F = Int32 -> Int32; f = F.new { |x| x + 1 }; f.call(2) #=> 3.@name to @class_name inside macros. @name will be deprecated in the next version.inherited, included and extendedmethod_missing macro{{ raise ... }} inside macros to issue a compile error.at_exit handlers are run when you invoke exitto_s and inspect: you must override them receiving an IO objectRemoved icr (a REPL): it is abandoned for the moment because it was done in a hacky, non-reliable way
Added very basic String#underscore and String#camelcase.
The parser generates string literals out of strings with interpolated string literals. For example, "#{__DIR__}/foo" is interpolated at compile time and generates a string literal with the full path, since __DIR__ is just a (special) string literal.
(breaking change) Now macro nodes are always pasted as is. If you want to generate an id use {{var.id}}.
Previously, a code like this:
macro foo(name)
def {{name}}; end
end
foo :hello
foo "hello"
foo hello
generated this:
def hello; end
def hello; end
def hello; end
With this change, it generates this:
def :hello; end
def "hello"; end
def hello; end
Now, to get an identifier out of a symbol literal, string literal or a name, use id:
macro foo(name)
def {{name.id}}; end
end
Although it's longer to type, the implicit "id" call was sometimes confusing. Explicit is better than implicit.
Invoking id on any other kind of node has no effect on the pasted result.
Allow escaping curly braces inside macros with \{. This allows defining macros that, when expanded, can contain other macro expressions.
Added a special comment-like pragma to change the lexer's filename, line number and column number.
# foo.cr
a = 1
#<loc:"bar.cr",12,24>b = 2
c = 3
In the previous example, b = 2 (and the rest of the file) is considered as being parsed from file bar.cr at line 12, column 24.
Added a special run call inside macros. This compiles and executes another Crystal program and pastes its output into the current program.
As an example, consider this program:
# foo.cr
{{ run("my_program", 1, 2, 3) }}
Compiling foo.cr will, at compile-time, compile my_program.cr and execute it with arguments 1 2 3. The output of that execution is pasted into foo.cr at that location.
Added ECR (Embedded Crystal) support. This is implemented using the special run macro call.
A small example:
# template.ecr
Hello <%= @msg %>
# foo.cr
require "ecr/macros"
class HelloView
def initialize(@msg)
end
# This generates a to_s method with the contents of template.ecr
ecr_file "template.ecr"
end
view = HelloView.new "world!"
view.to_s #=> "Hello world!"
The nice thing about this is that, using the #<loc...> pragma for specifying the lexer's location, if you have a syntax/semantic error in the template the error points to the template :-)