[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representation
Re: [Chicken-hackers] [PATCH] [CHICKEN 5] Change numerics representations
Tue, 9 Aug 2016 14:15:56 -0400
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
+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
(define (frob? 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