23 Mar 2006 21:14
[stack] Implementing Joy sets
John Cowan <cowan <at> ccil.org>
2006-03-23 20:14:48 GMT
2006-03-23 20:14:48 GMT
As some of you know, I've been working for a long time on a replacement interpreter for Joy in Chicken Scheme. I chose Chicken because its compiler generates C which can be compiled stand-alone, so we can maintain the program in Scheme (very clean and pretty, unlike the existing C) and then distribute it as C (even uglier than the existing C). Of course the Scheme implementation would be made available as well. I'm now at the point where I want to implement Joy sets. The obvious approach is to use a Chicken integer wrapped in a structure, as the C interpreter does. However, a native Chicken integer is only 31 bits long (or 63 bits on 64-bit architectures). Unfortunately, the standard setlib.joy assumes at least 32-bit sets are provided by the implementation. As a result, it allows the manipulation of truth tables with up to five variables. Limiting sets to 31 elements would constrain the library to four variables only. There is a Chicken extension that supports arbitrary-precision integers, but they are fairly expensive to use. What do people recommend? -- -- In politics, obedience and support John Cowan <cowan <at> ccil.org> are the same thing. --Hannah Arendt http://www.ccil.org/~cowan Yahoo! Groups Links <*> To visit your group on the web, go to:(Continue reading)
RSS Feed