These are chat archives for dry-rb/chat

13th
Jan 2016
Tim Riley
@timriley
Jan 13 2016 06:17
Oop, we hit another case. Heh. Renaming some classes in the short term :)
Hannes Nevalainen
@kwando
Jan 13 2016 09:51
@solnic Form:Schema always need some "type-predicate" to work?
Piotr Solnica
@solnic
Jan 13 2016 09:51
no, type expectations are not required, string will be assumed
if something isn’t working w/o a type expectation than it’s a bug
Hannes Nevalainen
@kwando
Jan 13 2016 09:53
if I only have a key(:some_key) without a rule block that field will not get through to the result.params hash
This message was deleted
Piotr Solnica
@solnic
Jan 13 2016 09:53
I see
report it as a bug
for now just do key(:some_key, &:str?)
Hannes Nevalainen
@kwando
Jan 13 2016 09:54
will do
Hannes Nevalainen
@kwando
Jan 13 2016 10:05
reported, I learnt a ton of stuff figuring that out. Including a building a compiler :smile:
Piotr Solnica
@solnic
Jan 13 2016 10:05
it’s simple stuff once you understand it
it’s actually 10 x simpler than messing with complex objects
and the abstract representation is so useful as it’s portable
I actually think it’s the best approach for building DSLs in Ruby
where a DSL simply gathers data in a form of an ast
and then you can do whatever you want with that
Hannes Nevalainen
@kwando
Jan 13 2016 10:10
Yeah, I appreciate the beauty of it now when digging through the code. Very easy to understand
Tim Riley
@timriley
Jan 13 2016 10:24
AST FTW!