Commit a57792f95b35d10bdb60a0a0020eea1c4001167b
1 parent
66a7d78b
add unput_line function for Stream. With it, a line can unput to stream in 1 ope…
…ration. It's most useful than unput_byte.
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
anubis_dev/library/tools/streams.anubis
| ... | ... | @@ -460,7 +460,14 @@ public define List(String) |
| 460 | 460 | ) = |
| 461 | 461 | read_lines(s, []). |
| 462 | 462 | |
| 463 | - | |
| 463 | +public define One | |
| 464 | + unput_line | |
| 465 | + ( | |
| 466 | + Stream s, | |
| 467 | + String line | |
| 468 | + )= | |
| 469 | + forget(map((Word8 c) |-> ub(s)(c) , reverse(explode(line)))). | |
| 470 | + | |
| 464 | 471 | public define One |
| 465 | 472 | skip_blanks |
| 466 | 473 | ( | ... | ... |