Problems with Dynamic Objects extension

I’ve been trying to use the Dynamic Objects extension by Jesse McGrew, but whenever I clone an object, all of their properties are linked to the properties of the original (and any additional clones), such that changing the properties of one changes the properties of all of them. I assume this is what “fixing” properties is for (“Section: Handling block value properties” in the documentation), but attempting to use it (including using the example from the documentation) causes a run-time error:

*** Value handling failed: impossible allocation ***

*** Run-time problem P49: Memory allocation proved impossible.

Since I was unable to find any information about that specific error, I talked to Jesse, who said that there may have been changes to I7 that caused it to no longer work, and suggested that I ask here so that someone who is more aware of anything that may have changed in Inform might be able to help.

1 Like

Here’s a patched Dynamic Objects in my fork of the Friends repo. It changes:

Include (-
[ DO_UnlinkProp prop obj  v;
	v = obj.prop;
	obj.prop = BlkValueCreate(v-->BLK_HEADER_KOV);
	BlkValueCopy(obj.prop, v);
];
-).

To fix the/-- cloned (P - pointer value valued property) property/--: (- DO_UnlinkProp({P}, (+ new object +)); -).

to

Include (-
[ DO_UnlinkProp prop obj v;
v = obj.prop;
obj.prop = BlkValueCreate(BlkValueWeakKind(v));
BlkValueCopy(obj.prop, v);
];
-).

and of things I’ve tried, it appears to work for texts, but not lists.

2 Likes

The part we’re struggling to get working is actually the dynamic tabloes extension. Even after replacing outdated syntax, we still get this:

Problem. You wrote ‘Include (- [ CheckTableEntryIsBlank tab col r […] k_LU->(row%8))) rtrue; rfalse; ]; -) replacing “Testing Blankness” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line450): but this is not a form of Inter code inclusion I recognise, because the clause at the end telling me where to put the code excerpt is not one of the possibilities I know.

See the manual: 27.26 > 27.26. Overriding definitions in kits


Problem. You wrote ‘Include (- [ ForceTableEntryBlank tab col row […] TableEntryIsBlank_LU->(row%8)); ]; -) replacing “Force Entry Blank” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line465): again, this is not a form of Inter code inclusion I recognise.


Problem. You wrote ‘Include (- [ ForceTableEntryNonBlank tab col […] leEntryIsNonBlank_LU->(row%8)); ]; -) replacing “Force Entry Non-Blank” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line481): again, this is not a form of Inter code inclusion I recognise.


Problem. You wrote ‘Include (- [ TableSwapBlankBits tab row1 row2 […] tryIsNonBlank_LU->(row2%8)); } ]; -) replacing “Swapping Blank Bits” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line504): again, this is not a form of Inter code inclusion I recognise.


Problem. You wrote ‘Include (- [ TableMoveBlankBitsDown tab row1 […] tryIsNonBlank_LU->(row2%8)); } ]; -) replacing “Moving Blank Bits Down” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line532): again, this is not a form of Inter code inclusion I recognise.


Problem. You wrote ‘Include (- [ PrintTableName T; switch(T) { { […] print “** No such table **”; } ]; -) replacing “Print Table Name” in “Tables.i6t”’ [](source:/home/sunroses/Inform/Extensions/Jesse McGrew/Dynamic Tables.i7x#line569): again, this is not a form of Inter code inclusion I recognise.

1 Like

The method of handling inclusions that replace functions has changed in 10.1.2. Instead of being done relative to named sections of code, they are done relative to I6 entity names (e.g. routine names). Using the last Problem Message that you list as an example, the correct coda to the inclusion would be replacing "PrintTableName". instead of replacing "Print Table Name" in "Tables.i6t".

There have also been significant changes to the way that properties are handled, however, so I am not sure that the version that you are using will work correctly even if the replacing clauses are updated. There was someone who recently did some work trying to modify the extension to be 10.1.2 compliant and reported some success. See the thread at Dynamic allocation in Inform 7 v10? and associated link to the updated version.

1 Like

This is true, but in general the I6->Inter->I6 compilation process should take them in its stride, producing code that aligns with the new paradigm. Is there something you know of that contradicts this assertion?

1 Like

No, nothing specific. I just dimly recall from having looked through the 6M62/9.3 version of the extension that it does unusual things with properties, so I wanted to provide a heads-up that there might be trouble.

2 Likes