Queue/Usage: Difference between revisions
Content added Content deleted
(→{{header|ALGOL 68}}: Queue/Definition) |
|||
Line 39: | Line 39: | ||
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-2.7 algol68g-2.7].}} |
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-2.7 algol68g-2.7].}} |
||
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of '''format'''[ted] ''transput''.}} |
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of '''format'''[ted] ''transput''.}} |
||
'''File: prelude/link.a68''' c.f. [[Queue/Definition#ALGOL 68|Queue/Definition]]<br> |
|||
'''File: prelude/queue_base.a68''' c.f. [[Queue/Definition#ALGOL 68|Queue/Definition]]<br> |
|||
'''File: test/data_stigler_diet.a68'''<lang algol68># -*- coding: utf-8 -*- # |
'''File: test/data_stigler_diet.a68'''<lang algol68># -*- coding: utf-8 -*- # |
||
MODE DIETITEM = STRUCT( |
MODE DIETITEM = STRUCT( |
||
Line 56: | Line 59: | ||
# -*- coding: utf-8 -*- # |
# -*- coding: utf-8 -*- # |
||
MODE |
MODE OBJVALUE = DIETITEM; |
||
PR read "prelude/ |
PR read "prelude/link.a68" PR;# c.f. [[rc:Queue/Definition]] # |
||
PR read "prelude/queue_base.a68" PR; |
PR read "prelude/queue_base.a68" PR; # c.f. [[rc:Queue/Definition]] # |
||
PR read "test/data_stigler_diet.a68" PR; |
PR read "test/data_stigler_diet.a68" PR; |
||
OBJQUEUE example queue; obj queue init(example queue); |
|||
FOR i TO UPB stigler diet DO |
FOR i TO UPB stigler diet DO |
||
# |
# obj queue put(example queue, stigler diet[i]) or ... # |
||
stigler diet[i] +=: example queue |
stigler diet[i] +=: example queue |
||
OD; |
OD; |
||
printf($"Get |
printf($"Get remaining values from queue:"l$); |
||
WHILE NOT |
WHILE NOT obj queue is empty(example queue) DO |
||
# OR example queue ISNT |
# OR example queue ISNT obj queue empty # |
||
printf((diet item fmt, |
printf((diet item fmt, obj queue get(example queue), $l$)) |
||
OD</lang>'''Output:''' |
OD</lang>'''Output:''' |
||
<pre> |
<pre> |
||
Get |
Get remaining values from queue: |
||
Cabbage: 111 lb. = $ 4.11 |
Cabbage: 111 lb. = $ 4.11 |
||
Dried Navy Beans: 285 lb. = $16.80 |
Dried Navy Beans: 285 lb. = $16.80 |
||
Line 82: | Line 85: | ||
Total Annual Cost: = $39.93 |
Total Annual Cost: = $39.93 |
||
</pre> |
</pre> |
||
'''See also:''' [[ |
'''See also:''' [[Stack#ALGOL_68|Stack]] |
||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |