Абстрактна Вікіпедія/Зарезервовані Z-ID
- Вікі функцій наразі завантажує кілька статичних ZObjects під час налаштування. З часом нам знадобиться їх ще більше.
Ця сторінка розповідає про веселу дискусію про те, скільки ZID ми повинні зарезервувати, чи повинні вони бути суміжними, і якими мають бути ці перші ZID. Це також може бути місцем для ховання великодніх яєць, функції, яка зарекомендувала себе у Вікіданих.
Зауважте, що для спрощення обговорення ми наразі не думаємо про майбутню можливість створення об’єднаних примірників програмного забезпечення, що запускає вікі функції, і про те, як це буде працювати. Ми думаємо виключно про те, які ZID для вікіфункцій повинні бути зарезервовані.
Чи повинні зарезервовані ZID бути суміжними?
Так.
Існує певна простота, коли кажуть, що “всі ZID з 4 цифрами або менше зарезервовані“.
Існує також гібридна модель резервування всіх ZID нижче певного числа, а також резервування деяких більших ZID для великодніх яєць або з конкретних причин (саме це зробили Вікідані).
Скільки ZID ми повинні зарезервувати?
Зарезервуймо всі ZID з чотирма цифрами або менше.
Усі основні об’єкти були б у ZID з трьома цифрами і менше, і ми зберігаємо чотиризначні ZID для мов.
This follows roughly the proposals made by community members on the talk page and on Phabricator. In particular, we also won't pack the space.
ZID, зарезервовані на даний момент
Нижче наведене може змінюватися та відкрите для обговорення. Нижче наведено деякі пояснення, які, можливо, допоможуть із запам’ятовуванням (хоча вивчати їх не обов’язково). |
Діапазони
Ми зберігаємо певні простори для певних видів об’єктів.
Z1
–Z99
: основні типи. (Див. § Основні типи нижче.)Z100
–Z199
: validators for the core types (i.e. for each core type, +100 gives the validator), e.g. Z104 is the validator for Z4/TypeZ200
–Z299
: built-in implementations for the validators for the core types (i.e. Z204 is the built-in implementation for the validator for Z4/Type)Z300
–Z399
: unassigned for nowZ400
–Z499
: зарезервовано для локального використанняZ500
–Z599
: Типи основних помилок (Z5xx
оскількиZ5
є помилкою) (Див. § Типи основних помилок нижче.)Z600
–Z699
: core programming languages (Z6xx
becauseZ61
is programming language)Z700
–Z799
: unassigned for nowZ800
–Z899
: definitions of core functions with built-ins (Z8xx
becauseZ8
is function) (See § Core functions below.)Z900
–Z999
: built-ins for the core functions (they are +100 from the respective Z8xx)Z1000
–Z1999
: natural languages (instances of Z60)Z2000
–Z6999
: reserved for future useZ7000
–Z7999
: experimental, used for NLG, will be changedZ8000
–Z8999
: Testers for each pre-defined function (e.g. Z801 is tested via Z8010, Z8011, Z8012, … Z8019).Z9000
–Z9999
: reserved for future use
Основні типи
Z1
: ZObject, the root.Z2
: Persistent object (Type): everything on the wiki is aZ2
, that's why this has such a low ZID.Z3
: Key (Type): because the word key has three letters in English.Z4
: Type (Type): because the word type has four letters in English.Z5
: Error (Type): because the word error has five letters in English. (See § Core error types below.)Z6
: String (Type): because the word string has six letters in English.Z7
: Function call (Type): because function calls are the main magic of the system, and 7 is a magic number. It is also close toZ8
.Z8
: Function (generic type, thus technically a function): because function has eight letters in English. (See § Core functions below.)Z9
: Reference (Type): because the word reference has nine letters in English.Z10
: List (generic type, thus technically a function): because it's the first number that has two digits.Z11
: Monolingual text (Type): because it is just one language, and there's a one in the name.Z12
: Multilingual text (Type): because it's an extension ofZ11
.Z13
: empty list (List): nature abhors vacuum, and people dislike 13.Z14
: Implementation (Type): because the word implementation has fourteen letters in English.Z15
: Ще не призначено.Z16
: Code (Type): no good reason, it's close to Z14, and Z61/Programming language.Z17
: Argument declaration (Type).Z18
: Argument reference (Type).Z19
: Ще не призначено.Z20
: Tester (Type): because 20/20 is perfect vision, and tests make errors visible.Z21
: Unit (Type).Z22
: Pair (generic type, thus technically a function): because it's two twos.Z23
: Nothing (Type).Z24
: void (Unit).Z25
: Ще не призначено.Z26
: Ще не призначено.Z27
: Ще не призначено.Z28
: Ще не призначено.Z29
: Ще не призначено.Z30
: Ще не призначено.Z31
: Monolingual textset (Type).Z32
: Multilingual textset (Type): because it's an extension ofZ31
.Z33
: Ще не призначено.Z34
: Ще не призначено.Z35
: Ще не призначено.Z36
: Ще не призначено.Z37
: Ще не призначено.Z38
: Ще не призначено.Z39
: Key reference (Type): because Z3/Key Z9/Reference.Z40
: Boolean (Type): because Boole first published in (18)40.Z41
: true (Boolean).Z42
: false (Boolean).Z43
: Ще не призначено.Z44
: Ще не призначено.Z45
: Ще не призначено.Z46
: Ще не призначено.Z47
: Ще не призначено.Z48
: Ще не призначено.Z49
: Ще не призначено.Z50
: Error type (Type): because Error isZ5
.Z60
: Natural language (Type): becauseZ6
is a string.Z61
: Programming language (Type): becauseZ16
is code.Z80
: Byte (Type): because it is an octet.Z84
: Union (Type).Z85
: Not yet assigned.Z86
: Code point (Type): because it is not exactly a Z80/Byte, but more like Z6/String.Z99
: Quote (Type): because it looks a bit like a closing quotation mark in English.
Основні функції
Z801
Echo: T ➝ T- returns the input unchanged
Z802
If: Boolean, T, T ➝ T- returns second argument if the first is true, else the third; if has two letters
Z803
Value by key: Key reference, Any ➝ Any- returns the value by key from the object; Z3/Key
Z805
Reify: Any ➝ List(Pair(Key reference, Any))- transform any object into a list of key-value pairs; reify has five letters
Z808
Abstract: List(Pair(Key reference, Any)) ➝ Any- transform a list of key-value pairs into an object; abstract has eight letters.
Z810
Prepend element to list: T, List(T) ➝ List(T)- insert an object to the beginning of an ordered list of objects (because Z10 is list).
Z811
First element: List(T) ➝ T- get the first item in an ordered list of objects (because Z10 is list and we get the first)
Z812
List without first element: List(T) ➝ List(T)- get the list without the first object (because Z10 is list and we get the second, the rest)
Z813
Empty: List(T) ➝ Boolean- return if a list does not contain any item (because Z13 is empty list).
Z820
Trigger Metadata: Error ➝ Any- take the given error or other metadata and emit it in the function call response envelope.
Z821
First: Pair(T1, T2) ➝ T1- extract the first value of a pair (because Z22 is pair).
Z822
Second: Pair(T1, T2) ➝ T2- extract the second value of a pair (because Z22 is pair).
Z844
Boolean equality: Boolean, Boolean ➝ Boolean- returns true if the two inputs are the same, false otherwise
Z860
Language code to language: String ➝ Language- takes a language code given as a string and returns a natural language object
Z866
String equality: String, String ➝ Boolean- returns true if the two inputs are the same, false otherwise
Z868
Convert: String ➝ List(Character)- convert a string into a list of Characters, because Z6/String and Z86/Character.
Z881
Typed list: Type ➝ Type- takes a type and returns a type of a list of elements of that type
Z882
Typed pair: Type, Type ➝ Type- takes two types and returns a type representing a pair of these
Z883
Map: ... ➝ ...- ...
Z884
Union: T, T ➝ T- takes two types and returns a type that accepts either
Z885
Error type to type: Error type ➝ Type- takes an error type and creates a type out of it
Z886
Convert: List*(Character) ➝ String- convert a list of Characters into a string, because Z86/Character and Z6/String.
Z887
Reduce: ... ➝ ...- …
Z888
Same: Character, Character ➝ Boolean- compare two characters and return if they are equal.
Z899
Unquote: Quote ➝ Any- Unquotes a ZObject, because Z99/Quote.
Основні типи помилок
Z501
(error message, input): syntax errorZ502
(subtype, value): not wellformed, points to Z52x or Z53xZ503
(function name): not implemented yetZ504
(zid): Zid not foundZ505
(expected, actual, args): number of arguments mismatchZ506
(expected, actual, arg): argument type mismatchesZ507
(function call): error in evaluationZ508
(object): competing keysZ510
(none): nilZ511
(key reference, object): key not foundZ512
(object): Z9 errorZ513
(resolved object): resolved object without Z2K2Z514
(implementation): Builtin does not existZ515
(implementation): Builtin ID is erroneousZ516
(key, bad value): Argument value errorZ521
(offending value): ZObjects must not be number or boolean or nullZ522
(offending index in array, propagated error): Array element not well formedZ523
(object): Missing Z1K1Z524
(value of Z1K1): Z1K1 must not be a string or arrayZ525
(key): Invalid keyZ526
(key, propagated error): not wellformed valueZ531
(whole object): Z6 must have 2 keysZ532
(whole object): Z6 without a Z6K1Z533
(value of Z6K1): Z6K1 must be a stringZ534
(whole object): Z9 must have 2 keysZ535
(whole object): Z9 without a Z9K1Z536
(value of Z9K1): Z9K1 must be a string in JSONZ537
(value of Z9K1): Z9K1 must look like a referenceZ538
(page title): wrong namespaceZ539
(page title): wrong content typeZ540
(language code): invalid language codeZ541
(language code): language code not foundZ542
(expected type, actual object): expected type, actual objectZ543
(type name): type not foundZ544
(type zid, type name, existing type name): conflicting type namesZ545
(type zid, type name, existing type zid): conflicting type ZidsZ546
(type zid, type name): builtin type not foundZ547
(input): invalid formatZ548
(error message, input): invalid JSONZ549
(reference value): invalid ZReferenceZ550
(reference value): unknown ZReferenceZ551
(key, expected type, actual type): key type mismatch