### Implement LazyLoadContext for Custom Data Loading in Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Demonstrates how to implement the `Context` interface in Go for lazy loading of variables from an external source. This custom context loads values on-demand when accessed via the `Get` method, improving efficiency for frequently changing or large datasets. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) // LazyLoadContext loads variables on-demand type LazyLoadContext struct { loaded map[string]any loader func(key string) (any, bool) } func NewLazyLoadContext(loader func(string) (any, bool)) *LazyLoadContext { return &LazyLoadContext{ loaded: make(map[string]any), loader: loader, } } func (c *LazyLoadContext) Get(name string) (any, bool) { if val, ok := c.loaded[name]; ok { return val, true } if val, ok := c.loader(name); ok { c.loaded[name] = val return val, true } return nil, false } func (c *LazyLoadContext) Set(name string, value any) error { c.loaded[name] = value return nil } func main() { engine, _ := uwasa.NewEngineVM(`if premium_user then credit = credit + 100`) // Simulate lazy loading from external source ctx := NewLazyLoadContext(func(key string) (any, bool) { fmt.Printf("Loading %s from external source\n", key) switch key { case "premium_user": return true, true case "credit": return int64(500), true } return nil, false }) result, _ := engine.ExecuteWithContext(ctx) fmt.Printf("Result: %v\n", result) // Output: // Loading premium_user from external source // Loading credit from external source // Result: 600 } ``` -------------------------------- ### ExecuteWithContext - Run Engine with Custom Context Source: https://context7.com/kamihama-railway/uwasa/llms.txt Executes the rule using a custom Context implementation, allowing integration with external data sources like databases or caches. The custom context must implement `Get` and `Set` methods. ```APIDOC ## ExecuteWithContext - Run Engine with Custom Context ### Description Executes the rule using a custom Context implementation, allowing integration with external data sources like databases or caches. The custom context must implement `Get` and `Set` methods. ### Method POST (Implicit, as `ExecuteWithContext` is a method on an engine object) ### Endpoint N/A (This is a programmatic API call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **ctx** (uwasa.Context) - Required - An implementation of the `uwasa.Context` interface, providing `Get` and `Set` methods. ### Request Example ```go // Custom context implementation type DatabaseContext struct { cache map[string]any } func (d *DatabaseContext) Get(name string) (any, bool) { /* ... */ } func (d *DatabaseContext) Set(name string, value any) error { /* ... */ } engine, _ := uwasa.NewEngineVM(`if user_level >= 5 then reward = 1000`) ctx := &DatabaseContext{ cache: map[string]any{ "user_level": int64(7), }, } result, err := engine.ExecuteWithContext(ctx) ``` ### Response #### Success Response (200) - **result** (any) - The result of the rule execution. If the rule involves assignments via the context, the `Set` method of the context will be called. #### Response Example ```json { "result": 1000 } ``` ``` -------------------------------- ### Execute Rule with Custom Context - Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Executes a rule using a custom Context implementation, enabling integration with external data sources like databases or caches. The custom context must implement Get and Set methods. ```Go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) // Custom context that could integrate with Redis, database, etc. type DatabaseContext struct { cache map[string]any } func (d *DatabaseContext) Get(name string) (any, bool) { // Simulate fetching from database/cache val, ok := d.cache[name] return val, ok } func (d *DatabaseContext) Set(name string, value any) error { // Simulate persisting to database/cache d.cache[name] = value fmt.Printf("Persisting %s = %v\n", name, value) return nil } func main() { engine, _ := uwasa.NewEngineVM(`if user_level >= 5 then reward = 1000`) ctx := &DatabaseContext{ cache: map[string]any{ "user_level": int64(7), }, } result, err := engine.ExecuteWithContext(ctx) if err != nil { panic(err) } fmt.Printf("Result: %v\n", result) // Output: Persisting reward = 1000 // Output: Result: 1000 } ``` -------------------------------- ### Create VM Engine with Options using NewEngineVMWithOptions Source: https://context7.com/kamihama-railway/uwasa/llms.txt Initializes a bytecode VM engine with custom optimization configurations, including support for experimental register-based VM operations. This provides granular control over the VM's performance characteristics. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { opts := uwasa.EngineOptions{ OptimizationLevel: uwasa.OptBasic, UseRecompiler: true, } engine, err := uwasa.NewEngineVMWithOptions(`price * quantity - discount`, opts) if err != nil { panic(err) } vars := map[string]any{ "price": int64(100), "quantity": int64(5), "discount": int64(50), } result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Total: %v\n", result) // Output: Total: 450 } ``` -------------------------------- ### NewEngineVMWithOptions - Create VM Engine with Options Source: https://context7.com/kamihama-railway/uwasa/llms.txt Creates a bytecode VM engine with custom optimization settings including experimental register-based VM support. ```APIDOC ## NewEngineVMWithOptions - Create VM Engine with Options ### Description Creates a bytecode VM engine with custom optimization settings including experimental register-based VM support. ### Method POST ### Endpoint /uwasa/engine/vm/options ### Parameters #### Request Body - **rule** (string) - Required - The rule expression to be evaluated. - **options** (object) - Optional - Engine configuration options. - **optimizationLevel** (string) - Optional - Optimization level (e.g., "basic", "full"). Defaults to "basic". - **useRecompiler** (boolean) - Optional - Whether to use the recompiler for static analysis. Defaults to false. ### Request Example ```json { "rule": "price * quantity - discount", "options": { "optimizationLevel": "basic", "useRecompiler": true } } ``` ### Response #### Success Response (200) - **engine_id** (string) - A unique identifier for the created engine. - **message** (string) - A success message. #### Response Example ```json { "engine_id": "vm-options-fghij", "message": "VM engine with custom options created successfully." } ``` ``` -------------------------------- ### Create AST-based Engine with NewEngine Source: https://context7.com/kamihama-railway/uwasa/llms.txt Initializes a rule engine using the AST interpreter backend. This is suitable for simpler rules or when faster compilation is preferred over execution speed. It takes a string representing the rule and returns an engine instance or an error. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Create an engine with a conditional expression engine, err := uwasa.NewEngine(`if score >= 90 is "A" else if score >= 80 is "B" else is "C"`) if err != nil { panic(err) } // Prepare context variables vars := map[string]any{ "score": int64(85), } // Execute the rule result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Grade: %v\n", result) // Output: Grade: B } ``` -------------------------------- ### Create Engine with Custom Options using NewEngineWithOptions Source: https://context7.com/kamihama-railway/uwasa/llms.txt Constructs an engine with specific optimization settings, including the option to enable the recompiler for static analysis and algebraic simplification. This allows for fine-tuning performance and enabling advanced optimizations. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { opts := uwasa.EngineOptions{ OptimizationLevel: uwasa.OptBasic, // Enable constant folding UseRecompiler: true, // Enable algebraic simplification and static analysis } // Expression with redundant operations that will be simplified // (a + 0) * 1 + (b - b) simplifies to just: a engine, err := uwasa.NewEngineWithOptions(`(a + 0) * 1 + (b - b)`, opts) if err != nil { panic(err) } vars := map[string]any{ "a": int64(42), "b": int64(100), } result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Optimized result: %v\n", result) // Output: Optimized result: 42 } ``` -------------------------------- ### Create Bytecode VM Engine with NewEngineVM Source: https://context7.com/kamihama-railway/uwasa/llms.txt Initializes a high-performance rule engine utilizing the native bytecode virtual machine. This is recommended for production environments demanding maximum throughput and minimal latency. It accepts a rule string and returns an engine or an error. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Create a VM-backed engine for complex conditional logic engine, err := uwasa.NewEngineVM(`if (score >= 90 || attendance > 0.9) && status == "active" then bonus = 100`) if err != nil { panic(err) } // Prepare context - use int64 for best performance vars := map[string]any{ "score": int64(95), "attendance": 0.8, "status": "active", } // Execute - zero allocations during execution result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Result: %v, Bonus assigned: %v\n", result, vars["bonus"]) // Output: Result: 100, Bonus assigned: 100 } ``` -------------------------------- ### NewEngineWithOptions - Create Engine with Custom Options Source: https://context7.com/kamihama-railway/uwasa/llms.txt Creates an engine with specific optimization settings, including the optional recompiler for static analysis and algebraic simplification. ```APIDOC ## NewEngineWithOptions - Create Engine with Custom Options ### Description Creates an engine with specific optimization settings, including the optional recompiler for static analysis and algebraic simplification. ### Method POST ### Endpoint /uwasa/engine/options ### Parameters #### Request Body - **rule** (string) - Required - The rule expression to be evaluated. - **options** (object) - Optional - Engine configuration options. - **optimizationLevel** (string) - Optional - Optimization level (e.g., "basic", "full"). Defaults to "basic". - **useRecompiler** (boolean) - Optional - Whether to use the recompiler for static analysis. Defaults to false. ### Request Example ```json { "rule": "(a + 0) * 1 + (b - b)", "options": { "optimizationLevel": "basic", "useRecompiler": true } } ``` ### Response #### Success Response (200) - **engine_id** (string) - A unique identifier for the created engine. - **message** (string) - A success message. #### Response Example ```json { "engine_id": "options-engine-abcde", "message": "Engine with custom options created successfully." } ``` ``` -------------------------------- ### NewEngineVM - Create Bytecode VM Engine Source: https://context7.com/kamihama-railway/uwasa/llms.txt Creates a high-performance rule engine using the native bytecode virtual machine. Recommended for production workloads requiring maximum throughput and minimum latency. ```APIDOC ## NewEngineVM - Create Bytecode VM Engine ### Description Creates a high-performance rule engine using the native bytecode virtual machine. This is the recommended approach for production workloads requiring maximum throughput and minimum latency. ### Method POST ### Endpoint /uwasa/engine/vm ### Parameters #### Request Body - **rule** (string) - Required - The rule expression to be evaluated. ### Request Example ```json { "rule": "if (score >= 90 || attendance > 0.9) && status == \"active\" then bonus = 100" } ``` ### Response #### Success Response (200) - **engine_id** (string) - A unique identifier for the created engine. - **message** (string) - A success message. #### Response Example ```json { "engine_id": "vm-engine-67890", "message": "Bytecode VM engine created successfully." } ``` ``` -------------------------------- ### NewEngine - Create AST-based Engine Source: https://context7.com/kamihama-railway/uwasa/llms.txt Creates a rule engine using the traditional AST interpreter backend. Suitable for simple rules or when compilation speed is prioritized. ```APIDOC ## NewEngine - Create AST-based Engine ### Description Creates a rule engine using the traditional AST interpreter backend. This is suitable for simple rules or scenarios where compilation speed is prioritized over execution speed. ### Method POST ### Endpoint /uwasa/engine/ast ### Parameters #### Request Body - **rule** (string) - Required - The rule expression to be evaluated. ### Request Example ```json { "rule": "if score >= 90 is \"A\" else if score >= 80 is \"B\" else is \"C\"" } ``` ### Response #### Success Response (200) - **engine_id** (string) - A unique identifier for the created engine. - **message** (string) - A success message. #### Response Example ```json { "engine_id": "ast-engine-12345", "message": "AST-based engine created successfully." } ``` ``` -------------------------------- ### Execute Rule Engine Source: https://context7.com/kamihama-railway/uwasa/llms.txt Executes a previously created Uwasa rule engine with the provided context variables. ```APIDOC ## Execute Rule Engine ### Description Executes a previously created Uwasa rule engine with the provided context variables. ### Method POST ### Endpoint /uwasa/engine/{engine_id}/execute ### Parameters #### Path Parameters - **engine_id** (string) - Required - The ID of the engine to execute. #### Request Body - **variables** (object) - Required - A map of variable names to their values for the execution context. ### Request Example ```json { "engine_id": "ast-engine-12345", "variables": { "score": 85, "attendance": 0.95, "status": "active" } } ``` ### Response #### Success Response (200) - **result** (any) - The result of the rule evaluation. - **updated_variables** (object) - Any variables that were modified during execution. #### Response Example ```json { "result": "B", "updated_variables": { "bonus": 100 } } ``` ``` -------------------------------- ### High-Performance String Concatenation - Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Demonstrates the built-in `concat` function for efficient multi-segment string concatenation using pooled buffers with pre-calculated length allocation. This is more performant than multiple '+' operations. ```Go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // concat is more efficient than multiple + operations engine, _ := uwasa.NewEngineVM(`concat("Hello, ", user_name, "! Your score is ", score, ".")`) vars := map[string]any{ "user_name": "Alice", "score": int64(95), } result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Message: %v\n", result) // Output: Message: Hello, Alice! Your score is 95. } ``` -------------------------------- ### Short-Circuit Logical Operators in Uwasa Source: https://context7.com/kamihama-railway/uwasa/llms.txt Demonstrates the use of `&&` and `||` operators with short-circuit evaluation in the Uwasa engine. This prevents unnecessary computations, such as division by zero, when the left-hand side of the operator evaluates to false. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Short-circuit: if left side of && is false, right side is not evaluated // This prevents division-by-zero when divisor is 0 engine, _ := uwasa.NewEngineVM(`if divisor != 0 && (value / divisor > 5)`) // Safe evaluation - divisor is not zero vars := map[string]any{ "divisor": int64(2), "value": int64(20), } result, _ := engine.Execute(vars) fmt.Printf("Safe division result: %v\n", result) // Output: Safe division result: true // Short-circuit protection - divisor is zero, division is skipped vars = map[string]any{ "divisor": int64(0), "value": int64(20), } result, _ = engine.Execute(vars) fmt.Printf("Zero divisor result: %v\n", result) // Output: Zero divisor result: false } ``` -------------------------------- ### Multi-Branch Conditional Expression - Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Illustrates the 'If-Is-Else' pattern for returning different values based on sequential condition matching, similar to switch-case statements. This is useful for creating grading systems or similar logic. ```Go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Multi-branch grading system engine, _ := uwasa.NewEngineVM ( `if score >= 90 is "Excellent" else if score >= 80 is "Good" else if score >= 70 is "Average" else if score >= 60 is "Pass" else is "Fail" `) testScores := []int64{95, 82, 73, 65, 45} for _, score := range testScores { vars := map[string]any{"score": score} result, _ := engine.Execute(vars) fmt.Printf("Score %d: %v\n", score, result) } // Output: // Score 95: Excellent // Score 82: Good // Score 73: Average // Score 65: Pass // Score 45: Fail } ``` -------------------------------- ### Integer Fast Path Arithmetic in Uwasa Source: https://context7.com/kamihama-railway/uwasa/llms.txt Illustrates Uwasa's optimization for integer arithmetic operations. When all operands are `int64`, the engine uses a fast path, avoiding float conversion overhead. Mixed types automatically promote to `float64`. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { engine, _ := uwasa.NewEngineVM(`(price * quantity) - discount + tax`) // Using int64 triggers the integer fast path - highest performance intVars := map[string]any{ "price": int64(100), "quantity": int64(5), "discount": int64(50), "tax": int64(25), } result, _ := engine.Execute(intVars) fmt.Printf("Integer calculation: %v (type: %T)\n", result, result) // Output: Integer calculation: 475 (type: int64) // Mixed types auto-promote to float64 mixedVars := map[string]any{ "price": 99.99, "quantity": int64(3), "discount": 25.0, "tax": 15.5, } result, _ = engine.Execute(mixedVars) fmt.Printf("Float calculation: %v (type: %T)\n", result, result) // Output: Float calculation: 290.47 (type: float64) } ``` -------------------------------- ### Assignment Expressions in Uwasa Source: https://context7.com/kamihama-railway/uwasa/llms.txt Explains how assignment expressions work in the Uwasa engine. Assignments modify context variables and return the assigned value, enabling chained assignments and inline modifications within expressions. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Assignment returns the assigned value engine, _ := uwasa.NewEngineVM(`total = (base_price * quantity) - (base_price * quantity * discount_rate)`) vars := map[string]any{ "base_price": int64(100), "quantity": int64(3), "discount_rate": 0.1, } result, _ := engine.Execute(vars) fmt.Printf("Returned value: %v\n", result) // Output: Returned value: 270 fmt.Printf("Stored total: %v\n", vars["total"]) // Output: Stored total: 270 } ``` -------------------------------- ### Execute - Run Engine with Map Context Source: https://context7.com/kamihama-railway/uwasa/llms.txt Executes a compiled rule against a map of variables. The engine automatically manages context pooling for optimal performance. This method modifies the input map in-place for assignment expressions. ```APIDOC ## Execute - Run Engine with Map Context ### Description Executes the compiled rule against a map of variables. The engine automatically manages context pooling for optimal performance. This method modifies the input map in-place for assignment expressions. ### Method POST (Implicit, as `Execute` is a method on an engine object) ### Endpoint N/A (This is a programmatic API call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **vars** (map[string]any) - Required - A map containing the variables to be used in the rule execution. ### Request Example ```go engine, _ := uwasa.NewEngineVM(`if balance > 10 then balance = balance - 10`) vars := map[string]any{ "balance": int64(100), } result, err := engine.Execute(vars) ``` ### Response #### Success Response (200) - **result** (any) - The result of the rule execution. For assignment expressions, this is the value assigned. - **vars** (map[string]any) - The input map, potentially modified in-place by assignment expressions. #### Response Example ```json { "result": 90, "vars": { "balance": 90 } } ``` ``` -------------------------------- ### Static Analysis and Recompiler in Uwasa Source: https://context7.com/kamihama-railway/uwasa/llms.txt Details the static analysis capabilities provided by Uwasa's recompiler. It detects compile-time errors such as division by zero, type mismatches (e.g., string arithmetic), and unreachable code paths, improving code robustness. ```go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { opts := uwasa.EngineOptions{ OptimizationLevel: uwasa.OptBasic, UseRecompiler: true, } // Division by zero detection _, err := uwasa.NewEngineWithOptions(`value / 0`, opts) if err != nil { fmt.Printf("Caught at compile time: %v\n", err) // Output: Caught at compile time: static analysis errors: [division by zero] } // Type mismatch detection - string arithmetic _, err = uwasa.NewEngineWithOptions(`"hello" - "world"`, opts) if err != nil { fmt.Printf("Type error: %v\n", err) // Output: Type error: static analysis errors: [invalid operation: string - string] } } ``` -------------------------------- ### Execute Rule with Map Context - Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Executes a compiled rule against a map of variables. The engine manages context pooling for optimal performance. It modifies the input map in-place for assignment expressions. ```Go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { engine, _ := uwasa.NewEngineVM(`if balance > 10 then balance = balance - 10`) vars := map[string]any{ "balance": int64(100), } // Execute modifies vars in-place for assignment expressions result, err := engine.Execute(vars) if err != nil { panic(err) } fmt.Printf("Deducted: %v, New balance: %v\n", result, vars["balance"]) // Output: Deducted: 90, New balance: 90 } ``` -------------------------------- ### Conditional Action Expression - Go Source: https://context7.com/kamihama-railway/uwasa/llms.txt Demonstrates the 'If-Then' pattern for executing side effects, such as assignments or calculations, only when a specific condition is met. The expression returns the result of the action or nil if the condition is false. ```Go package main import ( "fmt" "github.com/kamihama-railway/uwasa" ) func main() { // Apply VIP discount only for VIP users engine, _ := uwasa.NewEngineVM(`if is_vip then final_price = price * 0.8`) // VIP user vipVars := map[string]any{ "is_vip": true, "price": 100.0, } result, _ := engine.Execute(vipVars) fmt.Printf("VIP result: %v, Final price: %v\n", result, vipVars["final_price"]) // Output: VIP result: 80, Final price: 80 // Non-VIP user regularVars := map[string]any{ "is_vip": false, "price": 100.0, } result, _ = engine.Execute(regularVars) fmt.Printf("Regular result: %v, Final price: %v\n", result, regularVars["final_price"]) // Output: Regular result: , Final price: } ``` -------------------------------- ### If-Is-Else - Multi-Branch Conditional Expression Source: https://context7.com/kamihama-railway/uwasa/llms.txt A pattern for returning different values based on sequential condition matching, similar to switch-case statements. It evaluates conditions in order and returns the value associated with the first true condition. ```APIDOC ## If-Is-Else - Multi-Branch Conditional Expression ### Description Pattern for returning different values based on sequential condition matching, similar to switch-case statements. It evaluates conditions in order and returns the value associated with the first true condition. ### Method N/A (This is a control flow structure used within a rule expression) ### Endpoint N/A ### Parameters None (Used as a control flow structure within the rule language) ### Request Example ```go engine, _ := uwasa.NewEngineVM(` if score >= 90 is "Excellent" else if score >= 80 is "Good" else if score >= 70 is "Average" else if score >= 60 is "Pass" else is "Fail" `) testScores := []int64{95, 82, 73, 65, 45} for _, score := range testScores { vars := map[string]any{"score": score} result, _ := engine.Execute(vars) fmt.Printf("Score %d: %v\n", score, result) } ``` ### Response #### Success Response (200) - **result** (any) - The value associated with the first condition that evaluates to true, or the value associated with the final `else` if no other condition is met. #### Response Example ```json { "result": "Excellent" } ``` ``` -------------------------------- ### concat - High-Performance String Concatenation Source: https://context7.com/kamihama-railway/uwasa/llms.txt A built-in function for efficient multi-segment string concatenation using pooled buffers with pre-calculated length allocation. It is more performant than repeated string additions. ```APIDOC ## concat - High-Performance String Concatenation ### Description Built-in function for efficient multi-segment string concatenation using pooled buffers with pre-calculated length allocation. It is more performant than repeated string additions. ### Method N/A (This is a function used within a rule expression) ### Endpoint N/A ### Parameters None (Used as a function within the rule language) ### Request Example ```go engine, _ := uwasa.NewEngineVM(`concat("Hello, ", user_name, "! Your score is ", score, ".")`) vars := map[string]any{ "user_name": "Alice", "score": int64(95), } result, err := engine.Execute(vars) ``` ### Response #### Success Response (200) - **result** (string) - The concatenated string. #### Response Example ```json { "result": "Hello, Alice! Your score is 95." } ``` ``` -------------------------------- ### If-Then - Conditional Action Expression Source: https://context7.com/kamihama-railway/uwasa/llms.txt A pattern for executing side effects (assignments, calculations) only when a condition is met. It returns the result of the action if the condition is true, otherwise it returns nil. ```APIDOC ## If-Then - Conditional Action Expression ### Description Pattern for executing side effects (assignments, calculations) only when a condition is met. It returns the result of the action if the condition is true, otherwise it returns nil. ### Method N/A (This is a control flow structure used within a rule expression) ### Endpoint N/A ### Parameters None (Used as a control flow structure within the rule language) ### Request Example ```go engine, _ := uwasa.NewEngineVM(`if is_vip then final_price = price * 0.8`) // VIP user vipVars := map[string]any{ "is_vip": true, "price": 100.0, } result, _ := engine.Execute(vipVars) // Non-VIP user regularVars := map[string]any{ "is_vip": false, "price": 100.0, } result, _ = engine.Execute(regularVars) ``` ### Response #### Success Response (200) - **result** (any) - The result of the action expression if the condition is true, otherwise `nil`. #### Response Example ```json { "result": 80 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.