[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representation
From: |
John Cowan |
Subject: |
Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representations |
Date: |
Tue, 9 Aug 2016 14:15:56 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Peter Bex scripsit:
> Here's a radical idea: How about removing the plain "pointer" type? It
> can be implemented as a tagged pointer with a tag of whatever we like
> (for example #f). It does mean that each and every pointer needs another
> word of storage, but most code doesn't rely on pointers very heavily
> anyway.
+1. We added a word to symbols, which are much more common than pointers,
when we gave them p-lists, and nobody complained. Tagged pointers are
useful because the tag gives them a Scheme-detectable type, so that you
can write:
(define (frob? obj)
(and
(tagged-pointer? obj)
(eq? (pointer-tag obj) 'frob)))
and treat this subset of pointers just like any other Scheme type.
By contrast, tag-free pointers can't be safely introspected on, so
polymorphic code can't do anything with them.
--
John Cowan http://www.ccil.org/~cowan address@hidden
You know, you haven't stopped talking since I came here. You must
have been vaccinated with a phonograph needle.
--Rufus T. Firefly