<div dir="ltr">2008/8/26 <a href="mailto:yoursurrogategod@gmail.com">yoursurrogategod@gmail.com</a> <span dir="ltr"><<a href="mailto:yoursurrogategod@gmail.com">yoursurrogategod@gmail.com</a>></span><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ok, based on your suggestions, here is what I have.<br>
<br>
Eshell V5.5.5  (abort with ^G)<br>
1> Q1 = queue:new().<br>
{[],[]}<br>
2> Q2 = queue:in("foo", Q1).<br>
{["foo"],[]}<br>
3> Q3 = queue:in("bar", Q2).<br>
{["bar"],["foo"]}<br>
4> Q4 = queue:in("blah", Q3).<br>
{["blah","bar"],["foo"]}<br>
5> Q5 = queue:in("stuff", Q4).<br>
{["stuff","blah","bar"],["foo"]}<br>
6> Q6 = queue:out(Q5).<br>
{{value,"foo"},{["stuff","blah"],["bar"]}}<br>
7> Q7 = queue:in("stuff1", Q6).<br>
<br>
=ERROR REPORT==== 25-Aug-2008::20:23:40 ===<br>
Error in process <0.31.0> with exit value: {badarg,[{queue,in,<br>
["stuff1",{{value,"foo"},{["stuff","blah"],["bar"]}}]},<br>
{erl_eval,do_apply,5},{erl_eval,expr,5},{shell,exprs,6},<br>
{shell,eval_loop,3}]}<br>
<br>
** exited: {badarg,[{queue,in,<br>
                           ["stuff1",<br>
                            {{value,"foo"},{["stuff","blah"],<br>
["bar"]}}]},<br>
                    {erl_eval,do_apply,5},<br>
                    {erl_eval,expr,5},<br>
                    {shell,exprs,6},<br>
                    {shell,eval_loop,3}]} **<br>
<br>
For some reason, when I tried to add on to Q7 after removing a value,<br>
it crashed. One thing that I discovered was when I did > Q6., I got<br>
the below:<br>
<br>
{{value,"foo"},{["stuff","blah"],["bar"]}}<br>
<br>
I managed to get at the list that contains stuff and blah (which is a<br>
little odd).</blockquote><div><br>queue:out returns <span class="bold_code">{{value, Item}, Queue}  or  {empty, Queue}, i.e. it returns both the value and the remaining queue after the value has been removed. If there was a value it is returned as {value,Value} otherwise 'empty' is returned.<br>
<br>Returning multiple values in a tuple is common practice in erlang, actually it is almost the only way to do it.<br><br>Robert<br><br></span> </div></div><br></div>