Zulip Chat Archive

Stream: general

Topic: reflect bool


view this post on Zulip Simon Hudon (Aug 03 2018 at 06:26):

I'm running the following code:

run_cmd eval_expr bool (reflect tt) >>= trace

bool has an instance of has_reflect and the above is type correct but when I run it I get the following error:

VM does not have code for 'bool.tt'

What can I do?

view this post on Zulip Mario Carneiro (Aug 03 2018 at 10:13):

There is definitely a bug somewhere in the workings of eval_expr

view this post on Zulip Mario Carneiro (Aug 03 2018 at 10:14):

workaround:

run_cmd eval_expr bool (reflect (id tt)) >>= trace

view this post on Zulip Minchao Wu (Aug 03 2018 at 10:14):

looks like magic

view this post on Zulip Simon Hudon (Aug 03 2018 at 13:40):

Thanks! I was able to use this trick with user_attribute.get_param_untyped to replace user_attribute.get_param

view this post on Zulip Simon Hudon (Aug 03 2018 at 13:41):

(by wrapping the return with id: to_expr ``(id %%r))


Last updated: May 17 2021 at 23:14 UTC