3 ms·
* RBS (Types) * single line method definitions (def ... = ...) * case...in * pin operator * rightward assignment (42 => int) * use of the above to destruct
by kayodelycaon 5y ago
* RBS (Types)
* single line method definitions (def ... = ...)
* case...in
* pin operator
* rightward assignment (42 => int)
* use of the above to destruct arrays and hashes ( x => { b: foo } ; foo #=> 2 )
- gls2ro 5y agoFor RBS I don't yet have a case, but thank you for reminding me about single line definitions, case...in, and destructing arrays and hashes. I should play a bit with them and see if they provide any help to write more readable code.
- kayodelycaon 5y agoI usually do def red; “red”; end The new syntax is a bit cleaner def red = “red” But it looks too much like def color name = “red” name end