Open chrisseaton opened 4 years ago
An idea for this is to use define_method
+ copy_captured_locals
which is basically a way to embed constants (in this case the Symbols of the Struct attributes) in the generated method.
However that doesn't allow to unroll the loop (+ specialize for each attribute) easily.
One way is to have the define_method
itself in an class_eval
, then we can generate code from Strings + reference constants.
https://github.com/oracle/truffleruby/pull/1789#discussion_r342100201