so-dang-cool / dt

dt - duct tape for your unix pipes
https://dt.plumbing/
BSD 3-Clause "New" or "Revised" License
430 stars 12 forks source link

`deq` and `pop` should fail for empty quotes #38

Closed booniepepper closed 1 year ago

booniepepper commented 1 year ago

deq (de-queue) and pop should fail on empty quotes.

This is required to preserve a symmetry for something like [ 1 2 3 ] deq enq and [ 1 2 3 ] pop push.

This is especially important since code like 1 [ ] deq enq should result in an error before enq can run. Ending up with [ 1 ] would be surprising, and this is even more surprising if it's used by a command relies on deq/enq in ways that a caller can't know.

booniepepper commented 1 year ago

Same for first and last