Вікіфункції:Зарезервовані Z-ID

From Wikifunctions
This page is a translated version of the page Wikifunctions:Reserved ZIDs and the translation is 15% complete.
Вікі функцій наразі завантажує кілька статичних 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, зарезервовані на даний момент

Tracked in Phabricator:
Task T258914

See Wikifunctions:Reserved ZIDs/all for a list of currently pre-defined objects.

Діапазони

Ми зберігаємо певні простори для певних видів об’єктів.

  • 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/Type
  • Z200 – 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 now
  • Z400 – Z499: зарезервовано для локального використання
  • Z500 – Z599: Типи основних помилок (Z5xx оскільки Z5 є помилкою) (Див. § Типи основних помилок нижче.)
  • Z600 – Z699: core programming languages (Z6xx because Z61 is programming language)
  • Z700 – Z799: unassigned for now
  • Z800 – Z899: definitions of core functions with built-ins (Z8xx because Z8 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 use
  • Z7000 – Z7999: experimental, used for NLG, will be changed
  • Z8000 – 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 a Z2, 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 to Z8.
  • 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 of Z11.
  • 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: Evaluation result (Type).
  • 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 of Z31.
  • 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 is Z5.
  • Z60: Natural language (Type): because Z6 is a string.
  • Z61: Programming language (Type): because Z16 is code.
  • Z80: Byte (Type): because it is an octet.
  • Z84: Union (Type).
  • Z85: Ще не призначено.
  • 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.

Основні функції

  • Z801Echo: T ➝ T
    returns the input unchanged
  • Z802If: Boolean, T, T ➝ T
    returns second argument if the first is true, else the third; if has two letters
  • Z803Value by key: Key reference, Any ➝ Any
    returns the value by key from the object; Z3/Key
  • Z805Reify: 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: String, Any ➝ Any
    take the given value (an error or other metadata) and emits it in the function call response envelope under the name of the String input.
  • 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.
  • Z873 Map: Function, List ➝ List
    Returns a list where each of the Z1/objects of an input Z881/List has been processed by the given Z8/Function
  • Z876 Reduce: Function, List, Object ➝ Object
    Returns a value after running the given Function on each object of the List, starting with the given Object
  • Z868 Convert: String ➝ List(Character)
    convert a string into a list of Characters, because Z6/String and Z86/Character.
  • Z881Typed list: Type ➝ Type
    takes a type and returns a type of a list of elements of that type
  • Z882Typed pair: Type, Type ➝ Type
    takes two types and returns a type representing a pair of these
  • Z883Map: … ➝ …
  • Z884Union: T, T ➝ T
    takes two types and returns a type that accepts either
  • Z885Error type to type: Error type ➝ Type
    takes an error type and creates a type out of it
  • Z886Convert: List*(Character) ➝ String
    convert a list of Characters into a string, because Z86/Character and Z6/String.
  • Z887Reduce: … ➝ …
  • 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 error
  • Z502 (subtype, value): not wellformed, points to Z52x or Z53x
  • Z503 (function name): not implemented yet
  • Z504 (zid): Zid not found
  • Z505 (expected, actual, args): number of arguments mismatch
  • Z506 (expected, actual, arg): argument type mismatches
  • Z507 (function call): error in evaluation
  • Z508 (object): competing keys
  • Z509 (errors): List of errors
  • Z510 (none): nil
  • Z511 (key reference, object): key not found
  • Z512 (object): Z9 error
  • Z513 (resolved object): resolved object without Z2K2
  • Z514 (implementation): Builtin does not exist
  • Z515 (implementation): Builtin ID is erroneous
  • Z516 (key, bad value): Argument value error
  • Z517 (expected type, actual type, returned value, propagated error): Return type mismatch
  • Z518 (expected type, object, propagated error): Object type mismatch
  • Z519 (object): Undefined list type
  • Z520 (object): Wrong list type
  • Z521 (offending value): ZObjects must not be number or boolean or null
  • Z522 (offending index in array, propagated error): Array element not well formed
  • Z523 (object): Missing Z1K1
  • Z524 (value of Z1K1): Z1K1 must not be a string or array
  • Z525 (key): Invalid key
  • Z526 (key, propagated error): not wellformed value
  • Z531 (whole object): Z6 must have 2 keys
  • Z532 (whole object): Z6 without a Z6K1
  • Z533 (value of Z6K1): Z6K1 must be a string
  • Z534 (whole object): Z9 must have 2 keys
  • Z535 (whole object): Z9 without a Z9K1
  • Z536 (value of Z9K1): Z9K1 must be a string in JSON
  • Z537 (value of Z9K1): Z9K1 must look like a reference
  • Z538 (page title): wrong namespace
  • Z539 (page title): wrong content type
  • Z540 (language code): invalid language code
  • Z541 (language code): language code not found
  • Z542 (expected type, actual object): expected type, actual object
  • Z543 (type name): type not found
  • Z544 (type zid, type name, existing type name): conflicting type names
  • Z545 (type zid, type name, existing type zid): conflicting type Zids
  • Z546 (type zid, type name): builtin type not found
  • Z547 (input): invalid format
  • Z548 (error message, input): invalid JSON
  • Z549 (reference value): invalid ZReference
  • Z550 (reference value): unknown ZReference
  • Z551 (key, expected type, actual type): schema type mismatch
  • Z552 (index, expected type, actual type): array element type mismatch
  • Z553 (zobject): disallowed root type
  • Z554 (clashing ZID, language): label clashes with another ZObject's label
  • Z555 (ZID, title): mis-matched ZID and page title
  • Z556 (title): invalid page title
  • Z557 (error message): user does not have permission
  • Z558 (programming language): invalid programming language
  • Z559 (none): user not permitted to evaluate function
  • Z560 (evaluation result): invalid evaluation result
  • Z561 (propagated error): invalid evaluation request
  • Z562 (missing property): incomplete evaluation request
  • Z563 (call): call by non-reentrant executor
  • Z564 (contents): invalid executor response
  • Z565 (missing property): Incomplete executor request
  • Z570 (orchestrator rate limit): reached rate limit in orchestrator
  • Z571 (evaluator rate limit): reached rate limit in evaluator
  • Z572 (recursion limit, function name): reached recursion limit in orchestrator
  • Z573 (recursion limit, function name): reached recursion limit in evaluator
  • Z574 (time limit): reached time limit in orchestrator
  • Z575 (time limit): reached time limit in evaluator


Див. також