this script
Fred = object( name="Fred", spouse="wilma", friends=["barney"] );
Wilma = object( name="Wilma", spouse=Fred, friends=["Betty"] );
Fred2 = object( Fred, friends=["barney",Wilma]);
echo(Fred2 =Fred2, "\n");
echo( fps = Fred2.spouse, "\n", Fred2.friends, "\n" );
ECHO: Fred2 = ["barney", { name = "Wilma"; spouse = { name = "Fred"; spouse = "wilma"; friends = { name = "Fred"; spouse = "wilma"; friends = ["barney"]; }; friends = ["Betty"]; }]; }
Fred2 is looking like a vector starting with “[“
expanding to show structure:
["barney",
{ name = "Wilma";
spouse = {
name = "Fred";
spouse = "wilma";
friends = {
name = "Fred";
spouse = "wilma";
friends = \["barney"\];
};
friends = \["Betty"\];
}
\];
}
this looks wrong
is my script doing something wrong
I'm pretty sure that the conversion to a string is somehow loused up.
Here's a pretty minimal demonstration.
Wilma = object(
spouse=object()
);
echo( Wilma=Wilma);
Betty = object(
friends=[Wilma]
);
echo( Betty = Betty );
yields
ECHO: Wilma = { spouse = { }; }
ECHO: Betty = [{ spouse = { friends = { }; }]; }
It looks like the brackets from the friends member somehow end up in the
wrong places.
I've filed Bad output converting object to string #6048
https://github.com/openscad/openscad/issues/6048.
Interesting. The structure seems fine but the printing goes haywire. I expect that the array print function flushes and thereby races ahead of the object print out.
I'll verify and let you know. Thanks!
Peter
On 28 Jul 2025, at 23:16, vulcan_--- via Discuss discuss@lists.openscad.org wrote:
this script
Fred = object( name="Fred", spouse="wilma", friends=["barney"] );
Wilma = object( name="Wilma", spouse=Fred, friends=["Betty"] );
Fred2 = object( Fred, friends=["barney",Wilma]);
echo(Fred2 =Fred2, "\n");
echo( fps = Fred2.spouse, "\n", Fred2.friends, "\n" );
ECHO: Fred2 = ["barney", { name = "Wilma"; spouse = { name = "Fred"; spouse = "wilma"; friends = { name = "Fred"; spouse = "wilma"; friends = ["barney"]; }; friends = ["Betty"]; }]; }
Fred2 is looking like a vector starting with “[“
expanding to show structure:
["barney",
{ name = "Wilma";
spouse = {
name = "Fred";
spouse = "wilma";
friends = {
name = "Fred";
spouse = "wilma";
friends = ["barney"];
};
friends = ["Betty"];
}
];
}
this looks wrong
is my script doing something wrong
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Thanks Jordan
BTW .. i confirmed it is a printing problem by forming a vector of name=value pairs from my test object
it printed out correctly
I’ve created a PR #6051 that fixes this.
Was just an output issue.
On Wed 30 Jul 2025 at 19:04, vulcan_--- via Discuss <
discuss@lists.openscad.org> wrote:
Thanks Jordan
BTW .. i confirmed it is a printing problem by forming a vector of
name=value pairs from my test object
it printed out correctly
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org