Re: Some compiler issues and a request for debugging/design help
Andrew Glynn <[email protected]> Tue, 18 Jun 2013 18:00:46 -0700
| Newsgroups | gmane.comp.lang.dylan.gwydion.devel |
|---|---|
| Message-ID | <CANmAu+ae=16GcpkW9LXpMz5nOjHq2ESUrs+ANObcqQAG--M0Yg@mail.gmail.com> |
I think the problem with instantiating <board-type> is that the 'limited'
function doesn't support an init-value: keyword. Presumably it is just
being ignored at run-time. So when you instantiate an object of type
<board-type> it attempts to fill it with the default value of #f, which
naturally doesn't work. What you need to do is provide the fill: keyword
argument when you actually instantiate the object (not in the call to
'limited'). So if you change the type declaration to this:
define constant <board-type> = limited(<vector>, of: <tile-or-false>, size:
96);
Later on you can instantiate it like this:
make(<board-type>, fill: $the-empty)
I believe this should work whether or not <tile-or-false> allows #f as a
value. Although I suppose it should just be called <tile> if #f is not
allowed.
As for the <board-type-2d> version, as far as I can tell there really is a
compiler bug having to do with limited arrays not properly supporting the
dimensions keyword.
-Andrew
_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers