Queue/Usage: Difference between revisions
Content added Content deleted
Line 745: | Line 745: | ||
E also has queues in the standard library such as <code><import:org.erights.e.examples.concurrency.makeQueue></code>, but they are designed for concurrency purposes and do not report emptiness but rather return a promise for the next element. |
E also has queues in the standard library such as <code><import:org.erights.e.examples.concurrency.makeQueue></code>, but they are designed for concurrency purposes and do not report emptiness but rather return a promise for the next element. |
||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA 3. |
ELENA 3.4 : |
||
<lang elena>import system'collections. |
<lang elena>import system'collections. |
||
import extensions. |
import extensions. |
||
public program |
|||
[ |
[ |
||
console. |
|||
// Create a queue and "push" items into it |
// Create a queue and "push" items into it |
||
var queue := Queue new. |
var queue := Queue new. |
||
Line 769: | Line 771: | ||
// is thrown. |
// is thrown. |
||
queue pop | if(:e)[ console writeLine:"Queue empty.". ]. |
queue pop | if(:e)[ console writeLine:"Queue empty.". ]. |
||
] |
]</lang> |
||
=={{header|Elisa}}== |
=={{header|Elisa}}== |