Files
IBAFLang/IBAF-cbs/Funcons-beta/Computations/Normal/Interacting/index.md
2023-11-01 09:29:33 +01:00

6.0 KiB

layout, title, parent, ancestor
layout title parent ancestor
default Interacting Normal Funcons-beta

Funcons-beta : Interacting.cbs

Interacting

Output

[
  Entity standard-out
  Funcon print
]
Entity
  _ -- standard-out!(_:values*) -> _

This entity represents the sequence of values output by a particular transition, where the empty sequence ( ) represents the lack of output. Composition of transitions concatenates their output sequences.

Funcon
  print(_:values*) : =>null-type

print(X) evaluates the arguments X and emits the resulting sequence of values on the standard-out channel. print( ) has no effect.

Input

[
  Entity standard-in
  Funcon read
]
Entity
  _ -- standard-in?(_:values*) -> _

This entity represents the sequence of values input by a particular transition, where the empty sequence ( ) represents that no values are input. The value null-value represents the end of the input.

Composition of transitions concatenates their input sequences, except that when the first sequence ends with null-value, the second seqeunce has to be just null-value.

Funcon
  read : =>values

read inputs a single value from the standard-in channel, and returns it. If the end of the input has been reached, read fails.

Rule
  read -- standard-in?(V:~null-type) -> V
Rule
  read -- standard-in?(null-value) -> fail

From the PLanCompS Project | CBS-beta issues... | Suggest an improvement...