We Learn FunC
@learnfunc
Learn the ins and outs of the #FunC for @ton_blockchain with us! Follow for tips, tricks, and code snippets to take your coding skills to the next level.
Need to add some explanations to a block of code in #FunC? Use multi-line comments, they start with {- and end with -} #codingprotips
Want to add some notes to your #FunC code? Use single-line comments, like this: int x = 1; ;; assign 1 to x #programmingtips #BuildOnTON
Using the ~touch function in #FunC will move a variable to the top of the stack and return its value. Example: result = ~touch(my_var) #codingprotips #ton
Need to access a specific component of a tuple in #FunC? Use the at function: at(my_tuple, index) #programmingknowhow #tonblockchain
Want to move a variable to the top of the stack in #FunC? Use the touch function: touch(my_var) #devtips #ton
Checking for null values in #FunC is easy with the null? function: null?(my_var) #codinghacks #ton #tonblockchain
Want to perform a multiple-then-divide operation in #FunC without worrying about overflow? Use the muldiv function: result = muldiv(a, b, c) #programmingtricks #tonblockchain
Debugging your #FunC code just got easier! Use the ~dump function to log the value of a variable: ~dump(my_var) #devlife
In #FunC, true is represented by -1 and false is represented by 0. This makes working with booleans simple and efficient! #codinglife
Want to add some error handling to your #FunC code? Use the parametrized versions of the throw primitives: throw_arg_if(exception, err_code, condition) #programmingtips
Did you know in #FunC, you can throw exceptions using the throw_if and throw_unless primitives? Use them like this: throw_if(err_code, condition) #codingtips
United States Trends
- 1. Godzilla 25.5K posts
- 2. Shabbat 3,335 posts
- 3. Trench 7,647 posts
- 4. $DUOL 2,766 posts
- 5. Barca 99.5K posts
- 6. Lamine 68K posts
- 7. Brujas 29.3K posts
- 8. #dispatch 40.9K posts
- 9. Barcelona 156K posts
- 10. Brugge 50.4K posts
- 11. Captain Kangaroo N/A
- 12. Toledo 10.4K posts
- 13. Flick 39K posts
- 14. Richardson 3,459 posts
- 15. Alastor 89.9K posts
- 16. Sharia 122K posts
- 17. Jared Golden 2,279 posts
- 18. Foden 22.9K posts
- 19. SCOTUS 38.1K posts
- 20. Darius Garland 1,107 posts
Something went wrong.
Something went wrong.