<div dir="ltr">I couldn't figure out a way to bring back line numbers but here's READ and DATA...<div><br></div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)">// Define your data</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">let</span> DATA = [<span style="color:rgb(39,42,216)">5</span>,<span style="color:rgb(39,42,216)">7</span>,<span style="color:rgb(39,42,216)">1</span>,<span style="color:rgb(39,42,216)">6</span>,<span style="color:rgb(39,42,216)">7</span>]</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)">// Change the Int below to whatever type of DATA you have</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">let</span> READ = {() -> () -> <span style="color:rgb(112,61,170)">Int</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"> <span style="color:rgb(187,44,162)">in</span> <span style="color:rgb(187,44,162)">var</span> g=<span style="color:rgb(79,129,135)">DATA</span>.<span style="color:rgb(61,29,129)">generate</span>();<span style="color:rgb(187,44,162)">return</span> {()<span style="color:rgb(187,44,162)">in</span> <span style="color:rgb(187,44,162)">return</span> g.<span style="color:rgb(61,29,129)">next</span>()!}}()</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)">// And now you read</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(61,29,129)">print</span>( <span style="color:rgb(79,129,135)">READ</span>() )</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(61,29,129)">print</span>( <span style="color:rgb(79,129,135)">READ</span>() + <span style="color:rgb(79,129,135)">READ</span>() )</p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="color:rgb(61,29,129)">print</span>( <span style="color:rgb(79,129,135)">READ</span>() * <span style="color:rgb(79,129,135)">READ</span>() )</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><br></p><div>It's like magic and stuff.</div><div><br></div>-david</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 10:46 PM, Bee via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Does anyone here remember gwbasic? There is one feature of gwbasic that I miss from modern programming language. It's the pair of READ function and DATA statement. An example here: <a href="http://www.antonis.de/qbebooks/gwbasman/data.html" target="_blank">http://www.antonis.de/qbebooks/gwbasman/data.html</a></div><div><div><br></div><div><br></div></div></div></blockquote></div></div></div>