-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More stuff in internals documentation.
- Type "Function" renamed to "func", because until the future new version of Primi, this type did not even in fact exist, so whatever. - The same with type "Module" now being named "module.
- Loading branch information
Showing
12 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
# Primi internals and PHP API | ||
|
||
## Terminology | ||
## Basic types | ||
_Basic types_ in Primi are those types that have objects _(instances)_ implemented directly via their own PHP class (e.g. `StringValue` PHP class). | ||
|
||
### List of basic types | ||
- `null` represented by `\Smuuf\Primi\Values\NullValue`. | ||
- `bool` represented by `\Smuuf\Primi\Values\BoolValue`. | ||
- `number` represented by `\Smuuf\Primi\Values\NumberValue`. | ||
- `string` represented by `\Smuuf\Primi\Values\StringValue`. | ||
- `list` represented by `\Smuuf\Primi\Values\ListValue`. | ||
- `dict` represented by `\Smuuf\Primi\Values\DictValue`. | ||
- `tuple` represented by `\Smuuf\Primi\Values\TupleValue`. | ||
- `type` represented by `\Smuuf\Primi\Values\TypeValue`. | ||
- `regex` represented by `\Smuuf\Primi\Values\RegexValue`. | ||
- `module` represented by `\Smuuf\Primi\Values\ModuleValue`. | ||
- `func` represented by `\Smuuf\Primi\Values\FuncValue`. | ||
- `iteratorfactory` represented by `\Smuuf\Primi\Values\IteratorFactoryValue`. | ||
|
||
## Other terminology | ||
- `Couple`: A tuple with two items _(also `2-tuple`)_. Inside Primi internals this usually describes a PHP array with two items, without explicitly specified indices. | ||
- For example this is a `couple`: | ||
```php | ||
["value A", "value B"] | ||
``` | ||
- `Pair`: A mapping key-value pair. Inside Primi internals this usually describes what `` | ||
- For example this code yields a key-value pair: | ||
- `Pair`: A mapping/key-value pair. | ||
- For example a generator would yield a key-value pair: | ||
```php | ||
yield $key => $value; | ||
``` | ||
or | ||
```php | ||
[ | ||
$keyA => $valueA, // This is pair. | ||
$keyB => $valueB, // This is another pair. | ||
]; | ||
``` | ||
- Or some PHP array can represent key-value pairs: | ||
```php | ||
[ | ||
$keyA => $valueA, // This is pair. | ||
$keyB => $valueB, // This is another pair. | ||
... | ||
]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters