SleelaDoc API
HTML documentation for the SLeeLa standard library (/lib)
Home › Packages › alphabet

Package alphabet

This package contains 16 source unit(s) defining 16 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

Alphabet #sleela 2.5 (lib/alphabet/Alphabet.sleela)

Alphabet class

Defines Alphabet, the base writing-system Master Class a developer

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MODULEstatic final String MODULE = "Alphabet"No description in source.
MAXstatic final int MAX = 256No description in source.
loadedFlagint loadedFlagNo description in source.
scriptNameString scriptNamee.g. "Latin", "Greek", "Cyrillic"
lettersLetter[] lettersNo description in source.
countint countNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadvoid load()--- loadable-module contract ------------------------------------------
loadedboolean loaded()No description in source.
moduleNameString moduleName()No description in source.
beginvoid begin(String name)A subclass calls this from its own setup to declare the script name, then appends its letters via compose(). Mirrors the declare()/configure() pattern used across the standard library.
composevoid compose()Overridable: a concrete alphabet appends its Letters here, in order. The base version writes nothing, so an un-overridden Alphabet is honestly empty.
appendvoid append(String glyph, boolean vowel)Append one letter. Vowel-ness is passed in because only the script knows.
appendLettervoid appendLetter(Letter L)Syntax 1.8+: append a pre-built Letter (e.g. one made with the Letter constructor `new Letter(glyph, order, vowel)`). The letter's order is normalised to its real position so a builder need not track indices.
atLetter at(int i)No description in source.
findLetter find(String glyph)The first letter whose glyph matches, or null.
hasboolean has(String glyph)No description in source.
vowelCountint vowelCount()No description in source.
consonantCountint consonantCount()No description in source.
sizeint size()No description in source.
scriptString script()No description in source.
describeString describe()No description in source.

AlphabetBuilder #sleela 2.5 (lib/alphabet/AlphabetBuilder.sleela)

AlphabetBuilder class

Defines AlphabetBuilder — the syntax 1.8+ way to assemble a custom Alphabet without declaring a subclass. Where the classic path is "subclass Alphabet and override compose()", the builder lets a user of Sleela compose a writing system inline using one-line Letter constructors and `let`-inferred locals: let b = new AlphabetBuilder("Runic"); b.vowel("A"); b.consonant("B"); ... < a fully formed Alphabet > let alpha = b.build(); Each add() builds a Letter with `new Letter(glyph, order, vowel)` (the 1.8 constructor) and hands it to Alphabet.appendLetter. The builder is the ergonomic, subclass-free front door the 1.8 surface makes possible. Family: alphabet. Composes Alphabet + Letter (1.8 constructors).

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
targetAlphabet targetNo description in source.
nextint next1-based running order for constructed Letters

Methods — the actions this unit can perform.

MethodSignatureWhat it does
addvoid add(String glyph, boolean vowel)Add a letter built in one line with the Letter 1.8 constructor.
vowelvoid vowel(String glyph)No description in source.
consonantvoid consonant(String glyph)No description in source.
buildAlphabet build()The assembled alphabet.
letterCountint letterCount()No description in source.
describeString describe()No description in source.

ArabicAlphabet #sleela 2.5 (lib/alphabet/ArabicAlphabet.sleela)

ArabicAlphabet class extends Alphabet

ArabicAlphabet — the 28-letter Arabic script (Alif..Ya). Like Hebrew, Arabic is an ABJAD: the letters are consonants and short vowels are written with optional diacritics, so each letter here is a consonant. Three letters (Alif, Waw, Ya) double as long-vowel carriers, but as letters they remain consonantal, so the alphabet's vowel count is honestly zero. A concrete Alphabet: override compose() to append its letters in order. Call begin("Arabic") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
composevoid compose()No description in source.

CharacterSet #sleela 2.5 (lib/alphabet/CharacterSet.sleela)

CharacterSet class

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
nameString nameNo description in source.
capacityint capacityNo description in source.
populatedint populatedNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String setName, int maximumEntries)No description in source.
setNameString setName()No description in source.
maxEntriesint maxEntries()No description in source.
sizeint size()No description in source.
isEmptyboolean isEmpty()No description in source.
containsboolean contains(String symbol)No description in source.
addboolean add(String symbol)No description in source.

Color #sleela 2.5 (lib/alphabet/Color.sleela)

Color class

Defines Color, the smallest unit of delight in the alphabet package — one RGB color, held as three channels of 0..255, with the hex string, blending, and luminance every user of Sleela quietly relies on. Color is a NATURAL / LOADABLE MODULE sharing the common module contract (load / loaded / moduleName / describe). It is thematically important to ALL users of Sleela: every Theme is, at heart, a handful of Colors that agree to get along. It holds channel state only; a Palette groups Colors and a Theme assigns them roles. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MODULEstatic final String MODULE = "Color"No description in source.
loadedFlagint loadedFlag1 once the module is loaded
rint rred channel, 0..255
gint ggreen channel, 0..255
bint bblue channel, 0..255

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadvoid load()--- loadable-module contract ------------------------------------------
loadedboolean loaded()No description in source.
moduleNameString moduleName()No description in source.
setvoid set(int red, int green, int blue)Set the three channels, each clamped to the honest 0..255 range.
channelint channel(int v)No description in source.
redint red()No description in source.
greenint green()No description in source.
blueint blue()No description in source.
luminanceint luminance()Perceived luminance, 0..255 (ITU-R BT.601 weights, integer math).
isDarkboolean isDark()Is this a "dark" color? Useful for deciding what text to put on top.
blendHalfColor blendHalf(Color other)Blend halfway toward another color — the diplomacy of design.
equalsColorboolean equalsColor(Color other)Two colors are equal when all three channels agree.
hexString hex()Lowercase hex like "#1e90ff". Built with substring math — no char type.
hex2String hex2(int v)One byte (0..255) to a two-digit lowercase hex string.
hexDigitString hexDigit(int d)No description in source.
ynString yn(boolean v)No description in source.
describeString describe()No description in source.

CyrillicAlphabet #sleela 2.5 (lib/alphabet/CyrillicAlphabet.sleela)

CyrillicAlphabet class extends Alphabet

CyrillicAlphabet — a 33-letter Russian Cyrillic script, rendered here in Latin transliteration so it is readable in any Sleela terminal while still carrying its own order and vowel pattern. A concrete Alphabet: override compose() to append its letters in order. Call begin("Cyrillic") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
composevoid compose()No description in source.

DarkTheme #sleela 2.5 (lib/alphabet/DarkTheme.sleela)

DarkTheme class extends Theme

DarkTheme — a deep charcoal canvas with soft off-white text and a warm amber accent. The nighttime look beloved by users of Sleela who code at hours they will not admit to. A concrete Theme: override dress() to fill the palette and role colors. Call begin("Dark") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
dressvoid dress()No description in source.

GreekAlphabet #sleela 2.5 (lib/alphabet/GreekAlphabet.sleela)

GreekAlphabet class extends Alphabet

GreekAlphabet — the 24-letter Greek script (Alpha..Omega), the script of mathematics, philosophy, and every variable name that wanted to look serious. A concrete Alphabet: override compose() to append its letters in order. Call begin("Greek") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
composevoid compose()No description in source.

HebrewAlphabet #sleela 2.5 (lib/alphabet/HebrewAlphabet.sleela)

HebrewAlphabet class extends Alphabet

HebrewAlphabet — the 22-letter Hebrew script (Alef..Tav). Hebrew is an ABJAD: its letters are consonants, with vowels normally supplied by points (niqqud) rather than letters, so every letter here is marked a consonant. A few letters (Alef, He, Vav, Yod) act as mater lectionis — vowel carriers — but as letters they remain consonantal, which is why the vowel count of a pure abjad is honestly zero. A concrete Alphabet: override compose() to append its letters in order. Call begin("Hebrew") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
composevoid compose()No description in source.

LatinAlphabet #sleela 2.5 (lib/alphabet/LatinAlphabet.sleela)

LatinAlphabet class extends Alphabet

LatinAlphabet — the 26-letter Latin script (A..Z), the default writing system most users of Sleela will reach for first. A concrete Alphabet: subclass, and override compose() to append its letters in order. Call begin("Latin") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
composevoid compose()No description in source.

Letter #sleela 2.5 (lib/alphabet/Letter.sleela)

Letter class

Defines Letter, a single glyph in an Alphabet — the symbol, its position in the written order, and whether it is a vowel. The humblest, most important class a user of Sleela will ever meet, because everything written is written out of these. Letter is a NATURAL / LOADABLE MODULE sharing the common module contract (load / loaded / moduleName / describe). It holds glyph state only; an Alphabet owns an ordered run of Letters. Syntax 1.8+: Letter now also offers a one-line CONSTRUCTOR — `new Letter(glyph, order, vowel)` — so a glyph can be built in a single expression (`let a = new Letter("A", 1, true);`) instead of the load()+set() two-step. The two-step contract (load / set) is retained unchanged, so every existing 1.3 caller — including Alphabet.append()'s `new Letter(); load()` — keeps working: a zero-argument `new Letter()` is still valid under 1.8. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MODULEstatic final String MODULE = "Letter"No description in source.
loadedFlagint loadedFlagNo description in source.
glyphString glyphthe character itself, e.g. "A"
orderint order1-based position within its alphabet
vowelboolean voweltrue for vowels, false otherwise

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadvoid load()--- loadable-module contract (zero-arg path, unchanged) ---------------- A zero-argument `new Letter()` remains valid under 1.8; load() initialises an empty glyph for the classic two-step build used by Alphabet.append().
loadedboolean loaded()No description in source.
moduleNameString moduleName()No description in source.
setvoid set(String symbol, int position, boolean isVowel)No description in source.
symbolString symbol()No description in source.
positionint position()No description in source.
isVowelboolean isVowel()No description in source.
isConsonantboolean isConsonant()No description in source.
sameAsboolean sameAs(Letter other)No description in source.
ynString yn(boolean v)No description in source.
describeString describe()No description in source.

LightTheme #sleela 2.5 (lib/alphabet/LightTheme.sleela)

LightTheme class extends Theme

LightTheme — a bright, paper-white theme with near-black text and a friendly blue accent. The default daytime look for users of Sleela who like their contrast crisp and their eyes complaining by evening. A concrete Theme: override dress() to fill the palette and role colors. Call begin("Light") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
dressvoid dress()No description in source.

Palette #sleela 2.5 (lib/alphabet/Palette.sleela)

Palette class

Defines Palette, an ordered collection of Colors — the box of crayons every Theme reaches into. A Palette gives colors names and an order, so a user of Sleela can say "the third one" and mean it. Palette is a NATURAL / LOADABLE MODULE sharing the common module contract (load / loaded / moduleName / describe). It owns an array of Colors and the labels that go with them; a Theme borrows from it to assign roles. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MODULEstatic final String MODULE = "Palette"No description in source.
MAXstatic final int MAX = 64No description in source.
loadedFlagint loadedFlagNo description in source.
paletteNameString paletteNameNo description in source.
colorsColor[] colorsNo description in source.
labelsString[] labelsNo description in source.
countint countNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadvoid load()--- loadable-module contract ------------------------------------------
loadedboolean loaded()No description in source.
moduleNameString moduleName()No description in source.
namevoid name(String n)No description in source.
addint add(String label, int r, int g, int b)Add a labeled color by its channels. Returns the color's index, or -1 if the palette is full.
atColor at(int i)No description in source.
labelAtString labelAt(int i)No description in source.
byLabelColor byLabel(String label)Find a color by its label, or null if the palette never heard of it.
sizeint size()No description in source.
titleString title()No description in source.
describeString describe()No description in source.

SLPackage #sleela 2.5 (lib/alphabet/SLPackage.sleela)

SLPackage class

Defines the SLeeLa standard-library package for alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
packageNameString packageNameNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String name)No description in source.
nameString name()No description in source.
availableboolean available()No description in source.

SolarizedTheme #sleela 2.5 (lib/alphabet/SolarizedTheme.sleela)

SolarizedTheme class extends Theme

SolarizedTheme — a muted, low-contrast theme in the famous solarized spirit: a tan-cream base, slate-gray text, and a cyan accent. For users of Sleela who find pure black and white a little shouty. A concrete Theme: override dress() to fill the palette and role colors. Call begin("Solarized") to build it. Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
dressvoid dress()No description in source.

Theme #sleela 2.5 (lib/alphabet/Theme.sleela)

Theme class

Defines Theme, the base Master Class that binds the three things this package is about — a Palette of Colors, role colors (background, foreground, accent), and an Alphabet — into one coherent, user-facing look. A Theme is what a user of Sleela actually sees. A concrete theme is created by subclassing Theme and overriding dress(), which fills in the palette and role colors. The base owns the role plumbing, contrast checking, and the loadable-module contract, mirroring the base/subclass pattern used by Alphabet and the lib/compiler front ends. Theme is a NATURAL / LOADABLE MODULE sharing the common module contract (load / loaded / moduleName / describe). Family: alphabet.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
MODULEstatic final String MODULE = "Theme"No description in source.
loadedFlagint loadedFlagNo description in source.
themeNameString themeNameNo description in source.
palettePalette palettethe colors this theme draws from
backgroundColor backgroundthe canvas
foregroundColor foregroundthe text
accentColor accentthe one color that gets to be loud
scriptAlphabet scriptthe writing system this theme presents

Methods — the actions this unit can perform.

MethodSignatureWhat it does
loadvoid load()--- loadable-module contract ------------------------------------------
loadedboolean loaded()No description in source.
moduleNameString moduleName()No description in source.
beginvoid begin(String name)A subclass calls this to build the theme: name it, dress it, done. Mirrors Alphabet.begin() / compose().
dressvoid dress()Overridable: a concrete theme fills palette + role colors here. The base leaves everything black-on-black, which is honestly unusable on purpose.
setBackgroundvoid setBackground(int r, int g, int b)Helpers a subclass uses from dress() to set the three role colors.
setForegroundvoid setForeground(int r, int g, int b)No description in source.
setAccentvoid setAccent(int r, int g, int b)No description in source.
useAlphabetvoid useAlphabet(Alphabet a)Attach the writing system this theme presents.
bgColor bg()No description in source.
fgColor fg()No description in source.
highlightColor highlight()No description in source.
colorsPalette colors()No description in source.
alphabetAlphabet alphabet()No description in source.
nameString name()No description in source.
isDarkboolean isDark()A theme is "dark" when its canvas is dark. All users of Sleela will have opinions about this.
readableboolean readable()Readable means the text and the canvas disagree about darkness — a crude but effective contrast check.
letterCountint letterCount()No description in source.
ynString yn(boolean v)No description in source.
describeString describe()No description in source.