Anonymous user
Queue/Definition: Difference between revisions
m
→{{header|J}}: formatting
(→{{header|J}}: Added implementation involving only functional programming.) |
m (→{{header|J}}: formatting) |
||
Line 847:
Function-level technique, with no reliance on mutable state:
<lang J>pop =: ( {.^:notnull ; }. )@: > @: ] /▼
▲pop =: ( {.^:notnull ; }. )@: > @: ] /
push =: ( '' ; ,~ )& > /
tell_atom =: >& {.
Line 857 ⟶ 856:
onto =: [ ; }.@]
notnull =: [: -. 0 e. $</lang>
See also [[FIFO (usage)#J]]
|