Перейти к содержанию
(Lispex)2.0Спецификация · до выпуска

Поиск по документации

Поиск по английскому тексту спецификации

Введите вопрос, символ, код диагностики или команду.

Содержание

Поиск по спецификации
Лиспекс 2.0 · Язык · Глава I.6

Глава I.6

Procedures

Procedure arguments, application, internal values, and the rule entry boundary.

Непереведённый текст показан на английском языке

Scope

This chapter covers procedure parameters and application. It also covers internal multiple values and the single input and result at a rule entry.

Fixed and rest parameters

A procedure is an internal callable value. A lambda expression creates a procedure whose body uses its lexical bindings. An argument is a value supplied to a call. A parameter is the binding that receives an argument.

A procedure may be passed to another procedure inside a rule. It is excluded from Datum, the portable data allowed at the external boundary. Evaluation and bindings defines lexical scope and immutable bindings.

6.1 Match fixed parameters to arguments

A procedure with fixed parameters accepts exactly one argument for each parameter. It binds the argument values in parameter order for the body. Parameter names must be distinct. A count mismatch is a language failure and does not call the body.

6.1ред. 2
lispex.rule.v2.procedures.fixed-parameters

Why

Each name in the body needs one unambiguous value. A count check prevents missing values and silently discarded arguments.

Bind arguments in parameter order

lispex.example.v2.procedures.fixed-call · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      ((lambda (a b) (- a b)) input 3)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "10"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат7
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The procedure binds a to 10 and b to 3 and returns the exact integer 7. Product invocation awaits its 2.0 adapter.

Reversing the argument bindings would produce a different value. The plan checks the ordered result.

Reject a missing argument

lispex.example.v2.procedures.fixed-count-failure · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      ((lambda (a b) (+ a b)) input)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "10"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Условиеruntime.arity
Подробности результата
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "runtime.arity",
    "data": {
      "minimum": "2",
      "maximum": "2",
      "actual": "1"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The call produces an arity failure because two arguments are required and one is supplied. Product invocation awaits its 2.0 adapter.

The procedure body is not evaluated after the argument count fails.

6.2 Collect remaining arguments in a list

A procedure may have fixed parameters followed by one rest parameter. The fixed prefix is required. The rest parameter receives a list of all remaining arguments in order. A lambda with only a rest parameter accepts any finite argument count, including zero. The rest list is immutable.

Rest pair allocation follows the Rest argument pair row in the Resources site table.

6.2ред. 2
lispex.rule.v2.procedures.rest-parameters

Why

Rest parameters support reusable guest procedures without exposing an implementation argument buffer or mutable state.

Keep the remaining argument order

lispex.example.v2.procedures.rest-order · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      ((lambda (first . rest) rest) input 20 30)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "10"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат(20 30)
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "list",
    "items": [
      {
        "kind": "integer",
        "value": "20"
      },
      {
        "kind": "integer",
        "value": "30"
      }
    ]
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The rest parameter contains the exact integers 20 and 30 in that order. Product invocation awaits its 2.0 adapter.

The first argument is consumed by the fixed parameter. The returned rest list contains only the remaining arguments.

Collect zero arguments

lispex.example.v2.procedures.empty-rest · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      ((lambda args args))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат()
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "list",
    "items": []
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The procedure returns one empty list datum. Product invocation awaits its 2.0 adapter.

A zero argument call can still return one datum. The empty rest list is distinct from zero returned values.

Application and apply

A call evaluates its operator and arguments in the order defined by Evaluation and bindings. The calling syntax does not change the procedure body or its lexical environment.

6.3 Expand a final argument list with apply

The apply procedure takes a procedure, any explicit arguments, and a final proper list. It places the list elements after the explicit arguments in their existing order. It calls the procedure with that combined argument sequence. A final value that is not a proper list produces a language failure before the called body runs.

The target call inherits this call's tail position under the tail-call rule.

6.3ред. 3
lispex.rule.v2.procedures.apply

Why

The caller can build an argument sequence as data while preserving ordinary application order and argument count checks.

Append list elements to explicit arguments

lispex.example.v2.procedures.apply-argument-order · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (apply (lambda (a b c) (list a b c)) input '(2 3))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "1"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат(1 2 3)
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "list",
    "items": [
      {
        "kind": "integer",
        "value": "1"
      },
      {
        "kind": "integer",
        "value": "2"
      },
      {
        "kind": "integer",
        "value": "3"
      }
    ]
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The rule returns the list of exact integers 1, 2, and 3 in that order. Product invocation awaits its 2.0 adapter.

The final list supplies two arguments. It is not passed as one additional list argument.

Reject an improper final list

lispex.example.v2.procedures.apply-improper-list · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (apply (lambda args 9) '(1 . 2))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Условиеdomain.type
Подробности результата
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "domain.type",
    "data": {
      "operation": "apply",
      "argument": "1",
      "path": [
        {
          "kind": "cdr"
        }
      ],
      "expected": "proper-list",
      "actual": "integer"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The final list argument produces an apply domain failure and the target body is not called. Product invocation awaits its 2.0 adapter.

The target could otherwise return 9. The plan requires a failure before that result is produced.

6.4 Reject continuation and dynamic handler procedures

Procedure calls follow the removed-control rule. Ordinary calls and recursion use the lexical control defined by Evaluation and bindings and guard.

6.4ред. 2
lispex.rule.v2.procedures.closed-control

Why

Removing captured control and dynamic cleanup keeps calls, failures, and resource termination within one bounded execution model.

Reject a continuation capture attempt

lispex.example.v2.procedures.callcc-rejected · ред. 4

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (call/cc (lambda (escape) (escape 7)))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаlibrary.reference
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "rejectedFeature": "call/cc",
  "diagnostic": {
    "phase": "resolve",
    "code": "library.reference",
    "data": {
      "name": "call/cc",
      "reason": "removed-operation"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

The request is rejected and the continuation escape does not return 7. Product invocation awaits its 2.0 adapter.

The example specifies rejection. It does not expose a restricted continuation as a supported alternative.

Reject a dynamic cleanup attempt

lispex.example.v2.procedures.dynamic-wind-rejected · ред. 4

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (dynamic-wind
        (lambda () 1)
        (lambda () 7)
        (lambda () 2))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаlibrary.reference
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "rejectedFeature": "dynamic-wind",
  "diagnostic": {
    "phase": "resolve",
    "code": "library.reference",
    "data": {
      "name": "dynamic-wind",
      "reason": "removed-operation"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

The request is rejected and does not produce a result datum. Product invocation awaits its 2.0 adapter.

No cleanup procedure may create an additional guest execution path after a terminal resource stop.

Internal multiple values

6.5 Pass an internal value sequence to its receiver

The values procedure returns its arguments as an internal sequence of returned values. The sequence may contain zero, one, or several values. The call-with-values procedure calls its producer with no arguments and calls its consumer with the returned values in order. The consumer must accept that argument count.

The producer is outside tail position. The consumer inherits this call's tail position under the tail-call rule.

6.5ред. 2
lispex.rule.v2.procedures.internal-values

Why

A procedure can return several intermediate values without giving the host a second output channel. An explicit receiver determines how those values are used.

Receive two internal values

lispex.example.v2.procedures.receive-two-values · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (call-with-values
        (lambda () (values 8 3))
        (lambda (a b) (- a b)))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат5
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "5"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The consumer receives 8 and 3 in order and returns the exact integer 5. Product invocation awaits its 2.0 adapter.

The producer returns two internal values. The rule entry still returns exactly one datum.

Receive zero internal values

lispex.example.v2.procedures.receive-zero-values · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (call-with-values
        (lambda () (values))
        (lambda () 7))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат7
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The zero argument consumer returns the exact integer 7. Product invocation awaits its 2.0 adapter.

The producer returns no values. The consumer turns that internal result into one datum for the entry boundary.

6.6 Require one value where one value is consumed

An operator position, an argument position, a conditional test, and a binding initializer each require one value. Producing zero or several values in one of those positions is a language failure. A receiver cannot silently choose one value or turn the sequence into a list.

6.6ред. 2
lispex.rule.v2.procedures.single-value-contexts

Why

Silent selection would hide a producer mistake and make the receiving expression ambiguous. Explicit receivers preserve the intended value count.

Reject two values in one argument position

lispex.example.v2.procedures.argument-value-count · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (+ 1 (values 2 3))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Условиеruntime.value-count
Подробности результата
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "runtime.value-count",
    "data": {
      "expected": "1",
      "actual": "2"
    }
  },
  "context": "argument"
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The second argument position produces a value count failure because it receives two values. Product invocation awaits its 2.0 adapter.

The addition receives neither a truncated argument nor an implicitly constructed list.

Reject zero values in a binding initializer

lispex.example.v2.procedures.initializer-value-count · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (let ((x (values)))
        x)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Условиеruntime.value-count
Подробности результата
{
  "kind": "language-failure",
  "valueCount": 0,
  "condition": {
    "phase": "evaluate",
    "code": "runtime.value-count",
    "data": {
      "expected": "1",
      "actual": "0"
    }
  },
  "context": "binding-initializer"
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The binding initializer produces a value count failure because it receives zero values. Product invocation awaits its 2.0 adapter.

No arbitrary placeholder value is assigned to x.

Entry declaration syntax

EBNF
EntryClause = "(" "entry" Identifier ")" ;

Identifier is defined by the reader grammar. The module grammar places this clause after the export clause and before definitions. The identifier names the public export. Its spelling is not a host selector. The preparation diagnostic mapping gives entry failures their catalog identities. The diagnostic phase does not change the prescribed check order.

Rule entry

The entry is the one procedure selected by the root module for an external rule request. Its input is an ordinary lexical argument. There is no reserved input global. A list containing several facts is still one Datum.

Source declarations select the entry. Each fixture names its root module in request.json as documentation notation. This notation does not define a public host schema or a CLI option. Preparation and modules owns module and export syntax. Profiles and value interchange owns canonical input and result encoding.

6.7 Validate each declared entry

A module may have at most one entry declaration in the entry slot of the module grammar. Its identifier names a public export of that module. Preparation resolves the export to one lexical binding. It checks that export, the resolved lambda form, and the accepted argument count in that order. The binding initializer must be a lambda after definition shorthand is normalized. An imported or reexported binding follows the same check at its original declaration. The lambda must accept one argument. Preparation validates declarations in dependency modules too. It does not execute an initializer to discover an entry.

6.7ред. 2
lispex.rule.v2.procedures.entry-declaration

Why

A declared entry fixes the binding that the program exposes. Static checks prevent a factory or module initialization from choosing a different boundary. The same check applies to every submitted declaration.

6.8 Select the declared root entry

A closed bundle selects one root module. After module validation, preparation requires exactly one entry declaration in that root. The prepared program retains the resolved target of that declaration. Evaluation performs the required module initialization and invokes only the selected root entry. A dependency entry declaration does not trigger a call. No export name is a default entry. A host or command selector names the root module and cannot replace its declared target with another export. The host interface and command forms own selector representations.

6.8ред. 2
lispex.rule.v2.procedures.entry-selection

Why

Selecting the root fixes one program boundary before evaluation. Export additions and dependency entry declarations cannot silently change the procedure that receives the input.

6.9 Supply one input datum to the entry

An external rule request supplies exactly one Datum to one selected entry. The procedure receives the input through ordinary lexical parameter binding. An entry may have fixed or rest parameters when its accepted argument counts include one. A request with no argument or more than one argument is rejected. A caller supplies several facts by placing them inside one datum.

6.9ред. 3
lispex.rule.v2.procedures.entry-input

Why

One explicit input makes the request reproducible and gives every product the same boundary. The host does not fill missing arguments from hidden state.

An entry may use any parameter shape that accepts one argument.

Pass several facts in one list datum

lispex.example.v2.procedures.one-structured-input · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (facts)
      (+ (car facts) (car (cdr facts)))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "list",
        "items": [
          {
            "kind": "integer",
            "value": "3"
          },
          {
            "kind": "integer",
            "value": "4"
          }
        ]
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат7
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry receives one list datum and returns the exact integer 7. Product invocation awaits its 2.0 adapter.

The parameter is named facts. The list contains two elements without creating a two argument external call.

Reject a request with no argument

lispex.example.v2.procedures.missing-entry-input · ред. 5

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "suppliedArguments": []
    }
  ],
  "operationUnderTest": "Attempt an external call with zero supplied arguments. This is documentation notation for an invalid request.",
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаinput.arity
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-input",
  "requiredArgumentCount": 1,
  "receivedArgumentCount": 0,
  "diagnostic": {
    "phase": "admission",
    "code": "input.arity",
    "data": {
      "expected": "1",
      "actual": "0"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

The external call is rejected because no argument was supplied. Product invocation awaits its 2.0 adapter.

An absent argument is distinct from a supplied empty list datum. The entry body does not receive an invented value.

Reject a request with two arguments

lispex.example.v2.procedures.extra-entry-input · ред. 5

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "suppliedArguments": [
        {
          "kind": "integer",
          "value": "3"
        },
        {
          "kind": "integer",
          "value": "4"
        }
      ]
    }
  ],
  "operationUnderTest": "Attempt an external call with two supplied arguments. This is documentation notation for an invalid request.",
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаinput.arity
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-input",
  "requiredArgumentCount": 1,
  "receivedArgumentCount": 2,
  "diagnostic": {
    "phase": "admission",
    "code": "input.arity",
    "data": {
      "expected": "1",
      "actual": "2"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

The external call is rejected because two arguments were supplied. Product invocation awaits its 2.0 adapter.

A product must not silently pack the two arguments into a list or drop an argument.

Call a rest entry with one input

lispex.example.v2.procedures.rest-entry-input · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda arguments
      (car arguments)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "7"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат7
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry receives one argument through its rest list and returns the exact integer 7. Product invocation awaits its 2.0 adapter.

The external request still supplies one datum. The rest parameter changes the internal binding shape without allowing extra host arguments.

6.10 Return exactly one portable datum

A successful entry call returns exactly one Datum. Zero or several returned values cause a boundary failure. The portable-data rule determines result membership. A failed boundary check returns no partial result.

6.10ред. 2
lispex.rule.v2.procedures.entry-result

Why

Internal procedures and multiple values cannot acquire host authority or become extra external outputs. One complete result gives replay a well defined outcome.

Reject zero values at the external boundary

lispex.example.v2.procedures.zero-entry-values · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (values)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаvalue.boundary
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-result",
  "requiredValueCount": 1,
  "receivedValueCount": 0,
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "count",
      "count": "0",
      "path": [],
      "actual": false
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry result is rejected because the procedure returned zero values. Product invocation awaits its 2.0 adapter.

The host receives no successful result datum. It must not replace the missing result with an empty list or false.

Reject multiple values at the external boundary

lispex.example.v2.procedures.multiple-entry-values · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (values input (+ input 1))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "4"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаvalue.boundary
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-result",
  "requiredValueCount": 1,
  "receivedValueCount": 2,
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "count",
      "count": "2",
      "path": [],
      "actual": false
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry result is rejected because the procedure returned two values. Product invocation awaits its 2.0 adapter.

Neither value is emitted as a successful external result.

Reject a procedure result

lispex.example.v2.procedures.procedure-entry-result · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (lambda (x) x)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаvalue.boundary
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-result",
  "required": "Datum",
  "received": "procedure",
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "non-datum",
      "count": "1",
      "path": [],
      "actual": "procedure"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry result is rejected because it is a procedure. Product invocation awaits its 2.0 adapter.

Returning one internal value satisfies the count requirement but does not satisfy the Datum requirement.

Reject a procedure inside a result list

lispex.example.v2.procedures.nested-procedure-result · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule
    (lambda (input)
      (list 1 (lambda (x) x))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient to finish preparation checks",
    "evaluate": "finite values sufficient for the stated finite calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаvalue.boundary
Подробности результата
{
  "kind": "failure",
  "valueCount": 0,
  "boundary": "entry-result",
  "required": "Datum",
  "received": "procedure-containing-data",
  "diagnostic": {
    "phase": "evaluate",
    "code": "value.boundary",
    "data": {
      "reason": "non-datum",
      "count": "1",
      "path": [
        {
          "kind": "cdr"
        },
        {
          "kind": "car"
        }
      ],
      "actual": "procedure"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Вызов продукта

Ожидаемый результат

The entry result is rejected because the list contains a procedure. Product invocation awaits its 2.0 adapter.

The Datum check applies to every contained value. The first list element is not returned as a partial result.

Select an explicitly renamed entry

lispex.example.v2.procedures.renamed-entry · ред. 1

source.scm
(module main
  (import)
  (export (rename decide start) rule)
  (entry start)
  (define (decide input) input)
  (define (rule input) 0)
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "42"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат42
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "42"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "selectedEntry": {
    "rootModule": "main",
    "export": "start",
    "binding": {
      "module": "main",
      "name": "decide"
    }
  },
  "preparedProgramIssued": true,
  "entryEvaluated": true
}
Вызов продукта

Ожидаемый результат

The declared public name start selects the local decide procedure and returns the input integer 42. Product invocation awaits its 2.0 adapter.

Definition shorthand normalizes to a lambda. The separate export named rule is not the entry.

Select an imported lexical procedure

lispex.example.v2.procedures.imported-entry · ред. 1

source.scm
(module main
  (import (helpers (rename pass imported-pass)))
  (export (rename imported-pass start))
  (entry start)

)
helpers.scm
(module helpers
  (import)
  (export pass idle)
  (entry idle)
  (define pass (lambda (input) input))
  (define idle (lambda (input) (idle input)))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "7"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    },
    {
      "name": "helpers",
      "source": "helpers.scm"
    }
  ]
}
Результат по спецификации
Результат7
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "integer",
    "value": "7"
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "selectedEntry": {
    "rootModule": "main",
    "export": "start",
    "binding": {
      "module": "helpers",
      "name": "pass"
    }
  },
  "preparedProgramIssued": true,
  "entryEvaluated": true,
  "dependencyEntriesInvoked": []
}
Вызов продукта

Ожидаемый результат

The root reexports pass from helpers as start and returns the input integer 7. The valid dependency entry idle is not invoked. Product invocation awaits its 2.0 adapter.

The imported procedure keeps the binding from helpers. The dependency entry would recurse if called. It is validated but never selected by the root.

Accept one fixed parameter and rest

lispex.example.v2.procedures.dotted-rest-entry · ред. 1

source.scm
(module main
  (import)
  (export decide)
  (entry decide)
  (define (decide input . rest) (null? rest))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "7"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Результат#t
Подробности результата
{
  "kind": "value",
  "valueCount": 1,
  "datum": {
    "kind": "boolean",
    "value": true
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "selectedEntry": {
    "rootModule": "main",
    "export": "decide",
    "binding": {
      "module": "main",
      "name": "decide"
    }
  },
  "preparedProgramIssued": true,
  "entryEvaluated": true
}
Вызов продукта

Ожидаемый результат

The entry receives one argument and its rest list is empty. It returns true. Product invocation awaits its 2.0 adapter.

The existing fixed and bare rest entry cases cover the other accepted shapes. The external request still supplies exactly one datum.

Reject an entry that is private

lispex.example.v2.procedures.missing-entry-export · ред. 2

source.scm
(module main
  (import)
  (export spare)
  (entry private)
  (define private (lambda (input) input))
  (define spare (lambda (input) input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "private",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "unknown-entry"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects private because it is not an export of main. It does not select another visible procedure. Product invocation awaits its 2.0 adapter.

A local procedure must be exported before its public name can appear in an entry declaration.

Reject a constant as an entry

lispex.example.v2.procedures.nonprocedure-entry · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule 42)
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "rule",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "non-procedure"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the exported constant because its initializer is not a lambda. Product invocation awaits its 2.0 adapter.

The constant has a portable value. The entry declaration still requires a procedure binding with a statically known parameter shape.

Reject a procedure factory as an entry

lispex.example.v2.procedures.factory-entry · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule ((lambda () (lambda (input) input))))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "rule",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "invalid-initializer"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the application initializer even though evaluating it could produce a unary procedure. No factory runs. Product invocation awaits its 2.0 adapter.

The lambda check examines the binding initializer after definition shorthand is normalized. It does not evaluate the initializer or accept its predicted result.

Reject an entry with no parameters

lispex.example.v2.procedures.zero-parameter-entry · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda () 0))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "rule",
  "acceptedArgumentCounts": "exactly-zero",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "arity"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the declared entry because its parameter shape cannot accept one argument. Product invocation awaits its 2.0 adapter.

This is a static failure of the declared entry. An ordinary internal call still uses the runtime arity rule.

Reject an entry requiring two arguments

lispex.example.v2.procedures.two-parameter-entry · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (a b) a))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "rule",
  "acceptedArgumentCounts": "exactly-two",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "arity"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the declared entry because its parameter shape cannot accept one argument. Product invocation awaits its 2.0 adapter.

This is a static failure of the declared entry. An ordinary internal call still uses the runtime arity rule.

Reject an entry with two required parameters

lispex.example.v2.procedures.two-required-rest-entry · ред. 2

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (define rule (lambda (a b . rest) a))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "export": "rule",
  "acceptedArgumentCounts": "at-least-two",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "arity"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the declared entry because its parameter shape cannot accept one argument. Product invocation awaits its 2.0 adapter.

This is a static failure of the declared entry. An ordinary internal call still uses the runtime arity rule.

Validate a dependency entry before evaluation

lispex.example.v2.procedures.invalid-dependency-entry · ред. 2

source.scm
(module main
  (import (helpers pass))
  (export rule)
  (entry rule)
  (define rule (lambda (input) (pass input)))
)
helpers.scm
(module helpers
  (import)
  (export pass bad)
  (entry bad)
  (define pass (lambda (input) input))
  (define bad (lambda (a b) a))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "7"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    },
    {
      "name": "helpers",
      "source": "helpers.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "helpers",
  "export": "bad",
  "acceptedArgumentCounts": "exactly-two",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "arity"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects the two-argument entry in helpers even though main would call only its exported pass procedure. Product invocation awaits its 2.0 adapter.

A dependency declaration is part of the submitted source contract. Being unselected does not exempt it from validation.

Reject a repeated entry declaration

lispex.example.v2.procedures.duplicate-entry-declaration · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule)
  (entry rule)
  (define rule (lambda (input) input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "normalization",
  "valueCount": 0,
  "module": "main",
  "declarationCount": 2,
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "duplicate-entry"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Normalization rejects the second entry declaration before any guest initialization. Product invocation awaits its 2.0 adapter.

Repeating the same public name still violates the one-declaration rule.

Reject extra entry clause operands

lispex.example.v2.procedures.malformed-entry-declaration · ред. 3

source.scm
(module main
  (import)
  (export rule)
  (entry rule spare)
  (define rule (lambda (input) input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "0"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    }
  ]
}
Результат по спецификации
Диагностикаsyntax.form
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "normalization",
  "valueCount": 0,
  "module": "main",
  "diagnostic": {
    "phase": "normalize",
    "code": "syntax.form",
    "data": {
      "form": "entry",
      "reason": "invalid-entry"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Normalization rejects the entry clause because it contains two names instead of one. Product invocation awaits its 2.0 adapter.

The whole module is read before the clause is checked against EntryClause.

Require the root to declare its entry

lispex.example.v2.procedures.missing-root-entry · ред. 2

source.scm
(module main
  (import (helpers pass))
  (export rule)
  (define rule (lambda (input) (pass input)))
)
helpers.scm
(module helpers
  (import)
  (export pass)
  (entry pass)
  (define pass (lambda (input) input))
)
Запрос и файлы
request.json
{
  "notation": "documentation-request",
  "source": "source.scm",
  "semantics": {
    "language": "Lispex 2.0",
    "standardLibrary": "one fixed library identity",
    "unicode": "one fixed Unicode semantics version",
    "resourceModel": "one fixed finite resource model"
  },
  "limits": {
    "prepare": "finite values sufficient for the stated checks",
    "evaluate": "finite values sufficient for the stated calculation"
  },
  "requests": [
    {
      "input": {
        "kind": "integer",
        "value": "7"
      }
    }
  ],
  "rootModule": "main",
  "moduleSources": [
    {
      "name": "main",
      "source": "source.scm"
    },
    {
      "name": "helpers",
      "source": "helpers.scm"
    }
  ]
}
Результат по спецификации
Диагностикаentry.declaration
Подробности результата
{
  "kind": "prepare-failure",
  "stage": "resolve",
  "valueCount": 0,
  "module": "main",
  "diagnostic": {
    "phase": "prepare",
    "code": "entry.declaration",
    "data": {
      "reason": "missing-entry"
    }
  }
}

Результат по спецификации. Запуски продукта ожидают адаптера 2.0.

Подробности семантики
{
  "preparedProgramIssued": false,
  "guestInitializationPerformed": false,
  "entryEvaluated": false,
  "canonicalOutcomeProduced": false,
  "evaluationReceiptEligible": false
}
Вызов продукта

Ожидаемый результат

Preparation rejects main because it has no entry declaration. The export named rule and the dependency entry are not defaults. Product invocation awaits its 2.0 adapter.

The request selects main as its root. A valid entry declaration in helpers does not choose an entry for main.

Related chapters

Values and text

Evaluation and bindings

Conditions

First rule