Class Truth

java.lang.Object
io.github.protasm.jvmud.compiler.runtime.Truth

public final class Truth extends Object
Utility helpers for LPC truthiness semantics.
  • Method Details

    • isTruthy

      public static boolean isTruthy(Object value)
      Convert any LPC value to a boolean according to simple truthiness rules:
      • null is false.
      • Boolean values are returned as-is.
      • Number values are true when non-zero.
      • All other non-null values are treated as true.
      Parameters:
      value - a value produced by compiled LPC code
      Returns:
      true when the value should be considered truthy