diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-09 17:33:46 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-09 17:33:46 -0800 |
commit | dd68bf698a5618226fb3807d752c4ff73966cb5f (patch) | |
tree | c2da5348387f6c75aa225f00ecbc5b2f7e198788 /match.c | |
parent | 357121301094005f6c56471fb18f9ff1b6bc8d13 (diff) | |
download | txr-dd68bf698a5618226fb3807d752c4ff73966cb5f.tar.gz txr-dd68bf698a5618226fb3807d752c4ff73966cb5f.tar.bz2 txr-dd68bf698a5618226fb3807d752c4ff73966cb5f.zip |
Changing representation of objects to allow the NUM type to be
unboxed. If the lowest bit of the obj_t * pointer is 1, then
the remaining bits are a number. A lot of assumptions are made:
- the long type can be converted to and from a pointer
- two's complement.
- behavior of << and >> operators when the sign bit is involved.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -296,7 +296,7 @@ obj_t *match_line(obj_t *bindings, obj_t *specline, obj_t *dataline, elem = first(specline); - switch (elem ? elem->t.type : 0) { + switch (elem ? type(elem) : 0) { case CONS: /* directive */ { obj_t *directive = first(elem); @@ -362,7 +362,7 @@ obj_t *match_line(obj_t *bindings, obj_t *specline, obj_t *dataline, bindings = acons_new(bindings, sym, sub_str(dataline, pos, nil)); pos = length_str(dataline); } - } else if (pat->t.type == STR) { + } else if (type(pat) == STR) { obj_t *find = search_str(dataline, pat, pos, modifier); if (!find) { LOG_MISMATCH("var delimiting string"); @@ -750,7 +750,7 @@ void do_output_line(obj_t *bindings, obj_t *specline, for (; specline; specline = rest(specline)) { obj_t *elem = first(specline); - switch (elem ? elem->t.type : 0) { + switch (elem ? type(elem) : 0) { case CONS: { obj_t *directive = first(elem); |