summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-05 20:18:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-05 20:18:58 -0700
commiteb2d229637284ac6b8822357ce59c007742c825c (patch)
treef98faa041513dacb9cbec438a86a686486c086fc /stream.h
parentf64eaa8c6839247c4e3023d244fdc328fd455e8d (diff)
downloadtxr-eb2d229637284ac6b8822357ce59c007742c825c.tar.gz
txr-eb2d229637284ac6b8822357ce59c007742c825c.tar.bz2
txr-eb2d229637284ac6b8822357ce59c007742c825c.zip
nullify and empty: convert to seq_info.
Issues: (nullify 1..1) doesn't return nil as it should, and (empty 1) fails. * lib.c (seq_info): Since we would like nullify to use seq_info, seq_info cannot call nullify. Transplant the probing of the nullify method out of nullify and into here. (nullify): Obtain a seq_info_t on the object. If it's not a sequence and is not range, then just return the object. Otherwise obtain a seq_iter_t sequence and peek whether it has a next item. (empty): Similarly, obtain an iterator and peek. Definition of empty is relocated to be next to nullify. * lib.h: Relocate declaration of empty, also.
Diffstat (limited to 'stream.h')
0 files changed, 0 insertions, 0 deletions