Class RuntimeCoercions
java.lang.Object
io.github.protasm.jvmud.compiler.runtime.RuntimeCoercions
Runtime coercion helpers for LPC compatibility values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectincrementNumber(Object value, int delta) Returns an incremented numeric value for dynamically typed mutation expressions.static ObjecttoArrayValue(Object value) Coerces a dynamically typed LPC value into an explicit array context.static StringtoStringValue(Object value) Coerces a dynamically typed LPC value into an explicitstringcontext.static ObjectzeroToNullReference(Object value)
-
Method Details
-
zeroToNullReference
-
toStringValue
Coerces a dynamically typed LPC value into an explicitstringcontext.Classic LPC mudlibs frequently use
mixedproperty bags and the numeric false sentinel0. In dynamic JVMud string contexts, that sentinel remains a false reference value so checks likesaved == 0keep working. Other dynamic values are rendered textually instead of relying on a raw JavaStringcast. -
toArrayValue
Coerces a dynamically typed LPC value into an explicit array context.Some legacy mudlibs use
([])as a falsey empty collection placeholder before passing it into array-typed helpers that only checksizeof(). LDMud tolerates that at runtime; JVMud preserves the practical behavior only for the empty-mapping case and leaves non-empty mappings incompatible with arrays. -
incrementNumber
-