Hi there guys, how can I modify an specific element of a tuple? I imagine this won't work right: my_tuple.at(index) = 1 for example. Is it possible?

Aug 10, 2023, 7:45 AM
You can use the following function:
forall X -> (tuple, ()) set_at(tuple t, X value, int index) asm "SETINDEXVAR";
my_tuple~set_at(1, index);
Aug 10, 2023, 8:06 AM
so where can we get these function api info? I don't find them in the official documents
Aug 10, 2023, 10:28 AM
This is assembler intrinsic for https://docs.ton.org/learn/tvm-instructions/instructions.
Aug 10, 2023, 10:29 AM
Oh, it is in the TVM instructinos, not FunC cookbook. Thanks a lot.
Aug 10, 2023, 10:32 AM

© 2024 Draquery.com All rights reserved.