<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 21, 2017, at 7:32 PM, rintaro ishizaki <<a href="mailto:fs.output@gmail.com" class="">fs.output@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:helvetica;font-size:12px" class="">lifetime guaranteed to be around until the method call completes</span></blockquote><div class=""><br class=""></div><div class="">AFAIK, this is true.</div><div class="">However, in this case, it's not a method call. The lifetime is only guaranteed until <font face="monospace, monospace" class="">getter:increment</font> completes.</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="color:rgb(79,129,135);font-variant-ligatures:no-common-ligatures" class="">Demo</span><span style="font-variant-ligatures:no-common-ligatures" class="">().</span><span style="color:rgb(79,129,135);font-variant-ligatures:no-common-ligatures" class="">increment</span><span style="font-variant-ligatures:no-common-ligatures" class="">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)" class="">3</span><span style="font-variant-ligatures:no-common-ligatures" class="">)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">|--------------| lifetime</span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div></div></div></div></blockquote><div><br class=""></div><div><div class="">Thanks! This is an interesting explanation. </div><div class=""><br class=""></div><div class="">It is curious that naming the variable cases different behavior.</div><div class="">IOW, this doesn’t have a problem:</div><div class=""><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">let</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class=""> demo = </span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">Demo</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">demo.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">increment</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">3</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div><div class=""><br class=""></div><div class="">Lifetime seems to last the entire expression. </div><div class=""><br class=""></div><div class="">Ray</div></div></div></body></html>