crystal
crystal copied to clipboard
The Crystal Programming Language
Currently the only way to "test" a semantic version string is to rescue from `SemanticVersion.parse`. Such helper methods would be really convenient given that there's no regex or alternative method...
On Windows, it is possible to query the null device `File::NULL = "NUL"`'s info, or open it: ```crystal File.info(File::NULL).type # => File::Type::CharacterDevice File.open("NUL", "r+") do |f| f.puts "abc" # okay...
## Bug Report The following code: ```cr def synchronize(&block) yield end while false begin synchronize { i = 1 } rescue break end end ``` Fails with: ``` Missing hash...
When checking whether a `Float32` or `Float64` is finite, both in Crystal code itself via `#finite?` and in certain primitive conversions like `Float64::MAX.to_f32`, the check is done with `x !=...
Some yielding methods in the macro language like `RangeLiteral#each` allocate a new node on each iteration: https://github.com/crystal-lang/crystal/blob/f17b565cd5cd9bd96dbba85d1e94c7d2cacbf21b/src/compiler/crystal/macros/methods.cr#L1115-L1125 This means `{% (0...10000).each { } %}` allocates 10000 `NumberLiteral` nodes. However, since...
When you `raise` in a file, then check your exit status from the terminal, you'll see `1`, but it seems if that raise comes from within a `Process`, then you...
`crystal spec` currently has one option `--example STRING` (or `-e STRING`) to *only* execute examples which contain `STRING` in their name (it's supposed to cover the *entire* name, but is...
Crystal currently relies on iconv or GNU libiconv for conversions between text encodings. This has a few problems: * iconv does not guarantee the support for any encoding at all,...