The Crystal programming language | http://crystal-lang.org | Fund Crystal's development: http://is.gd/X7PRtI | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/
FooBar(...)
is recognized as a generic type (like Array(String)
)
macros need to be evaluated before everything but also after everything :D
http://www.reactiongifs.com/wp-content/uploads/2013/10/tim-and-eric-mind-blown.gif
Unsafe.new.io || "Empty..."
IO
, or pledge to return an IO
, you can only return that, no nil
def read_input : String?; ...; end
. It may return a String, or nil. In this case, the compiler will force you to work with the result in a type-safe manner
Ubuntu 16.04.2 LTS
$ crystal build test.cr --release
crystal: /var/cache/omnibus/src/llvm/llvm-3.8.1.src/lib/CodeGen/LexicalScopes.cpp:160: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const llvm::DILocalScope*): Assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed.
/usr/bin/crystal: line 102: 7523 Aborted (core dumped) "$INSTALL_DIR/embedded/bin/crystal" "$@"
--no-debug