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/
g++ -c -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc `/usr/bin/llvm-config --cxxflags`
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -D_FORTIFY_SOURCE=2 -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
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.
/tmp/yaourt-tmp-unshadow/aur-crystal-git/src/crystal-0.23.1-3/bin/crystal: line 102: 805 Aborted (core dumped) "$INSTALL_DIR/embedded/bin/crystal" "$@"
make: *** [Makefile:117: .build/crystal] Error 134
Kemal::Base.get
and an instance method Kemal::Base#get
. Currently, when I call get
from inside a instance method, it calls the macro, but I would expect it to call the instance method. And it's ugly if you have to invoke the instance method with explicit receiver...
class MyApp < Kemal::Application
get "/" do |env|
"hello"
end
end
MyApp.run
class MyApp < Kemal::Application
get "/" do |env|
"hello"
end
# `instance_routes` could be a macro that will define the `initialize_instance_routes` method
instance_routes do # Here using `with .. yield`, the instance routes can be configured with another DSL (could be methods, .. whatever)
get "/foo" do |env|
"bar"
end
end
end
app = MyApp.new
app.initialize_instance_routes
app.run
get
method would actually call route_handler.add_route("GET", path, &block)