diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-01 19:18:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-01 19:18:57 -0800 |
commit | 18dd42f65e620326bb21ffcde92004cc9705cbf8 (patch) | |
tree | 7d343914189779a0470bc74f85ba5593bab89c9e /tests/013/maze.expected | |
parent | aea62af9451ce1da9db494aa07cdfb0087fa1473 (diff) | |
download | txr-18dd42f65e620326bb21ffcde92004cc9705cbf8.tar.gz txr-18dd42f65e620326bb21ffcde92004cc9705cbf8.tar.bz2 txr-18dd42f65e620326bb21ffcde92004cc9705cbf8.zip |
New range type, distinct from cons cell.
* eval.c (eval_init): Register intrinsic functions rcons,
rangep from and to.
(eval_init): Register rangep intrinsic.
* gc.c (mark_obj): Traverse RNG objects.
(finalize): Handle RNG in switch.
* hash.c (equal_hash, eql_hash): Hashing for for RNG objects.
* lib.c (range_s, rcons_s): New symbol variables.
(code2type): Handle RNG type.
(eql, equal): Equality for ranges.
(less_tab_init): Table extended to cover RNG.
(less): Semantics defined for ranges.
(rcons, rangep, from, to): New functions.
(obj_init): range_s and rcons_s variables initialized.
(obj_print_impl): Produce #R notation for ranges.
(generic_funcall, dwim_set): Recognize range objects for indexing
* lib.h (enum type): New enum member, RNG. MAXTYPE redefined
to RNG value.
(TYPE_SHIFT): Increased to 5 since there are now 16 type
codes.
(struct range): New struct type.
(union obj): New member rn, of type struct range.
(range_s, rcons_s, rcons, rangep, from, to): Declared.
(range_bind): New macro.
* parser.l (grammar): New rule for recognizing
the #R sequence as HASH_R token.
* parser.y (HASH_R): New terminal symbol.
(range): New nonterminal symbol.
(n_expr): Derives the new range symbol.
The n_expr DOTDOT n_expr rule produces rcons expression rather
than const.
* match.c (format_field): Recognize rcons syntax in fields
which is now what ranges translate to. Also recognize range
object.
* tests/013/maze.tl (neigh): Fix code which destructures
range as a cons. That can't be done any more.
* txr.1: Document ranges.
Diffstat (limited to 'tests/013/maze.expected')
0 files changed, 0 insertions, 0 deletions