Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
ego_script [2026/07/22 18:01] hermann |
ego_script [2026/07/22 20:26] (current) hermann |
||
|---|---|---|---|
| Line 118: | Line 118: | ||
| [ | [ | ||
| "PatchId*#string", "Area", "Category", | "PatchId*#string", "Area", "Category", | ||
| - | "007", 12.4, "forest", | + | 007, 12.4, "forest", |
| - | "013", 8.7, "pasture" | + | 013, 8.7, "pasture" |
| ] | ] | ||
| </code> | </code> | ||
| - | Here ''PatchId'' is forced to String even though its values look numeric — preserving the leading zero, which would otherwise be lost if it were read as the number ''7'' — while ''Area'' and ''Category'' are inferred as Real and String respectively, straight from their own values. | + | Without the ''#string'' override, ''PatchId'''s unquoted values would be inferred as Real numbers — ''007'' would collapse to the number ''7'', losing its leading zero. The explicit type forces String interpretation instead, preserving each value exactly as written. ''Area'' and ''Category'' are left to plain inference: Real from ''12.4''/''8.7'', String from the quoted ''"forest"''/''"pasture"''. |
| A call can mix all forms with variable references in a single argument list: | A call can mix all forms with variable references in a single argument list: | ||
| Line 525: | Line 525: | ||
| Converting abbreviated syntax to verbose is always lossless. Converting verbose to abbreviated is only possible when all hooks are free of comments, properties, and identifiers that do not appear in the expression. | Converting abbreviated syntax to verbose is always lossless. Converting verbose to abbreviated is only possible when all hooks are free of comments, properties, and identifiers that do not appear in the expression. | ||
| + | |||
| + | > **Note:** This distinction applies only to saved or generated script text. The graphical interface always displays and edits a calculator functor's expression in the verbose ''i1''/''t1''/''v1'' form, with each hook represented as its own functor node, regardless of whether the //Use abbreviated syntax// option is enabled or which form the underlying file uses. The ''#name''/''%name''/''$name'' abbreviated form exists only in script text; the graphical interface has no corresponding abbreviated representation. | ||
| A common situation where this matters: if you connect a map or lookup table purely to define the output format — not because it is referenced in the expression — connecting it via a ''NumberMap'' or ''NumberTable'' hook will block abbreviated syntax, since the hook defines an identifier absent from the expression. Use the dedicated port instead: the ''Result Format'' input port for map calculators, or the ''Base Lookup Table'' input port for lookup table calculators. These connections do not create hooks and do not affect the availability of abbreviated syntax. | A common situation where this matters: if you connect a map or lookup table purely to define the output format — not because it is referenced in the expression — connecting it via a ''NumberMap'' or ''NumberTable'' hook will block abbreviated syntax, since the hook defines an identifier absent from the expression. Use the dedicated port instead: the ''Result Format'' input port for map calculators, or the ''Base Lookup Table'' input port for lookup table calculators. These connections do not create hooks and do not affect the availability of abbreviated syntax. | ||