[ argh. iOS mail doesn’t always do a good job of picking which of my email addresses to use. Some of you probably got this directly; sorry for the resend. ]
Adrian gives a good summary of “operator module” versus “object module”. A few more tidbits…
Although such a distinction can be mentally useful, the language draws absolutely no distinction between the two.
From the perspective of the language, any module invocation can be passed zero or more children.
It is syntactically legal to say either of these:
translate([5,5,5]);
cube(10) sphere(20);
Neither is useful, because translate() doesn’t do anything except modify children, and cube() doesn’t
do anything with its children, but they are syntactically valid and well defined.
Some modules (but not all) that do not expect children will generate an error if you give them children. Modules that are only useful with children could (but I don’t think any builtins do) generate an error if not provided with a child. But that’s not part of the language and not part of the syntax; it’s part of the definition of that particular module, along the same lines as what arguments the module accepts and what the legal values are for those arguments.
let(), echo(), and assert() are modules. (They are also all operators, in expression context, but we’re not talking about that here.) let() is useful only with children. I’m a little surprised that the other two accept and process children, but they do.
From my perspective, if a particular construct (like those you provide
below) are useless, I would want a warning, since I clearly would never
create such intentionally.
On 8/1/2025 3:08 AM, Jordan Brown via Discuss wrote:
It is syntactically legal to say either of these:
Neither is useful, because translate() doesn’t do anything except
modify children, and cube() doesn’t
do anything with its children, but they are syntactically valid and
well defined.
Some modules (but not all) that do not expect children will generate
an error if you give them children. Modules that are only useful with
children could (but I don’t think any builtins do) generate an error
if not provided with a child. But that’s not part of the language and
not part of the syntax; it’s part of the definition of that particular
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
From my perspective, if a particular construct (like those you provide below) are useless, I would want a warning, since I clearly would never create such intentionally.
I personally agree, but others complain every time such warnings are added because their program that “used to work” no longer does.
I imagine that this category of warnings could be enabled/disabled as a
group in Options, to serve both types of users
On 8/1/2025 8:03 AM, Jordan Brown wrote:
From my perspective, if a particular construct (like those you
provide below) are useless, I would want a warning, since I clearly
would never create such intentionally.
I personally agree, but others complain every time such warnings are
added because their program that “used to work” no longer does.