At the moment the FunctionBuilder only allows args to be added via with_arg(). In the io::Assembler::parse_fn() it's using a for-loop to pump args in one at a time, which feels a bit clumsy. Adding a .with_args() would be good IMO, taking a slice of pairs, or even an iterator.
I've also used the following to fold the builder, which felt more functional than a for-loop, but is still fairly inelegant:
At the moment the
FunctionBuilder
only allows args to be added viawith_arg()
. In theio::Assembler::parse_fn()
it's using a for-loop to pump args in one at a time, which feels a bit clumsy. Adding a.with_args()
would be good IMO, taking a slice of pairs, or even an iterator.I've also used the following to fold the builder, which felt more functional than a for-loop, but is still fairly inelegant: