Java Interop Reference for PTC-Lisp

Copy Markdown View Source

Warning: This file is auto-generated by mix ptc.gen_docs from priv/functions.exs. Manual edits will be overwritten. Edit priv/functions.exs instead.

PTC-Lisp emulates a subset of Java interop for LLM compatibility. These are not real JVM calls — they are BEAM-native implementations that mirror the Java API surface LLMs are trained on.

14 interop entries across 6 classes.

See also: Function Reference | PTC-Lisp Specification

java.lang.Double

NameKindSignatureDescriptionNotes
Double/NEGATIVE_INFINITYConstantDouble/NEGATIVE_INFINITY, NEGATIVE_INFINITYNegative infinity constant (##-Inf)
Double/NaNConstantDouble/NaN, NaNNot-a-Number constant (##NaN)
Double/POSITIVE_INFINITYConstantDouble/POSITIVE_INFINITY, POSITIVE_INFINITYPositive infinity constant (##Inf)

java.lang.String

NameKindSignatureDescriptionNotes
.containsMethod(.contains s substr)Returns true if string contains substring
.indexOfMethod(.indexOf s substr), (.indexOf s substr from-index)Index of first occurrence of substring, or -1 if not foundUses grapheme indices (not byte offsets).
.lastIndexOfMethod(.lastIndexOf s substr)Index of last occurrence of substring, or -1 if not foundUses grapheme indices (not byte offsets).
.toLowerCaseMethod(.toLowerCase s)Convert string to lower case
.toUpperCaseMethod(.toUpperCase s)Convert string to upper case

java.lang.System

NameKindSignatureDescriptionNotes
System/currentTimeMillisStatic(System/currentTimeMillis), (currentTimeMillis)Return current time in milliseconds since Unix epoch

java.time.LocalDate

NameKindSignatureDescriptionNotes
LocalDate/parseStatic(LocalDate/parse date-string)Parse ISO-8601 date string (YYYY-MM-DD) to DateReturns Elixir Date. Only supports ISO-8601 YYYY-MM-DD format.

java.time.LocalDate / java.util.Date

NameKindSignatureDescriptionNotes
.isAfterMethod(.isAfter a b)Returns true if receiver comes strictly after argument (same-type only)Works on both LocalDate and DateTime. Mixed types raise an error.
.isBeforeMethod(.isBefore a b)Returns true if receiver comes strictly before argument (same-type only)Works on both LocalDate and DateTime. Mixed types raise an error.

java.util.Date

NameKindSignatureDescriptionNotes
.getTimeMethod(.getTime date)Return Unix timestamp in milliseconds from DateTime
java.util.Date.Constructor(java.util.Date.), (java.util.Date. timestamp-or-string)Construct current UTC time or from timestamp/ISO-8601/RFC-2822 stringReturns Elixir DateTime. Accepts integer (seconds or ms auto-detected), ISO-8601, RFC 2822.