[Prev][Next][Index][Thread]

Re: A Dylan parser-generator.



In article <38FE96BB.291B4F3C@cup.hp.com>, eric_gouriou@hp.com wrote:

> necessary runtime
> elements for Dylan (like a <bit-vector>, class you can find in the guts of FD,
> undocumented, but which would need to be implemented for GD)

::sigh::  I need to find more time to work on Dylan.  Back about September
I did some proof-of-concept stuff that appeared to show that you could
relatively easily implement limited collections in d2c such that some
things such as... 

limited(<vector>, of: <boolean>)
limited(<vector>, of: limited(<integer>, min: n, max: n+1))  or
limited(<vector>, of: type-union(singleton(foo), singleton(bar)))

... would all be implemented as bit vectors with suitable packing and
unpacking and encoding and decoding operations hidden in element() and
element-setter().


Of course, if you just want a one-off bit vector then you can implement it
pretty easily and efficiently and non-portably in d2c using an <integer>
slot with the "sizer:" slot attribute and suitable applications of
logior(), logand(), and ash().

As a matter of fact, that is exactly what I'm planning -- a limited (and
fixed) number of specialised non-portable classes that are instantiated by
an appropriate "make" method.

-- Bruce



References: