From ed1f47b5a467b8401ea965382cb194fc479213a9 Mon Sep 17 00:00:00 2001 From: Todd Nowacki Date: Mon, 22 Jul 2024 15:04:27 -0700 Subject: [PATCH] comments --- reference/src/functions/macros.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/src/functions/macros.md b/reference/src/functions/macros.md index 92431cde..e496b1f2 100644 --- a/reference/src/functions/macros.md +++ b/reference/src/functions/macros.md @@ -521,10 +521,11 @@ public macro fun maybe_s($s: S, $cond: bool): S { } ``` -Even though `foo()` will abort, it's return type can be used to start a method call. +Even though `foo()` will abort, its return type can be used to start a method call. -`$s` will not be evaluated if `$cond` is `false`. Son under a normal non-method call, an argument of -`foo()` would not be evaluated and would not abort. +`$s` will not be evaluated if `$cond` is `false`, and under a normal non-method call, an argument of +`foo()` would not be evaluated and would not abort. The following example demonstrates `$s` not +being evaluated with an argument of `foo()`. ```move maybe_s!(foo(), false) // does not abort @@ -537,7 +538,8 @@ if (false) foo() else S() ``` -However, when using method syntax, the first argument is evaluated before the macro is expanded. +However, when using method syntax, the first argument is evaluated before the macro is expanded. So +the same argument of `foo()` for `$s` will now be evaluated and will abort. ```move foo().maybe_s!(false) // aborts