For the complete documentation index, see llms.txt. This page is also available as Markdown.

StructValueSet

Build a Set containing the values of a Struct, deduplicating automatically.

The backing variant can be configured; use "linked" to preserve the Struct's value iteration order.

Method Signature

StructValueSet(struct=[struct], type=[string])

Arguments

Argument
Type
Required
Description
Default

struct

struct

true

The struct whose values should populate the set.

type

string

false

The backing variant: "default" / "hash" (HashSet), "linked" / "ordered" (LinkedHashSet, preserves Struct iteration order), or "sorted" / "tree" (TreeSet).

default

Examples

Get the values of a struct as a Set

Duplicate values are merged, so the Set may be smaller than the struct.

s = { a: 1, b: 1, c: 2 }.valueSet();
writeOutput( s.size() );

Result: 2

Using the standalone function form

Result: 2

Last updated

Was this helpful?