Arc Forumnew | comments | leaders | submitlogin
Ask almkglor: Does (zap cdr s) work for scanners? (arclanguage.org)
1 point by akkartik 6329 days ago | 2 comments


1 point by almkglor 6326 days ago | link

I suspect what confused you here is the assumption that scanners work like input streams: once you execute (readc stream), the stream state changes. However, scanners are functional and are equivalent to monads in this case; if you keep the old version of the scanner, it's still the old state of the scanner that you'll use.

-----

1 point by almkglor 6328 days ago | link

http://arclanguage.com/item?id=6892

Do you have any particular examples which make you think that it doesn't? Arki, the wiki in Anarki, makes use of (zap cdr s) on scanners quite a bit.

-----