Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要与此等效的水晶:
clazz = 'ExampleClass'.constantize # Rails clazz = Object.const_get('ExampleClass') # pure Ruby obj = clazz.new
你不能,这些动态方面在 Crystal 中是不可能的。
但是,宏可能需要很长时间。请阅读这个类似的问题和讨论:
https://github.com/manastech/crystal/issues/949