ソースコードのコメントから自動生成されています。

重要な注意事項

プリミティブメソッドのオーバーライド

Rustプリミティブとして実装されたメソッドは、同名のSmalltalkメソッドを定義することでオーバーライドできます。 ユーザー定義メソッドがプリミティブより優先されます。

"プリミティブメソッドをオーバーライド"
String >> size
    ^ 999
!

'hello' size.  "=> 999 (ユーザー定義メソッドが呼ばれる)"

注意: プリミティブをオーバーライドすると、最適化されたRust実装がバイパスされるため、 パフォーマンスに影響します。

文字列リテラル

文字列はシングルクォートで書き、中のクォートは 2 つ重ねます('it''s')。ANSI Smalltalk と同じです。 LST はさらに次のバックスラッシュエスケープを解釈します(LST 独自拡張、Unix の伝統との親和性のため): \n(LF)、\r(CR)、\t(タブ)、\0(NUL)、\\(バックスラッシュ)。 それ以外のバックスラッシュはそのまま残るので、正規表現が自然に書けます。'\d+' は 3 文字です。 \' はありません。閉じクォートの前のバックスラッシュは単なるバックスラッシュです('\' は 1 文字)。 Windows のパスは / か 2 重のバックスラッシュで書いてください。'C:\temp' はタブを含み、'C:/temp' と 'C:\\temp' は含みません。 バックスラッシュ自体にマッチする正規表現は '\\\\' です。 Grammar の /regex/ の中では \\n と書きます(/[^\\n]*/)。実際の改行は規則を終わらせてしまうためです。regexMatches: などの正規表現系メッセージは '[^\n]*' をそのまま受け取ります。

目次

組み込みクラス

標準ライブラリ


組み込みクラス

Aes class

MethodTypeParametersReturnsExample
encrypt:key:Primitiveplaintext String - text to encrypt, key String - 256-bit key as 64-char hex string (use Sha2 sha256: to derive)String - hex-encoded nonce + ciphertext + tag; a key that is not 64 hex digits raises an ErrorAes encrypt: 'hello' key: (Sha2 sha256: 'secret')
decrypt:key:Primitiveencrypted String - hex string from encrypt:key:, key String - same 256-bit key used for encryptionString - decrypted plaintext; a wrong key, altered or malformed ciphertext, an invalid key, or a plaintext that is not UTF-8 raises an Error saying whichAes decrypt: encrypted key: (Sha2 sha256: 'secret')

Array

MethodTypeParametersReturnsExample
sizePrimitive-Integer - number of elements#(1 2 3) size "=> 3"
at:Primitiveindex Integer - 1-based indexAny - element at index; an index outside the array raises an Error#(10 20 30) at: 2 "=> 20"
at:put:Primitiveindex Integer - 1-based index, value Any - value to storeAny - the stored value; an index outside the array raises an Errorarr at: 1 put: 'hello'
firstPrimitive-Any - first element, or nil if empty#(10 20 30) first "=> 10"
lastPrimitive-Any - last element, or nil if empty#(10 20 30) last "=> 30"
add:Primitivevalue Any - value to appendselfarr add: 42
includes:Primitivevalue Any - value to search forBoolean - true if found#(1 2 3) includes: 2 "=> true"
sortPrimitive-Array - new sorted array#(3 1 2) sort "=> #(1 2 3)"
indexOf:Primitivevalue Any - value to search forInteger - 1-based index, or 0 if not found#(10 20 30) indexOf: 20 "=> 2"
join:Primitiveseparator String - separator between elementsString - joined string#('a' 'b' 'c') join: '-' "=> 'a-b-c'"
,Primitiveother Array - array to appendArray - new concatenated array#(1 2) , #(3 4) "=> #(1 2 3 4)"
copyFrom:to:Primitivestart Integer - 1-based start index, end Integer - 1-based end index (inclusive)Array - new sliced array#(10 20 30 40) copyFrom: 2 to: 3 "=> #(20 30)"
asStringPrimitive-String - string representation#(1 2 3) asString "=> '#(1 2 3)'"
sumPrimitive-Number - sum of all numeric elements#(1 2 3 4 5) sum "=> 15"
maxPrimitive-Object - maximum element or nil if empty#(3 1 4 1 5) max "=> 5"
minPrimitive-Object - minimum element or nil if empty#(3 1 4 1 5) min "=> 1"
averagePrimitive-Number - average of all numeric elements (0 if empty)#(1 2 3 4 5) average "=> 3"
sumPrimitive-Number - sum of all numeric elements#(1 2 3 4 5) sum "=> 15"
maxPrimitive-Object - maximum element or nil if empty#(3 1 4 1 5) max "=> 5"
minPrimitive-Object - minimum element or nil if empty#(3 1 4 1 5) min "=> 1"
productPrimitive-Number - product of all numeric elements#(1 2 3 4 5) product "=> 120"
formatEach:Primitivetemplate String - Mustache template stringArray - array of rendered strings; a template that does not compile, or an element that is not a Dictionary, raises an Error{ #{'name' -> 'Alice'}. #{'name' -> 'Bob'} } formatEach: 'Hello, {{name}}!'
formatEach:join:Primitivetemplate String - Mustache template string, separator String - separator between rendered stringsString - joined rendered strings; errors as for formatEach:{ #{'x' -> '1'}. #{'x' -> '2'} } formatEach: '{{x}}' join: ', '
averagePrimitive-Number - average of all numeric elements (0 if empty)#(1 2 3 4 5) average "=> 3"

Array class

MethodTypeParametersReturnsExample
new:Primitivesize Integer - number of elements (all nil)Array - new array of the given sizeArray new: 3 "=> #(nil nil nil)"

Base64 class

MethodTypeParametersReturnsExample
encode:Primitivedata String|ByteArray - data to encodeString - base64 encoded stringBase64 encode: 'Hello, World!'
decode:Primitivestring String - base64 string to decodeString|ByteArray - decoded data: a String when it is UTF-8 text, otherwise a ByteArray; invalid base64 raises an ErrorBase64 decode: 'SGVsbG8sIFdvcmxkIQ=='

Block

MethodTypeParametersReturnsExample
argumentCountPrimitive-Integer - the number of arguments the block takes (ANSI 5.4.1.1)[:a :b | a + b] argumentCount "=> 2"

ByteArray

MethodTypeParametersReturnsExample
at:Primitiveindex Integer - 1-based indexInteger - byte value (0-255); an index outside the array raises an Errorbytes at: 1
at:put:Primitiveindex Integer - 1-based index, value Integer - byte value 0-255, or a Character whose code point is 0-255; anything else raises an ErrorInteger - stored value; an index outside the array raises an Errorbytes at: 1 put: 255
sizePrimitive-Integer - number of bytesbytes size
asStringPrimitive-String - UTF-8 string from bytesbytes asString
copyFrom:to:Primitivestart Integer - 1-based start index, end Integer - 1-based end index (inclusive)ByteArray - new sliced byte arraybytes copyFrom: 1 to: 10

ByteArray class

MethodTypeParametersReturnsExample
new:Primitivesize Integer - number of bytesByteArray - new byte array filled with zerosByteArray new: 10
fromString:Primitivestring String - string to convertByteArray - UTF-8 bytes of stringByteArray fromString: 'hello'

Character

MethodTypeParametersReturnsExample
isLetterPrimitive-Boolean - true if alphabetic$a isLetter "=> true"
isDigitPrimitive-Boolean - true if numeric digit$5 isDigit "=> true"
isAlphanumericPrimitive-Boolean - true if letter or digit$a isAlphanumeric "=> true"
isUppercasePrimitive-Boolean - true if uppercase letter$A isUppercase "=> true"
isLowercasePrimitive-Boolean - true if lowercase letter$a isLowercase "=> true"
isWhitespacePrimitive-Boolean - true if whitespace character$ isWhitespace "=> true"
asUppercasePrimitive-Character - uppercase version$a asUppercase "=> $A"
asLowercasePrimitive-Character - lowercase version$A asLowercase "=> $a"
asIntegerPrimitive-Integer - Unicode code point$A asInteger "=> 65"
asStringPrimitive-String - single-character string$A asString "=> 'A'"
=Primitiveother Character - character to compareBoolean - true if equal$a = $a "=> true"
<Primitiveother Character - character to compareBoolean - true if less than$a < $b "=> true"
<=Primitiveother Character - character to compareBoolean - true if less than or equal$a <= $a "=> true"
>Primitiveother Character - character to compareBoolean - true if greater than$b > $a "=> true"
>=Primitiveother Character - character to compareBoolean - true if greater than or equal$a >= $a "=> true"

ChildProcess

MethodTypeParametersReturnsExample
isFinishedPrimitive-Boolean - true if the process has exited (does not block)child isFinished
exitCodePrimitive-Integer - waits for the process to finish and answers its exit code (128 + the signal number for a process a signal ended, Unix); any number of timeschild exitCode
waitPrimitive-String - waits for the process to finish and answers its stdout; any number of times (the same String). exitCode then answers the exit codechild wait

ChildProcess class

MethodTypeParametersReturnsExample
spawn:args:Primitivecommand String - command to spawn (not through a shell), args Array - the arguments, as for Process run:args:ChildProcess - spawned process handle; its stdout is captured for wait, its stderr passes through to this process's stderr. A command that cannot be started raises an Error naming it and the OS reasonChildProcess spawn: 'sleep' args: #('5')

Csv class

MethodTypeParametersReturnsExample
parse:Primitivestring String - CSV string to parseArray - array of rows, each a Dict keyed by the header row (a field missing from a short row is nil, a field beyond the last header is kept under its column number)Csv parse: 'name,age\nAlice,30'
parse:options:Primitivestring String - CSV string to parse, options Dict - 'hasHeaders' -> false for Array rows (default true: Dict rows as parse:), 'delimiter' -> a one-byte String; any other key raises an ErrorArray - parsed rowsCsv parse: 'name;age\nAlice;30' options: (Dict new at: 'delimiter' put: ';'; yourself)
reader:Primitivestring String - CSV string for streaming readCsvReader - streaming CSV readerCsv reader: (File read: 'data.csv')

CsvReader

MethodTypeParametersReturnsExample
nextPrimitive-Dict|nil - next row keyed by header (missing fields nil, extra fields under their column number), or nil at endreader next
atEndPrimitive-Boolean - true if no more rowsreader atEnd

DateTime class

MethodTypeParametersReturnsExample
nowPrimitive-Integer - current Unix timestamp in secondsDateTime now
parse:Primitivestring String - ISO 8601 date stringInteger - Unix timestampDateTime parse: '2024-01-15T10:30:00Z'

Dict

MethodTypeParametersReturnsExample
at:Primitivekey String|Symbol - key to look upAny - value for key; a missing key raises an Error (at:ifAbsent: for a key that may be missing; inside Maybe value: [...] it answers nil)dict at: 'name' "=> 'Alice'"
at:put:Primitivekey String|Symbol - key to store, value Any - value to storeAny - the stored valuedict at: 'name' put: 'Bob'
keysPrimitive-Array - array of all keysdict keys "=> #('name' 'age')"
sizePrimitive-Integer - number of key-value pairsdict size "=> 2"
includesKey:Primitivekey String|Symbol - key to checkBoolean - true if key existsdict includesKey: 'name' "=> true"
removeKey:Primitivekey String|Symbol - key to removeAny - removed value, or nil if key not founddict removeKey: 'name'
valuesPrimitive-Array - array of all valuesdict values "=> #('Alice' 30)"
keysAndValuesPrimitive-Array - array of Association (key->value pairs)dict keysAndValues do: [:assoc | assoc key display. assoc value displayNl]
asStringPrimitive-String - string representationdict asString "=> 'Dict(name->Alice age->30)'"

Dict class

MethodTypeParametersReturnsExample
newPrimitive-Dict - new empty dictionaryDict new

Directory class

MethodTypeParametersReturnsExample
entries:Primitivepath String - directory pathArray - array of [name, isDir, size, mtime] tuples sorted by name (size is 0 for directories, mtime is Unix seconds; both 0 when the entry's metadata cannot be read). A directory that cannot be listed raises an Error with the reasonDirectory entries: '.'

Env class

MethodTypeParametersReturnsExample
keysPrimitive-Array - array of all environment variable namesEnv keys
at:Primitivename String - environment variable nameString|nil - value or nil if not set; a value that is not valid Unicode raises an ErrorEnv at: 'PATH'
at:put:Primitivename String - environment variable name (non-empty, no '=' or NUL; otherwise an Error), value String - value to set (no NUL; otherwise an Error)String - the valueEnv at: 'MY_VAR' put: 'value'

File class

MethodTypeParametersReturnsExample
read:Primitivepath String - file path to readString - file contents. A missing or unreadable file, or content that is not valid UTF-8, raises an Error with the path and the reasonFile read: 'data.txt'
read:encoding:Primitivepath String - file path to read, encoding String - encoding name ('utf-8', 'shift-jis', 'euc-jp', etc.)String - file contents decoded with specified encoding. An unreadable file, an unknown encoding or bytes invalid in that encoding raise an ErrorFile read: 'data.txt' encoding: 'shift-jis'
write:content:Primitivepath String - file path to write, content String - content to writetrue on success; a file that cannot be written raises an Error with the path and the reasonFile write: 'output.txt' content: 'Hello, World!'
exists:Primitivepath String - file path to checkBoolean - true if file exists, false otherwise (never raises)File exists: 'data.txt'
delete:Primitivepath String - file path to deletetrue on success; a missing or undeletable file raises an Error with the reasonFile delete: 'temp.txt'
glob:Primitivepattern String - glob pattern (e.g., '.txt', 'src/**/.rs')Array - matching file paths, sorted (empty when nothing matches). An invalid pattern or an unreadable directory raises an ErrorFile glob: 'examples/*.st'
appendTo:content:Primitivepath String - file path to append to, content String - content to appendtrue on success (the file is created if absent); a failure raises an Error with the reasonFile appendTo: 'log.txt' content: 'New log entry'
mkdir:Primitivepath String - directory path to create (with parents)true on success, also when the directory already exists; a failure raises an Error with the reasonFile mkdir: 'new_folder'
copy:to:Primitivesource String - source file path, dest String - destination file pathtrue on success; a failure raises an Error with the reasonFile copy: 'original.txt' to: 'backup.txt'
move:to:Primitivesource String - source file path, dest String - destination file pathtrue on success (renames, or copies then deletes across drives); a failure raises an Error with the reasonFile move: 'old.txt' to: 'new.txt'
isDirectory:Primitivepath String - path to checkBoolean - true if path is a directory, false otherwise (never raises)File isDirectory: 'src'
rmdir:Primitivepath String - directory path to remove (must be empty)true on success; a directory that is not empty or does not exist raises an Error with the reasonFile rmdir: 'empty_folder'
rmdir:recursive:Primitivepath String - directory path to remove, recursive Boolean - true: remove the directory and all its contents; false: same as rmdir: (must be empty)true on success; a failure raises an Error with the reasonFile rmdir: 'folder' recursive: true
size:Primitivepath String - file pathInteger - file size in bytes; a missing or unreadable file raises an Error with the reasonFile size: 'data.txt'
readBinary:Primitivepath String - file path to readByteArray - binary file contents; a missing or unreadable file raises an Error with the reasonFile readBinary: 'image.png'
writeBinary:content:Primitivepath String - file path to write, content ByteArray - binary data to writenil on success; a file that cannot be written raises an Error with the reasonFile writeBinary: 'output.bin' content: (ByteArray new: 10)
stdoutPrimitive-WriteHandle - handle for stdout (buffered)File stdout write: 'Output text'
stderrPrimitive-WriteHandle - handle for stderr (buffered)File stderr write: 'Error text'
canonicalize:Primitivepath String - file path to resolveString|nil - absolute path with symlinks and . / .. resolved, nil if path does not exist; any other failure raises an ErrorFile canonicalize: 'src/../README.md'
write:content:encoding:Primitivepath String - file path to write, content String - content to write, encoding String - encoding name ('utf-8', 'shift-jis', 'euc-jp', etc.)true on success; an unknown encoding, a character the encoding cannot represent, or a write failure raises an ErrorFile write: 'output.csv' content: data encoding: 'shift-jis'
appendTo:content:encoding:Primitivepath String - file path to append to, content String - content to append, encoding String - encoding name ('utf-8', 'shift-jis', 'euc-jp', etc.)true on success; an unknown encoding, a character the encoding cannot represent, or a write failure raises an ErrorFile appendTo: 'log.txt' content: line encoding: 'euc-jp'

Float

MethodTypeParametersReturnsExample
sinPrimitive-Float - sine value3.14159 sin "=> ~0.0"
cosPrimitive-Float - cosine value0.0 cos "=> 1.0"
tanPrimitive-Float - tangent value0.0 tan "=> 0.0"
logPrimitive-Float - natural logarithm2.718 log "=> ~1.0"
expPrimitive-Float - e raised to this power1.0 exp "=> 2.718..."
sqrtPrimitive-Float - square root16.0 sqrt "=> 4.0"
log10Primitive-Float - base-10 logarithm100.0 log10 "=> 2.0"
raisedTo:Primitiveexponent Number - power to raise toFloat - result2.0 raisedTo: 10 "=> 1024.0"
floorPrimitive-Integer - largest integer <= self3.7 floor "=> 3"
ceilingPrimitive-Integer - smallest integer >= self3.2 ceiling "=> 4"
roundedPrimitive-Integer - nearest integer3.5 rounded "=> 4"
asStringPrimitive-String - string representation3.14 asString "=> '3.14'"
@Primitivey Number - y coordinatePoint - new Point with self as x10.5 @ 20.5 "=> Point(10.5, 20.5)"

Float class

MethodTypeParametersReturnsExample
piPrimitive-Float - mathematical constant piFloat pi "=> 3.14159..."
ePrimitive-Float - mathematical constant eFloat e "=> 2.71828..."
infinityPrimitive-Float - positive infinityFloat infinity "=> Infinity"
negativeInfinityPrimitive-Float - negative infinityFloat negativeInfinity "=> -Infinity"
nanPrimitive-Float - Not a NumberFloat nan "=> NaN"

Grammar

MethodTypeParametersReturnsExample
setParserKind:Primitiveparser_kind String - 'peg' or 'earley'selfgrammar setParserKind: 'peg'

Grammar class

MethodTypeParametersReturnsExample
from:Primitivesource String - an EBNF grammar definition, one rule or terminal per lineGrammar - the compiled grammar, or nil if the definition is invalid (reason on stderr)g := Grammar from: 'expr: /[0-9]+/ "+" /[0-9]+/'
from:parser:Primitivesource String - an EBNF grammar definition, one rule or terminal per line, parser String - 'peg' or 'earley'; a left-recursive grammar runs on Earley even when 'peg' is asked forGrammar - the compiled grammar, or nil if the definition is invalidg := Grammar from: 'expr: expr "+" /[0-9]+/ | /[0-9]+/' parser: 'earley'
findAll:in:Primitivegrammar Grammar - a compiled grammar, source String - the text to searchArray - each match responds to at: 'text' / 'start' / 'end' (1-based, inclusive char positions) and to every capture the grammar names, nil for one this match did not setmatches := Grammar findAll: g in: '1+2 and 3+4'. matches first at: 'text'

Hmac class

MethodTypeParametersReturnsExample
sha256:key:Primitivedata String - data to authenticate, key String - secret keyString - HMAC-SHA256 as hex stringHmac sha256: 'message' key: 'secret'

Http class

MethodTypeParametersReturnsExample
get:Primitiveurl String - URL to fetchString - response body. Raises Error on a transport failure or an HTTP 4xx/5xx status (the message has the status and the body)Http get: 'https://api.example.com/data'
get:options:Primitiveurl String - URL to fetch, options Dict - options; the only option is 'headers' (a Dict of custom headers)String - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status, an unknown option or a header value that is not a String or IntegerHttp get: 'https://api.example.com' options: (Dict new at: 'headers' put: headers)
post:body:Primitiveurl String - URL to post to, body String - request body (typically JSON)String - response body. Raises Error on a transport failure or an HTTP 4xx/5xx statusHttp post: 'https://api.example.com' body: '{"name": "Alice"}'
post:body:options:Primitiveurl String - URL to post to, body String - request body, options Dict - options with 'headers' keyString - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad option/headerHttp post: url body: json options: (Dict new at: 'headers' put: headers)
put:body:Primitiveurl String - URL to put to, body String - request bodyString - response body. Raises Error on a transport failure or an HTTP 4xx/5xx statusHttp put: 'https://api.example.com/item/1' body: '{"name": "Bob"}'
put:body:options:Primitiveurl String - URL to put to, body String - request body, options Dict - options with 'headers' keyString - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad option/headerHttp put: url body: json options: opts
delete:Primitiveurl String - URL to deleteString - response body. Raises Error on a transport failure or an HTTP 4xx/5xx statusHttp delete: 'https://api.example.com/item/1'
delete:options:Primitiveurl String - URL to delete, options Dict - options with 'headers' keyString - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad option/headerHttp delete: url options: opts
get:headers:Primitiveurl String - URL to fetch, headers Dict - custom headers (DEPRECATED: use get:options: instead)String - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad headerHttp get: url headers: (Dict new at: 'Authorization' put: 'Bearer token')
post:body:headers:Primitiveurl String - URL to post to, body String - request body, headers Dict - custom headers (DEPRECATED: use post:body:options: instead)String - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad headerHttp post: url body: json headers: headers
put:body:headers:Primitiveurl String - URL to put to, body String - request body, headers Dict - custom headers (DEPRECATED: use put:body:options: instead)String - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad headerHttp put: url body: json headers: headers
delete:headers:Primitiveurl String - URL to delete, headers Dict - custom headers (DEPRECATED: use delete:options: instead)String - response body. Raises Error on a transport failure, an HTTP 4xx/5xx status or a bad headerHttp delete: url headers: headers
getWithHeaders:Primitiveurl String - URL to fetchDict - 'status' (Integer), 'headers' (Dict, lowercase names) and 'body' (String), for any HTTP status. Raises Error on a transport failure or an unreadable body(Http getWithHeaders: url) at: 'status'

Integer

MethodTypeParametersReturnsExample
sinPrimitive-Float - sine value0 sin "=> 0.0"
cosPrimitive-Float - cosine value0 cos "=> 1.0"
tanPrimitive-Float - tangent value0 tan "=> 0.0"
logPrimitive-Float - natural logarithm10 log "=> 2.302..."
expPrimitive-Float - e raised to this power1 exp "=> 2.718..."
sqrtPrimitive-Float - square root16 sqrt "=> 4.0"
log10Primitive-Float - base-10 logarithm100 log10 "=> 2.0"
raisedTo:Primitiveexponent Number - power to raise toNumber - exact (Integer, or Fraction for a negative exponent) when the exponent is an Integer; Float otherwise2 raisedTo: 100 "=> 1267650600228229401496703205376"
floorPrimitive-Integer - self (integers are already whole)42 floor "=> 42"
ceilingPrimitive-Integer - self (integers are already whole)42 ceiling "=> 42"
roundedPrimitive-Integer - self (integers are already whole)42 rounded "=> 42"
bitShift:Primitivecount Integer - number of bits to shift (positive=left, negative=right)Integer - shifted value1 bitShift: 10 "=> 1024"
bitAnd:Primitiveother Integer - value to AND withInteger - bitwise AND result7 bitAnd: 3 "=> 3"
bitOr:Primitiveother Integer - value to OR withInteger - bitwise OR result4 bitOr: 3 "=> 7"
bitXor:Primitiveother Integer - value to XOR withInteger - bitwise XOR result7 bitXor: 3 "=> 4"
asStringPrimitive-String - decimal string representation42 asString "=> '42'"
asCharacterPrimitive-Character - Unicode character for this code point65 asCharacter "=> $A"
format:Primitivepattern String - strftime format patternString - the receiver (Unix seconds) as local time; an invalid pattern or an out-of-range timestamp raises an ErrorDateTime now format: '%Y-%m-%d' "=> '2026-01-17'"
formatUtc:Primitivepattern String - strftime format patternString - the receiver (Unix seconds) as UTC time; an invalid pattern or an out-of-range timestamp raises an ErrorDateTime now formatUtc: '%Y-%m-%d' "=> '2026-01-17'"
@Primitivey Number - y coordinatePoint - new Point with self as x10 @ 20 "=> Point(10, 20)"

Interval

MethodTypeParametersReturnsExample
startPrimitive-Integer - start value(1 to: 10) start "=> 1"
stopPrimitive-Integer - end value(1 to: 10) stop "=> 10"
stepPrimitive-Integer - step value(1 to: 10 by: 2) step "=> 2"
sizePrimitive-Integer - number of elements(1 to: 10) size "=> 10"
asArrayPrimitive-Array - interval as array(1 to: 5) asArray "=> #(1 2 3 4 5)"
includes:Primitivevalue Integer - value to checkBoolean - true if in interval(1 to: 10) includes: 5 "=> true"
by:Primitivestep Integer - new step valueInterval - new interval with step(1 to: 10) by: 2

Interval class

MethodTypeParametersReturnsExample
from:to:Primitivestart Integer - start value, end Integer - end valueInterval - new interval with step 1Interval from: 1 to: 10
from:to:by:Primitivestart Integer - start value, end Integer - end value, step Integer - step valueInterval - new interval with custom stepInterval from: 1 to: 10 by: 2

Json class

MethodTypeParametersReturnsExample
parse:Primitivestring String - JSON string to parseAny - parsed value (Dict, Array, String, Integer, Float, Boolean, nil)Json parse: '{"name": "Alice", "age": 30}'
generate:Primitivevalue Any - value to serializeString - JSON string (Symbols and Characters as strings, OrderedCollections as arrays); a value JSON cannot represent (an instance, a block, NaN or Infinity, an integer beyond 64 bits, an object Dictionary key) raises an ErrorJson generate: (Dict new at: 'name' put: 'Alice')
generate:options:Primitivevalue Any - value to serialize, options Dict - options (e.g., 'pretty' -> true)String - JSON string; errors as for generate:Json generate: data options: (Dict new at: 'pretty' put: true)

Object

MethodTypeParametersReturnsExample
namePrimitive-String - the class's short name, as written in its definition. Not unique: two modules may each define a class of the same name, so use fullName to tell them apart.Object subclass: #Point2D instanceVariableNames: ''. Point2D name "=> 'Point2D'"
fullNamePrimitive-String - the module-qualified class name ('Http.Router.WebApp'), or the plain name for a builtin or a Core class. This is what identifies a class.Module import: 'Testing'. TestRunner fullName "=> 'Testing.TestRunner'"
isKindOf:PrimitiveaClass Class - the class to test againstBoolean - true when the receiver is an instance of aClass or of one of its subclasses3 isKindOf: Integer "=> true"
respondsTo:PrimitiveaSelector Symbol - the selector to look forBoolean - true when the receiver's class, or a superclass, implements the selector'abc' respondsTo: #size "=> true"
hashPrimitive-Integer - a hash of the receiver, consistent with ='abc' hash = 'abc' hash "=> true"

OrderedCollection

MethodTypeParametersReturnsExample
sizePrimitive-Integer - number of elementscoll size
add:Primitivevalue Any - value to appendselfcoll add: 42
addFirst:Primitivevalue Any - value to prependselfcoll addFirst: 1
removeFirstPrimitive-Any - removed first elementcoll removeFirst
removeLastPrimitive-Any - removed last elementcoll removeLast
remove:Primitivevalue Any - value to removeAny - removed value, or nil if not foundcoll remove: 42
at:Primitiveindex Integer - 1-based indexAny - element at index; an index outside the collection raises an Errorcoll at: 1
at:put:Primitiveindex Integer - 1-based index of an existing element, value Any - the new elementAny - the value; an index outside the collection raises an Error (use add: to grow it)coll at: 1 put: 'x'
includes:Primitivevalue Any - value to search forBoolean - true if foundcoll includes: 42
firstPrimitive-Any - first elementcoll first
lastPrimitive-Any - last elementcoll last
asArrayPrimitive-Array - elements as arraycoll asArray
copyFrom:to:Primitivestart Integer - 1-based start index, end Integer - 1-based end index (inclusive)OrderedCollection - new sliced collectioncoll copyFrom: 2 to: 4

OrderedCollection class

MethodTypeParametersReturnsExample
newPrimitive-OrderedCollection - new empty collectionOrderedCollection new

ParseTree

MethodTypeParametersReturnsExample
captureNamed:Primitivename String - capture nameString - captured text, or nil if not foundtree captureNamed: 'className'
capturesNamed:Primitivename String - capture nameArray - array of all captured texts with that nametree capturesNamed: 'param'
captureNodeNamed:Primitivename String - capture nameParseTree - the capture node itself, or nil if not foundtree captureNodeNamed: 'body'
childrenPrimitive-Array - array of child ParseTree nodestree children
textPrimitive-String - the text content of this nodetree text
namePrimitive-String - the name of this node (rule name, terminal name, or capture name)tree name
isTerminalPrimitive-Boolean - true if this is a terminal nodetree isTerminal
isNonTerminalPrimitive-Boolean - true if this is a non-terminal nodetree isNonTerminal
isCapturePrimitive-Boolean - true if this is a capture nodetree isCapture

Path class

MethodTypeParametersReturnsExample
basename:Primitivepath String - file pathString - file name without directoryPath basename: '/home/user/file.txt' "=> 'file.txt'"
dirname:Primitivepath String - file pathString - directory part of pathPath dirname: '/home/user/file.txt' "=> '/home/user'"
extension:Primitivepath String - file pathString - file extension (without dot)Path extension: 'file.txt' "=> 'txt'"
join:with:Primitivebase String - base path, child String - child pathString - joined pathPath join: '/home' with: 'user' "=> '/home/user'"
absolute:Primitivepath String - relative pathString|nil - the absolute path with links resolved (on Windows C:... or \server\share..., without the \?\ prefix), or nil if the path does not exist; any other failure (no permission, invalid path) raises an Error with the OS reasonPath absolute: 'file.txt'
exists:Primitivepath String - path to checkBoolean - true if path existsPath exists: '/tmp'
isDirectory:Primitivepath String - path to checkBoolean - true if path is a directoryPath isDirectory: '/tmp'

Point

MethodTypeParametersReturnsExample
xPrimitive-Number - x coordinate(10 @ 20) x "=> 10"
yPrimitive-Number - y coordinate(10 @ 20) y "=> 20"
x:Primitivevalue Number - new x coordinateselfpoint x: 30
y:Primitivevalue Number - new y coordinateselfpoint y: 40

Process class

MethodTypeParametersReturnsExample
run:args:Primitivecommand String - command to run (not through a shell), args Array - the arguments: Strings, or Integers (passed as their decimal digits); any other element raises an Error naming its positionInteger - the exit code; 128 + the signal number for a process a signal ended (Unix). A command that cannot be started (not found, no permission) raises an Error naming it and the OS reasonProcess run: 'ls' args: #('-la')
output:args:Primitivecommand String - command to run (not through a shell), args Array - the arguments, as for run:args:String - the captured stdout, whatever the exit code (use run:args: when the code matters); stderr passes through to this process's stderr. A command that cannot be started raises an Error naming it and the OS reasonProcess output: 'echo' args: #('hello')

Random class

MethodTypeParametersReturnsExample
nextPrimitive-Float - random float between 0.0 and 1.0Random next
nextInt:Primitivemax Integer - exclusive upper boundInteger - random integer from 0 to max-1 (uniform); a max of 0 or less raises an ErrorRandom nextInt: 100

Set

MethodTypeParametersReturnsExample
add:Primitivevalue Any - value to addselfset add: 42
includes:Primitivevalue Any - value to checkBoolean - true if memberset includes: 42
sizePrimitive-Integer - number of elementsset size
remove:Primitivevalue Any - value to removeAny - removed value, or nilset remove: 42
union:Primitiveother Set - set to union withSet - new set with all elementsset1 union: set2
intersection:Primitiveother Set - set to intersect withSet - new set with common elementsset1 intersection: set2
difference:Primitiveother Set - set to subtractSet - new set with elements not in otherset1 difference: set2
asArrayPrimitive-Array - elements as arrayset asArray

Set class

MethodTypeParametersReturnsExample
newPrimitive-Set - new empty setSet new

Sha2 class

MethodTypeParametersReturnsExample
hash256:Primitivedata String - data to hashString - SHA-256 hash as hex stringSha2 hash256: 'hello'
sha256:Primitivedata String - data to hash (alias for hash256:)String - SHA-256 hash as hex stringSha2 sha256: 'hello'
hash512:Primitivedata String - data to hashString - SHA-512 hash as hex stringSha2 hash512: 'hello'
sha512:Primitivedata String - data to hash (alias for hash512:)String - SHA-512 hash as hex stringSha2 sha512: 'hello'

Sqlite

MethodTypeParametersReturnsExample
execute:Primitivesql String - one or more SQL statements separated by ';', all executed in orderInteger - number of rows inserted, updated or deleted; raises Error with SQLite's message on failuredb execute: 'CREATE TABLE users (id INTEGER, name TEXT)'
execute:with:Primitivesql String - one SQL statement with ? placeholders, params Array - parameter values (Integer, Float, String, ByteArray, Boolean as 1/0, nil as NULL)Integer - number of rows inserted, updated or deleted; raises Error with SQLite's message on failuredb execute: 'INSERT INTO users VALUES (?, ?)' with: #(1 'Alice')
query:Primitivesql String - one SELECT statementArray - array of Dict rows (empty when no row matches); raises Error with SQLite's message on failuredb query: 'SELECT * FROM users'
query:with:Primitivesql String - one SELECT statement with ? placeholders, params Array - parameter values (as for execute:with:)Array - array of Dict rows (empty when no row matches); raises Error with SQLite's message on failuredb query: 'SELECT * FROM users WHERE id = ?' with: #(1)
queryScalar:Primitivesql String - one SELECT statementAny - first column of the first row (nil when no row matches); raises Error with SQLite's message on failuredb queryScalar: 'SELECT COUNT(*) FROM users'
queryScalar:with:Primitivesql String - one SELECT statement with ? placeholders, params Array - parameter values (as for execute:with:)Any - first column of the first row (nil when no row matches); raises Error with SQLite's message on failuredb queryScalar: 'SELECT name FROM users WHERE id = ?' with: #(1)

Sqlite class

MethodTypeParametersReturnsExample
open:Primitivepath String - database file path (':memory:' for in-memory DB)Sqlite - database connection; raises Error with SQLite's reason if it cannot be openedSqlite open: 'mydb.sqlite'
openWith:Primitivepath String - database file path (alias for open:)Sqlite - database connection; raises Error with SQLite's reason if it cannot be openedSqlite openWith: ':memory:'

Stdin class

MethodTypeParametersReturnsExample
readLinePrimitive-String|nil - one line from standard input without its line ending ('' for an empty line), nil at end of input; a read error (e.g. invalid UTF-8) raises an ErrorStdin readLine
readAllPrimitive-String - all remaining input from stdin ('' when there is none); a read error (e.g. invalid UTF-8) raises an ErrorStdin readAll

String

MethodTypeParametersReturnsExample
sizePrimitive-Integer - number of characters'hello' size "=> 5"
at:Primitiveindex Integer - 1-based indexCharacter - character at index; an index outside the string raises an Error'hello' at: 2 "=> $e"
,Primitiveother String - string to appendString - concatenated string'hello' , ' world' "=> 'hello world'"
split:Primitivedelimiter String - delimiter to split onArray - array of substrings'a,b,c' split: ',' "=> #('a' 'b' 'c')"
trimPrimitive-String - string with leading/trailing whitespace removed' hello ' trim "=> 'hello'"
asUppercasePrimitive-String - uppercase version'hello' asUppercase "=> 'HELLO'"
asLowercasePrimitive-String - lowercase version'HELLO' asLowercase "=> 'hello'"
includes:Primitivesubstring String - substring to search forBoolean - true if contains substring'hello' includes: 'ell' "=> true"
beginsWith:Primitiveprefix String - prefix to checkBoolean - true if starts with prefix'hello' beginsWith: 'he' "=> true"
endsWith:Primitivesuffix String - suffix to checkBoolean - true if ends with suffix'hello' endsWith: 'lo' "=> true"
copyFrom:to:Primitivestart Integer - 1-based start index, end Integer - 1-based end index (inclusive)String - substring'hello' copyFrom: 2 to: 4 "=> 'ell'"
replace:with:Primitiveold String - substring to replace (first occurrence), new String - replacement stringString - new string with replacement'hello' replace: 'l' with: 'L' "=> 'heLlo'"
replaceAll:with:Primitiveold String - substring to replace (all occurrences), new String - replacement stringString - new string with all replacements'hello' replaceAll: 'l' with: 'L' "=> 'heLLo'"
*Primitivecount Integer - number of repetitionsString - repeated string'ab' * 3 "=> 'ababab'"
match:Primitivepattern String - regex patternBoolean - true if matches; an invalid regex raises an Error with the regex parser's message'hello' match: 'h.*o' "=> true"
matchGroups:Primitivepattern String - regex pattern with capture groupsDict|nil - the whole match under 'match', each group under its number from '1' (and a named group (?P...) also under its name), nil for a group that did not take part; nil if no match; an invalid regex, or a group named match, raises an Error('hello123' matchGroups: '([a-z]+)([0-9]+)') at: '2' "=> '123'"
regexMatches:Primitivepattern String - regex patternArray - every match in order as #(start stop groups): 1-based character positions (stop inclusive) and a Dict keyed as matchGroups: keys it ('match', '1', '2', ..., names); an invalid regex raises an Error('a1b22' regexMatches: '[0-9]+') collect: [:m | m first] "=> #(2 4)"
extract:Primitivepattern String - template, not a regex: literal text with %name placeholdersDict|nil - each placeholder's text keyed by its name, or nil if the template does not match; a placeholder name used twice raises an Error('user=alice id=42' extract: 'user=%name id=%id') at: 'id' "=> '42'"
replaceRegex:with:Primitivepattern String - regex pattern, replacement String - replacement: $match is the whole match, $1, $2, ... (or $name) a group, ${...} when letters follow, $$ a dollar sign; $0 raises an Error (the whole match is $match)String - string with all matches replaced; an invalid regex raises an Error with the regex parser's message'hello world' replaceRegex: '\\w+' with: '[$match]' "=> '[hello] [world]'"
asIntegerPrimitive-Integer|nil - parsed integer value, nil if the text is not an integer'42' asInteger "=> 42"
asNumberPrimitive-Number|nil - parsed Integer or Float, nil if the text is not a number'3.14' asNumber "=> 3.14"
asStringPrimitive-String - self'hello' asString "=> 'hello'"
displayWidthPrimitive-Integer - display width (handles CJK characters)'hello' displayWidth "=> 5"
findString:startingAt:Primitivesubstring String - substring to find, start Integer - 1-based character position to start fromInteger - 1-based character index, or 0 if not found'hello' findString: 'l' startingAt: 1 "=> 3"
indexOf:Primitivesubstring String - substring to findInteger - 1-based index, or 0 if not found'hello' indexOf: 'l' "=> 3"
regexEscapePrimitive-String - string with regex metacharacters escaped'a.b*c' regexEscape "=> 'a\\.b\\*c'"
asSymbolPrimitive-Symbol - the symbol with the receiver's characters (ANSI 5.7.10.8); a Symbol answers itself'at:put:' asSymbol "=> #at:put:"
copyReplaceAll:with:Primitiveold String - substring to replace, new String - replacementString - every non-overlapping occurrence, left to right, replaced (ANSI 5.7.10.10; same as replaceAll:with:)'abcabc' copyReplaceAll: 'bc' with: 'X' "=> 'aXaX'"

StringStream

MethodTypeParametersReturnsExample
nextPutAll:Primitivestring String - string to appendselfstream nextPutAll: 'Hello'
contentsPrimitive-String - accumulated string contentsstream contents
sizePrimitive-Integer - current length of contentsstream size
resetPrimitive-self - clears the bufferstream reset
nextPut:Primitivechar Character - character to appendselfstream nextPut: $A

StringStream class

MethodTypeParametersReturnsExample
newPrimitive-StringStream - new empty string streamStringStream new
new:PrimitiveinitialCapacity Integer - initial buffer capacityStringStream - new string stream with capacityStringStream new: 1024

System

MethodTypeParametersReturnsExample
cwdPrimitive-String - the current working directory; raises an Error with the OS reason if it cannot be read (e.g. it was deleted)System cwd
chdir:Primitivepath String - the directory to change toBoolean - true; raises an Error naming the path and the OS reason when the directory cannot be enteredSystem chdir: '/tmp'

System class

MethodTypeParametersReturnsExample
argsPrimitive-Array - command line argumentsSystem args
heapSizePrimitive-Integer - current heap size in bytesSystem heapSize
stringHeapSizePrimitive-Integer - current string heap size (number of string objects)System stringHeapSize
platformPrimitive-String - platform name ('windows', 'linux', 'macos')System platform
exit:Primitivecode Integer - exit codenever returns (process exits)System exit: 0
nilTolerantEnterPrimitive-nil - enters nil-tolerant mode (nil message sends return nil)System nilTolerantEnter
nilTolerantLeavePrimitive-nil - leaves nil-tolerant modeSystem nilTolerantLeave
isNilTolerantPrimitive-Boolean - true if in nil-tolerant modeSystem isNilTolerant
performGCPrimitive-nil - triggers garbage collectionSystem performGC
gcPrimitive-nil - alias for performGCSystem gc
gcThresholdPrimitive-Integer - current GC threshold in bytesSystem gcThreshold
gcThreshold:Primitivebytes Integer - new GC threshold in bytesnilSystem gcThreshold: 1000000
onInterrupt:Primitiveblock Block - handler to call on SIGINT (Ctrl+C); a later onInterrupt: replaces itnil - raises an Error with the OS reason if the signal handler cannot be installedSystem onInterrupt: [ 'Interrupted!' displayNl. System exit: 1 ]
clearInterruptHandlerPrimitive-nil - removes the interrupt handlerSystem clearInterruptHandler
classNamed:Primitivename String - a module-qualified class name ('Testing.TestRunner'), or a short name when only one class carries itClass|nil - the class object, or nil when no class matches or when a short name is ambiguous (two modules may each define a class of that name; qualify it)System classNamed: 'String'
allClassesPrimitive-Array - the module-qualified name of every class in the system; a builtin or Core class appears under its plain nameSystem allClasses
sleep:Primitivems Integer - milliseconds to sleepnilSystem sleep: 1000
cwdPrimitive-String - the current working directory; raises an Error with the OS reason if it cannot be read (e.g. it was deleted)System cwd
chdir:Primitivepath String - the directory to change toBoolean - true; raises an Error naming the path and the OS reason when the directory cannot be enteredSystem chdir: '/tmp'

Tcp class

MethodTypeParametersReturnsExample
connect:port:Primitivehost String - hostname or IP address, port Integer - port number (0..65535)TcpStream - connection. Raises Error naming host:port and the reason when the connection cannot be madeTcp connect: 'localhost' port: 8080
connect:port:timeout:Primitivehost String - hostname or IP address, port Integer - port number (0..65535), timeout Integer - timeout in milliseconds (positive)TcpStream - connection. Raises Error naming host:port and the reason (including a timeout)Tcp connect: 'localhost' port: 8080 timeout: 5000

TcpListener

MethodTypeParametersReturnsExample
acceptPrimitive-TcpStream - accepted connection (blocking). Raises Error with the reason when accept fails or the listener is closedlistener accept
closePrimitive-Boolean - true. Releases the port; closing twice is not an errorlistener close

TcpListener class

MethodTypeParametersReturnsExample
listen:Primitiveport Integer - port to listen on (binds to 0.0.0.0)TcpListener - listener. Raises Error with the reason when the port cannot be boundTcpListener listen: 8080
listenOn:port:Primitiveaddress String - address to bind (e.g., '127.0.0.1'), port Integer - port to listen onTcpListener - listener. Raises Error with the reason when the address cannot be boundTcpListener listenOn: '127.0.0.1' port: 8080

TcpStream

MethodTypeParametersReturnsExample
send:Primitivedata String|ByteArray - data to sendInteger - bytes sent (all of data). Raises Error when the write failsstream send: 'GET / HTTP/1.0\r\n\r\n'
recv:PrimitivemaxBytes Integer - maximum bytes to receive (0 or more)ByteArray - received data, or nil when the peer has closed. Raises Error on a read error or a read timeout (30 s)stream recv: 4096
recvPrimitive-ByteArray - received data (at most 4096 bytes), or nil when the peer has closed. Raises Error on a read error or timeoutstream recv
recvLinePrimitive-String - line without newline, or nil when the peer has closed. Raises Error on a read error, a timeout or a line that is not UTF-8stream recvLine
closePrimitive-Boolean - true. Shuts down both directions; closing an already closed connection is not an errorstream close

Template class

MethodTypeParametersReturnsExample
render:with:Primitivetemplate String - Mustache template string, data Dict - data dictionary for template renderingString - rendered result; a template that does not compile or render raises an Error with mustache's messageTemplate render: 'Hello, {{name}}!' with: (Dict new at: 'name' put: 'World')

Time class

MethodTypeParametersReturnsExample
millisecondClockPrimitive-Integer - milliseconds since VM startup (monotonic)Time millisecondClock
nanosecondClockPrimitive-Integer - nanoseconds since VM startup (monotonic)Time nanosecondClock

Toml class

MethodTypeParametersReturnsExample
parse:Primitivestring String - TOML string to parseDict - parsed TOML as dictionaryToml parse: '[section]\nkey = "value"'

WriteHandle

MethodTypeParametersReturnsExample
write:Primitivecontent String - string to write (no newline)self; a write failure raises an Error with the reasonhandle write: 'Hello'
writeLine:Primitivecontent String - string to write with newlineself; a write failure raises an Error with the reasonhandle writeLine: 'Hello World'
flushPrimitive-self - flushes buffer to disk; a failure raises an Error with the reasonhandle flush
closePrimitive-nil - flushes and closes the file; a failed flush raises an Error with the reasonhandle close

WriteHandle class

MethodTypeParametersReturnsExample
open:Primitivepath String - file path to writeWriteHandle - handle for streaming writes (creates or truncates the file); a file that cannot be created raises an Error with the reasonhandle := WriteHandle open: 'output.txt'

Yaml class

MethodTypeParametersReturnsExample
parse:Primitivestring String - YAML string to parseAny - parsed valueYaml parse: 'name: Alice\nage: 30'

標準ライブラリ

Classes defined in lib/*.st.

Ansi class

MethodTypeParametersReturnsExample
escSmalltalk-String - ESC characterAnsi esc
csiSmalltalk-String - CSI sequence (ESC[)Ansi csi
resetSmalltalk-String - ANSI reset sequenceAnsi reset
wrap: aString with: codeSmalltalkaString String - text to wrap, code String - ANSI codeString - wrapped with ANSI escapeAnsi wrap: 'hello' with: '31'

Array

MethodTypeParametersReturnsExample
productSmalltalk-Number - product of all elements#(1 2 3 4) product => 24
firstSmalltalk-Object - first element#(a b c) first
lastSmalltalk-Object - last element#(a b c) last
allButFirstSmalltalk-Array - all elements except first#(1 2 3) allButFirst
allButLastSmalltalk-Array - all elements except last#(1 2 3) allButLast
take: countSmalltalkcount Integer - number of elements to takeArray - first count elements#(1 2 3 4 5) take: 3
drop: countSmalltalkcount Integer - number of elements to skipArray - remaining elements after skip#(1 2 3 4 5) drop: 2
copySmalltalk-Array - shallow copy#(1 2 3) copy
copyWith: elementSmalltalkelement Object - element to appendArray - new array with element at end#(1 2) copyWith: 3
copyWithout: elementSmalltalkelement Object - element to removeArray - new array without element#(1 2 3 2) copyWithout: 2
= anObjectSmalltalkanObject Object - the object to compare withBoolean - true for an Array of the same size whose elements are = in order#(1 2) = #(1 2)
indexOf: elementSmalltalkelement Object - element to findInteger - 1-based index or 0 if not found#(a b c) indexOf: b
flattenSmalltalk-Array - flattened by one level#((1 2) (3 4)) flatten
uniqueSmalltalk-Array - with duplicates removed#(1 2 1 3 2) unique
reversedSmalltalk-Array - elements in reverse order#(1 2 3) reversed
zip: otherSmalltalkother Array - array to zip withArray - array of pairs#(1 2 3) zip: #(a b c)
sortBy: aBlockSmalltalkaBlock Block - comparator [:a :b | a < b] returns true if a should come before bArray - sorted by comparator#(3 1 4) sortBy: [:a :b | a > b]

Array class

MethodTypeParametersReturnsExample
withAll: aCollectionSmalltalkaCollection Collection - source collectionArray - new array with all elementsArray withAll: (1 to: 5)
with: anObjectSmalltalkanObject Object - the elementArray - single-element arrayArray with: 42
with: first with: secondSmalltalkfirst Object - first element, second Object - second elementArray - two-element arrayArray with: 1 with: 2
with: first with: second with: thirdSmalltalkfirst Object - first element, second Object - second element, third Object - third elementArray - three-element arrayArray with: 1 with: 2 with: 3
with: first with: second with: third with: fourthSmalltalkfirst Object - first element, second Object - second element, third Object - third element, fourth Object - fourth elementArray - four-element arrayArray with: 1 with: 2 with: 3 with: 4

ByteArray

MethodTypeParametersReturnsExample
do: aBlockSmalltalkaBlock Block - block to evaluate for each element (byte value 0-255)nil(ByteArray fromString: 'ABC') do: [:b | b displayNl]

CLI.ArgParser

MethodTypeParametersReturnsExample
name: aNameSmalltalkaName String - program nameArgParser - self for chainingparser name: 'my-tool'
description: descSmalltalkdesc String - program descriptionArgParser - self for chainingparser description: 'A useful tool'
flag: longName short: shortName description: descSmalltalklongName String - long flag name, shortName String - short flag name, desc String - descriptionArgParser - self for chainingparser flag: 'verbose' short: 'v' description: 'Verbose'
option: longName short: shortName description: descSmalltalklongName String - long option name, shortName String - short option name, desc String - descriptionArgParser - self for chainingparser option: 'output' short: 'o' description: 'Output file'
positional: aName description: descSmalltalkaName String - positional arg name, desc String - descriptionArgParser - self for chainingparser positional: 'input' description: 'Input file'
parse: argsSmalltalkargs Array - command line argumentsParseResult - parsed resultparser parse: System args

CLI.ParseResult

MethodTypeParametersReturnsExample
isSuccessSmalltalk-Boolean - true if parse succeededresult isSuccess
flag: nameSmalltalkname String - flag nameBoolean - true if flag was setresult flag: 'verbose'
option: nameSmalltalkname String - option nameString - option value or nilresult option: 'output'
positional: nameSmalltalkname String - positional arg nameString - positional value or nilresult positional: 'input'
extrasSmalltalk-Array - extra positional argumentsresult extras

Collection

MethodTypeParametersReturnsExample
isEmptySmalltalk-Boolean - true if collection has no elements#() isEmpty
notEmptySmalltalk-Boolean - true if collection has at least one element#(1 2 3) notEmpty
secondSmalltalk-Object - the second element#(a b c) second
thirdSmalltalk-Object - the third element#(a b c) third
do: aBlockSmalltalkaBlock Block - block to evaluate for each elementnil#(1 2 3) do: [:x | x displayNl]
collect: aBlockSmalltalkaBlock Block - transformation blockCollection - new collection with transformed elements#(1 2 3) collect: [:x | x * 2]
select: aBlockSmalltalkaBlock Block - predicate blockCollection - elements where block returns true#(1 2 3 4) select: [:x | x > 2]
reject: aBlockSmalltalkaBlock Block - predicate blockCollection - elements where block returns false#(1 2 3 4) reject: [:x | x > 2]
detect: aBlockSmalltalkaBlock Block - predicate blockObject - first matching element or nil#(1 2 3 4) detect: [:x | x > 2]
detect: aBlock ifNone: exceptionBlockSmalltalkaBlock Block - predicate block, exceptionBlock Block - block to evaluate if not foundObject - first match or exceptionBlock result#(1 2 3) detect: [:x | x > 5] ifNone: [0]
inject: initialValue into: aBlockSmalltalkinitialValue Object - initial accumulator value, aBlock Block - two-arg block [:acc :each | ...]Object - final accumulated value#(1 2 3) inject: 0 into: [:sum :x | sum + x]
doWithIndex: aBlockSmalltalkaBlock Block - two-arg block [:elem :index | ...]nil#(a b c) doWithIndex: [:e :i | (i,e) displayNl]
ifEmpty: aBlockSmalltalkaBlock Block - block to evaluate if emptyObject - block result or self#() ifEmpty: ['none']
ifNotEmpty: aBlockSmalltalkaBlock Block - block to evaluate with selfObject - block result or self#(1 2) ifNotEmpty: [:c | c size]
count: aBlockSmalltalkaBlock Block - predicate blockInteger - count of matches#(1 2 3 4) count: [:x | x > 2]
includes: anObjectSmalltalkanObject Object - object to findBoolean - true if found#(1 2 3) includes: 2
join: separatorSmalltalkseparator String - separator between elementsString - joined elements#(1 2 3) join: ', '
anySatisfy: aBlockSmalltalkaBlock Block - predicate blockBoolean - true if any match#(1 2 3) anySatisfy: [:x | x > 2]
allSatisfy: aBlockSmalltalkaBlock Block - predicate blockBoolean - true if all match#(2 4 6) allSatisfy: [:x | x even]
noneSatisfy: aBlockSmalltalkaBlock Block - predicate blockBoolean - true if none match#(1 3 5) noneSatisfy: [:x | x even]
groupBy: keyBlockSmalltalkkeyBlock Block - block to compute keyDictionary - grouped elements#(1 2 3 4) groupBy: [:x | x even]
tallySmalltalk-Dictionary - element occurrence counts#(a b a c) tally
reverseDo: aBlockSmalltalkaBlock Block - one-arg block, called with each element, last first (ANSI 5.7.8.27)-#(1 2 3) reverseDo: [:x | x displayNl]
reverseSmalltalk-Collection - the elements in reverse order, same kind as the receiver (ANSI 5.7.8.26)'abc' reverse => 'cba'
with: aCollection do: aBlockSmalltalkaCollection Collection - same size as the receiver, aBlock Block - two-arg block, called with the elements at each index (ANSI 5.7.8.28)-#(1 2) with: #(10 20) do: [:a :b | (a + b) displayNl]
from: start to: stop do: aBlockSmalltalkstart Integer - first index, stop Integer - last index, aBlock Block - one-arg block, called with each element in that range (ANSI 5.7.8.18)-#(10 20 30) from: 2 to: 3 do: [:x | x displayNl]
keysAndValuesDo: aBlockSmalltalkaBlock Block - two-arg block, called with each index and element (ANSI 5.7.8.24)-'ab' keysAndValuesDo: [:i :c | i displayNl]
copyWith: newElementSmalltalknewElement Object - appended elementCollection - a copy of the receiver with newElement at the end (ANSI 5.7.8.12)'abc' copyWith: $d => 'abcd'
copyReplaceAll: targetElements with: replacementElementsSmalltalktargetElements Collection - subsequence to find, replacementElements Collection - what replaces each matchCollection - a copy with every non-overlapping match, left to right, replaced (ANSI 5.7.8.8)#(1 2 3 1 2) copyReplaceAll: #(1 2) with: #(9) => #(9 3 9)
do: aBlock separatedBy: separatorBlockSmalltalkaBlock Block - one-arg block for each element, separatorBlock Block - evaluated between elements, not before the first (ANSI 5.7.1.14)-#(1 2 3) do: [:x | x display] separatedBy: [', ' display]
asArraySmalltalk-Array - the receiver's elements, in order if it has one (ANSI 5.7.1.3)-
asOrderedCollectionSmalltalk-OrderedCollection - the receiver's elements, in order if it has one (ANSI 5.7.1.6)-
asSetSmalltalk-Set - the receiver's elements without duplicates (ANSI 5.7.1.7)-
addAll: aCollectionSmalltalkaCollection Collection - elements to add with add:, in its do: order (ANSI 5.7.5.2)Collection - aCollection-
remove: oldElementSmalltalkoldElement Object - the first element = to it is removedCollection - selfcoll remove: 3
remove: oldElement ifAbsent: aBlockSmalltalkoldElement Object - element to remove (the first equal one), aBlock Block - evaluated, and its value answered, when there is none (ANSI 5.7.5.4)Object - the removed element-
removeAll: aCollectionSmalltalkaCollection Collection - each element is removed with remove: (ANSI 5.7.5.5)Collection - aCollection-

Collection class

MethodTypeParametersReturnsExample
withAll: aCollectionSmalltalkaCollection Collection - source collectionCollection - new collection with all elementsOrderedCollection withAll: #(1 2 3)

Core.Association class

MethodTypeParametersReturnsExample
key: aKey value: aValueSmalltalkaKey Object - the key, aValue Object - the valueAssociation - key-value pairAssociation key: 'name' value: 'John'

Core.Block

MethodTypeParametersReturnsExample
valueWithArguments: anArraySmalltalkanArray Array - the arguments, as many as the block takes (ANSI 5.4.1.2)Object - the block's value[:a :b | a + b] valueWithArguments: #(1 2) => 3
ifCurtailed: terminationBlockSmalltalkterminationBlock Block - evaluated only if the receiver does not complete normally (non-local return, exception unwinding) (ANSI 5.4.3.2)Object - the receiver's value-
timeToRunSmalltalk-Integer - milliseconds taken to execute the block[ 1000 timesRepeat: [ 1 + 1 ] ] timeToRun

Core.Boolean

MethodTypeParametersReturnsExample
& aBooleanSmalltalkaBoolean Object - the other operandObject - false when the receiver is false, else aBoolean (ANSI )(3 > 2) & (2 > 1) => true
| aBooleanSmalltalkaBoolean Object - the other operandObject - true when the receiver is true, else aBoolean (ANSI )(3 > 2) | (1 > 2) => true

Core.Exception class

MethodTypeParametersReturnsExample
signal: aStringSmalltalkaString String - exception message- raises an instance of the receiver classException signal: 'Error occurred'
, anExceptionSelectorSmalltalkanExceptionSelector - an exception class or ExceptionSetExceptionSet - the receiver and the argument[1/0] on: ZeroDivide, MessageNotUnderstood do: [:e | 0]
handles: anExceptionSmalltalk-Boolean - true if anException is an instance of the receiver or a subclass-

Core.ExceptionSet

MethodTypeParametersReturnsExample
, anExceptionSelectorSmalltalkanExceptionSelector - an exception class or ExceptionSetExceptionSet - the receiver's selectors and the argument[1/0] on: ZeroDivide, MessageNotUnderstood do: [:e | 0]
handles: anExceptionSmalltalk-Boolean - true if one of the selectors handles anException-

Core.Number

MethodTypeParametersReturnsExample
between: low and: highSmalltalklow Number - lower bound (inclusive), high Number - upper bound (inclusive)Boolean - true if low <= self <= high5 between: 1 and: 10 => true
clampMin: min max: maxSmalltalkmin Number - minimum value, max Number - maximum valueNumber - self clamped to [min, max]15 clampMin: 0 max: 10 => 10

Core.Object

MethodTypeParametersReturnsExample
= anObjectSmalltalkanObject Object - the object to compare withBoolean - numbers, strings, characters and Arrays compare by value, anything else by identity; a class defines = (and hash) to compare its instances by value3 = 3.0
~= anObjectSmalltalkanObject Object - the object to compare withBoolean - (self = anObject) not, so a class that defines = gets ~= too3 ~= 4
printOn: aStreamSmalltalkaStream StringStream - the stream to write toself - writes the receiver's printString; a class defines printOn: to print its instances its own wayAccount >> printOn: aStream aStream nextPutAll: 'Account '; print: owner
displayOn: aStreamSmalltalkaStream StringStream - the stream to write toself - writes the receiver's displayString; the same as printOn: unless a class defines displayOn:'abc' displayOn: aStream
printStringSmalltalk-String - the text a programmer reads: strings quoted ('abc'), characters with $ ($a), symbols with # (#abc), an instance by its class (an Account) or its printOn:'abc' printString => '''abc'''
displayStringSmalltalk-String - the text for a user: a string without quotes, a character without $, anything else its printString'abc' displayString => 'abc'
asStringSmalltalk-String - the displayString (a String answers itself, a Symbol its name)42 asString => '42'
printNlSmalltalk-self - writes the printString and a newline to stdout'abc' printNl prints 'abc'
printSmalltalk-self - writes the printString to stdout, no newline3 print
displayNlSmalltalk-self - writes the displayString and a newline to stdout'abc' displayNl prints abc
displaySmalltalk-self - writes the displayString to stdout, no newline'abc' display
errorPrintNlSmalltalk-self - writes the printString and a newline to stderrx errorPrintNl
errorPrintSmalltalk-self - writes the printString to stderr, no newlinex errorPrint
errorDisplayNlSmalltalk-self - writes the displayString and a newline to stderr'failed' errorDisplayNl
errorDisplaySmalltalk-self - writes the displayString to stderr, no newline'failed' errorDisplay
error: aStringSmalltalkaString String - error message- raises Error exceptionself error: 'Something went wrong'
-> anObjectSmalltalkanObject Object - the valueAssociation - self as key, anObject as value'name' -> 'John'

Core.Object class

MethodTypeParametersReturnsExample
basicNewSmalltalk-Object - uninitialized instancePoint basicNew
newSmalltalk-Object - new initialized instancePoint new

Core.Path class

MethodTypeParametersReturnsExample
stem: aPathSmalltalkaPath String - file pathString - filename without extensionPath stem: 'foo/bar.txt'

Core.String

MethodTypeParametersReturnsExample
stripAnsiSmalltalk-String - with ANSI escape sequences removed'hello' red stripAnsi
displayWidthSmalltalk-Integer - display width accounting for full-width chars'hello' displayWidth
splitOn: aDelimiterSmalltalkaDelimiter String - delimiter to split onArray - array of substrings'abc' splitOn: '' splits into individual characters
between: startMark and: endMarkSmalltalkstartMark String - opening marker, endMark String - closing markerString - substring between the first occurrence of startMark and the next occurrence of endMark after it, or nil if either marker is missing.'foo[bar]baz' between: '[' and: ']' => 'bar'
allBetween: startMark and: endMarkSmalltalkstartMark String - opening marker, endMark String - closing markerOrderedCollection - all non-overlapping substrings between successive startMark / endMark pairs. Empty if no match.'[a][b][c]' allBetween: '[' and: ']'

Core.String class

MethodTypeParametersReturnsExample
join: aCollection with: aDelimiterSmalltalkaCollection Collection - elements to join, aDelimiter String - separator between elementsString - joined stringString join: #(a b c) with: ', '

Core.StringStream

MethodTypeParametersReturnsExample
print: anObjectSmalltalkanObject Object - the object to writeself - writes anObject's printStringaStream print: 42
display: anObjectSmalltalkanObject Object - the object to writeself - writes anObject's displayStringaStream display: name

Core.Time class

MethodTypeParametersReturnsExample
millisecondsToRun: aBlockSmalltalkaBlock Block - block to measureInteger - milliseconds taken to execute the blockTime millisecondsToRun: [ 1000 timesRepeat: [ 1 + 1 ] ]

Core.WriteHandle class

MethodTypeParametersReturnsExample
open: path do: aBlockSmalltalkpath String - file path to write, aBlock Block - block receiving the handleObject - result of block evaluation; the handle is closed even if the block raises; a file that cannot be opened, written or closed raises an Error with the reasonWriteHandle open: 'out.txt' do: [:h | h writeLine: 'Hello']

Dictionary

MethodTypeParametersReturnsExample
= anObjectSmalltalkanObject Object - the object to compare withBoolean - true for a Dictionary with the same keys whose values are =(Dictionary new at: 1 put: 2; yourself) = (Dictionary new at: 1 put: 2; yourself)
do: aBlockSmalltalkaBlock Block - block for each valuenildict do: [:v | v displayNl]
keysAndValuesDo: aBlockSmalltalkaBlock Block - two-arg block [:key :value | ...]nildict keysAndValuesDo: [:k :v | k displayNl]
hasKey: keySmalltalkkey Object - key to checkBoolean - true if key existsdict hasKey: 'name'
collect: aBlockSmalltalkaBlock Block - one-arg block applied to each valueDictionary - same keys, values replaced by the block results#{'a' -> 1} collect: [:v | v * 10]
select: aBlockSmalltalkaBlock Block - one-arg predicate on each valueDictionary - the entries whose value satisfies the block#{'a' -> 1. 'b' -> 2} select: [:v | v > 1]
reject: aBlockSmalltalkaBlock Block - one-arg predicate on each valueDictionary - the entries whose value does not satisfy the block#{'a' -> 1. 'b' -> 2} reject: [:v | v > 1]
at: key ifAbsent: absentBlockSmalltalkkey Object - key to look up, absentBlock Block - block if key not foundObject - value or block resultdict at: 'x' ifAbsent: [0]
at: key ifAbsentPut: aBlockSmalltalkkey Object - key to look up, aBlock Block - block to compute and store if absentObject - existing or new valuedict at: 'x' ifAbsentPut: [0]
at: key add: valueSmalltalkkey Object - bucket key, value Object - element to appendDictionary - selfmethods at: var add: sel
keyWithValue: targetValueSmalltalktargetValue Object - value to search forObject - first key (by iteration order) whose value = targetValue, or nil if no match. Iteration order is implementation defined; use keysWithValue: when expecting multiple matches.varToClass keyWithValue: 'String'
keysWithValue: targetValueSmalltalktargetValue Object - value to search forOrderedCollection - all keys whose value = targetValue. Empty if none match.varToClass keysWithValue: 'String'
merge: aDictionarySmalltalkaDictionary Dictionary - dictionary to merge into selfDictionary - self (modified)dict := Dictionary new at: 'a' put: 1. dict merge: (Dictionary new at: 'b' put: 2)
keysDo: aBlockSmalltalkaBlock Block - one-arg block, called with each key (ANSI 5.7.2.12)--
keyAtValue: valueSmalltalk-Object - a key whose value is equal to value, nil if none (ANSI 5.7.2.8)-

Env class

MethodTypeParametersReturnsExample
at: key ifAbsent: aBlockSmalltalkkey String - environment variable name, aBlock Block - evaluated if variable not foundString or block resultEnv at: 'HOME' ifAbsent: ['/tmp']

Float

MethodTypeParametersReturnsExample
integerPartSmalltalk-Float - truncated toward zero, still a Float (ANSI 5.6.2.21)-
asFractionSmalltalk-Fraction - the receiver's exact value (every finite Float is a dyadic rational) (ANSI 5.6.2.15)0.75 asFraction => (3/4)
asStringPrecision: nSmalltalkn Integer - decimal placesString - formatted with n decimal places3.14159 asStringPrecision: 2 => '3.14'

Integer

MethodTypeParametersReturnsExample
asFractionSmalltalk-Integer - an integer is its own exact fraction (ANSI 5.6.2.15)-
gcd: anIntegerSmalltalkanInteger IntegerInteger - largest non-negative common divisor; 0 gcd: 0 = 0 (ANSI 5.6.5.12)12 gcd: 18 => 6
lcm: anIntegerSmalltalkanInteger IntegerInteger - smallest non-negative common multiple; 0 if either is 0 (ANSI 5.6.5.14)4 lcm: 6 => 12
evenSmalltalk-Boolean - true if even4 even
oddSmalltalk-Boolean - true if odd5 odd

Interval

MethodTypeParametersReturnsExample
at: indexSmalltalkindex Integer - 1 to sizeNumber - start + ((index - 1) * step) (ANSI at:)(10 to: 20 by: 5) at: 2 => 15
do: aBlockSmalltalkaBlock Block - block to evaluate for each elementnil(1 to: 5) do: [:x | x displayNl]

Maybe class

MethodTypeParametersReturnsExample
value: aBlockSmalltalkaBlock Block - block to execute in nil-tolerant modeObject - block result or nilMaybe value: [dict at: 'key' at: 'sub']

Number

MethodTypeParametersReturnsExample
absSmalltalk-Number - absolute value-5 abs
min: otherSmalltalkother Number - value to compareNumber - smaller value3 min: 5
max: otherSmalltalkother Number - value to compareNumber - larger value3 max: 5
roundTo: quantumSmalltalkquantum Number - rounding precisionNumber - value rounded to nearest quantum3.14159 roundTo: 0.01 => 3.14
reciprocalSmalltalk-Number - 1 / receiver; ZeroDivide for zero (ANSI 5.6.2.29)4 reciprocal => (1/4)
squaredSmalltalk-Number - receiver * receiver (ANSI 5.6.2.35)3 squared => 9
signSmalltalk-Integer - 1, 0 or -1 (ANSI 5.6.2.33)-3 sign => -1
quo: aNumberSmalltalkaNumber Number - divisorInteger - quotient truncated toward zero (ANSI 5.6.2.26)-7 quo: 2 => -3
rem: aNumberSmalltalkaNumber Number - divisorNumber - remainder with the receiver's sign: (a quo: b) * b + (a rem: b) = a (ANSI 5.6.2.30)-7 rem: 2 => -1
asIntegerSmalltalk-Integer - the receiver truncated toward zero (rounded is the rounding form)3.7 asInteger => 3
integerPartSmalltalk-Number - the receiver truncated toward zero, in the receiver's protocol (ANSI 5.6.2.21)3.75 integerPart => 3.0
fractionPartSmalltalk-Number - receiver - receiver integerPart (ANSI 5.6.2.20; for a negative receiver the standard's two invariants disagree, this keeps integerPart + fractionPart = receiver)3.75 fractionPart => 0.75
asBytesStringSmalltalk-String - human-readable byte size (B/KB/MB/GB/TB)1073741824 asBytesString => '1 GB'

OrderedCollection

MethodTypeParametersReturnsExample
= anObjectSmalltalkanObject Object - the object to compare withBoolean - true for an OrderedCollection of the same size whose elements are = in order(OrderedCollection new add: 1; yourself) = (OrderedCollection new add: 1; yourself)
addLast: newElementSmalltalk-Object - newElement, added at the end (ANSI 5.7.18.13)-
add: newElement beforeIndex: indexSmalltalknewElement Object - element to insert, index Integer - 1 to size + 1; size + 1 appends (ANSI 5.7.18.5)Object - newElement-

Point

MethodTypeParametersReturnsExample
= anObjectSmalltalkanObject Object - the object to compare withBoolean - true for a Point with = x and y(3 @ 4) = (3 @ 4)

Shell.Sh class

MethodTypeParametersReturnsExample
run: commandStringSmalltalkcommandString String - shell command to executeInteger - exit code (0 = success). If the shell itself cannot be started, an Error names it and the OS reasonSh run: 'git status'
output: commandStringSmalltalkcommandString String - shell command to executeString - stdout content, whatever the exit code; stderr passes through to this process's stderr. If the shell itself cannot be started, an Error names it and the OS reason(Sh output: 'echo hello') displayNl
lines: commandStringSmalltalkcommandString String - shell command to executeArray - array of output lines(Sh lines: 'ls') do: [:l | l displayNl]
success: commandStringSmalltalkcommandString String - shell command to executeBoolean - true if exit code is 0 (a command the shell cannot find is a non-zero exit, so false)(Sh success: 'test -f README.md') ifTrue: ['exists' displayNl]

String

MethodTypeParametersReturnsExample
redSmalltalk-String - red colored text'error' red
greenSmalltalk-String - green colored text'ok' green
yellowSmalltalk-String - yellow colored text'warning' yellow
blueSmalltalk-String - blue colored text'info' blue
boldSmalltalk-String - bold text'important' bold
underlineSmalltalk-String - underlined text'link' underline
firstSmalltalk-Character - the first character, nil when the string is empty (as Array first)'abc' first => $a
lastSmalltalk-Character - the last character, nil when the string is empty (as Array last)'abc' last => $c
reversedSmalltalk-String - characters in reverse order'abc' reversed => 'cba'
linesSmalltalk-Array - array of lines; a line ends at LF, CRLF or CR, and the terminator is not part of the line (Windows command output is CRLF)'a\\r\\nb\\nc' lines
wordsSmalltalk-Array - array of words split by whitespace'hello world' words
isBlankSmalltalk-Boolean - true if empty or whitespace only' ' isBlank
trimLeftSmalltalk-String - with leading whitespace removed' hello' trimLeft
trimRightSmalltalk-String - with trailing whitespace removed'hello ' trimRight
includes: aStringSmalltalkaString String - substring to findBoolean - true if substring exists'hello world' includes: 'wor'
replaceRegex: pattern do: aBlockSmalltalkpattern String - regex pattern with capture groups, aBlock Block - receives the Dict of the match's parts ('match' is the whole match, '1', '2', ... the groups, as in matchGroups:), returns the replacement stringString - with every match replaced by the block's result'hello123world456' replaceRegex: '([0-9]+)' do: [:g | '[' , (g at: '1') , ']']
format: collectionSmalltalkcollection Array - values to substituteString - with {1}, {2}, etc replaced'Hello {1}!' format: #('World')
truncateDisplay: maxWidthSmalltalkmaxWidth Integer - maximum display widthString - truncated string fitting within maxWidth'Hello World' truncateDisplay: 5
fitDisplay: widthSmalltalkwidth Integer - target display widthString - truncated and padded string of exact display width'Hi' fitDisplay: 10
sameAs: aStringSmalltalkaString String - string to compareBoolean - true if the two collate the same; LST's collation ignores case (ANSI 5.7.10.14)'Hello' sameAs: 'hello' => true
subStrings: separatorsSmalltalkseparators String - the separator characters (or any collection of Characters)Array - the runs of characters between separators, empty runs dropped (ANSI 5.7.10.15)'a, b,,c' subStrings: ', ' => #('a' 'b' 'c')

String class

MethodTypeParametersReturnsExample
with: aCharacterSmalltalkaCharacter Character - the string's one characterString - a string of that one Character (ANSI )String with: $a => 'a'

Text.TablePrinter

MethodTypeParametersReturnsExample
alignments: anArraySmalltalkanArray - Array of alignment symbols (#left, #right, #center)selftable alignments: #(#left #right #left)
maxWidths: anArraySmalltalkanArray - Array of max column widths (0 = no limit)selftable maxWidths: #(32 60 40)
alignmentAt: indexSmalltalkindex - Column index (1-based)Symbol - alignment for the column (#left, #right, or #center)-
padCell: aString width: aWidth alignment: anAlignmentSmalltalkaString - Cell content, aWidth - Target width, anAlignment - Alignment symbol (#left, #right, #center)String - padded and truncated string-

tools/generate_api_grammar.stにより生成