2. about me
• @karupanerura (Twitter/Github/etc..)
• Perl/Swift/C/Java/etc..
• Crystal/Ruby beginner
• Lead Engineer of Mobile Factory, Inc.
• Talk on YAPC::Asia/YAPC::EU 2015
11. Nil safety
def foo() : String? # = String|Nil
return "Foo" # or nil
end
foo = foo()
if foo != nil then
foo.not_nil! # = String
end
# foo.length => compile error!!
12. Nil safety
• implementation is very simple!
• https://github.com/manastech/crystal/
blob/master/src/object.cr#L149
• https://github.com/manastech/crystal/
blob/master/src/nil.cr#L117
13. Generics
• Optional typing + generics = great!
• MyClass(T) and use it.
• POINT: Type specialization is supported
• POINT: Type restriction is optional.
14. Using PCRE
• Perl5 hacker loves PCRE :)
• Perl extended regexp is available