2008/5/8 DougEdmunds <<a href="mailto:dougedmunds@gmail.com" target="_blank">dougedmunds@gmail.com</a>>:<br><div class="gmail_quote"><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Could someone show me how to modify beersong.erl<br>
(on <a href="http://trapexit.org" target="_blank">trapexit.org</a>) so it puts the result out into<br>
a variable?<br>
<br>
i.e. > Beersong = beersong:sing(), io:format("~p~n),[Beersong].<br>
</blockquote><br><br></div>sing_verse(Bottle) -><br> sing_verse(Bottle, []).<br><br>sing_verse(-1, Song) -><br> lists:reverse(Song);<br>sing_verse(Bottle, Song) -><br> receive<br> {Bottle, Verse} -><br>
sing_verse(Bottle-1, [lists:flatten(Verse)|Song])<br> after 3000 -><br> io:format("Verse not received after 3 seconds"<br> " - re-starting singer~n"),<br>
spawn_singer(Bottle),<br> sing_verse(Bottle, Song)<br> <br></div>
</div><br>