![]() | objective.st | ||||||||||
| LanguageLiteralsNumbers:
Strings:
Interpolated Strings:
Arrays:
Dictionaries:
Objects:
Object templates
.', } IdentifiersSee URIs. MessagesLike Smalltalk, virtually all of the basics of expressions are handlde by message conneectors, and again like Smalltalk, Objective-S distinguishes three kinds of messaege: unary, binary, keyword. Unary:
Binary:
Keyword:
The statement separator is the period ' Objective-S has two mechanisms for chaining muliple messages. The cascade, denoted by a semicolon, sends multiple messages to the same receiver:
The pipe '
AssignmentThe assignment connector uses the left arrow '←', but also accepts the Smalltalk/Pascal convention of ':='.
Blocks and Control StructuresBlocks in Objective-S use curly brackets.
Block parameters are separated from the body by the pipe symbol ('|') like in Smalltalk and start with colons:
As is the case in Smalltalk, control structures are implemented using blocks and plain message sends, for example conditionals, which can be used as expressions.
ClassesClasses are components that correspond to the class construct from other object-oriented languages.
Superclass can be omitted. Each kind of component has its own default superclass, in the cases of classes
that superclass is
MethodsMethod components are defined using a syntax that is closely modeled on Objetive-C, with thee minus sign '-' introducing an instance method definition. The method body is enclosed in curly braces. There is no need for a return statement, no return type given means an object is returned.
Parameters
Types are enclosed in angle brackets:
ProtocolsSimilar to the way that classes are components that group method components, protocols are compound connectors that group message connectors.
Protocols can be referenced by name:
This is equivalent to Objective-C's @protocol() expression. FiltersTBD. Schemes (Stores)TBD. | ||||||||||
Copyright (c) 2012-2020 Marcel Weiher (st) |