.. include:: ../global.rst .. idio:currentmodule:: expect expect Values ------------- .. _`expect/spawn-id`: .. idio:value:: spawn-id :canonical: expect/spawn-id :scope: dynamic :type: :ref:`expect/struct-spawn ` ``spawn-id`` is set by and returned from :ref:`expect/spawn `. .. tip:: ``spawn-id`` defaults to ``#f`` however if you set it to ``#n`` or a list of spawn-id(s) then ``spawn`` will prepend any new value to the list. If you want to revert this behaviour, set ``spawn-id`` back to a single ``struct-spawn`` value or to ``#f``. You must manage ``spawn-id`` under these circumstances. For example, :ref:`exp-wait ` does not modify a list-variant ``spawn-id`` and it will continue as a list of (expired) spawned processes. .. _`expect/user-spawn-id`: .. idio:value:: user-spawn-id :canonical: expect/user-spawn-id :scope: dynamic :type: :ref:`expect/struct-spawn ` ``user-spawn-id`` is a spawn-id representing the user, more particularly ``libc/STDIN_FILENO``. .. warning:: Calling :ref:`exp-close ` or :ref:`exp-wait ` with ``user-spawn-id`` may have undesired consequences. .. _`expect/tty-spawn-id`: .. idio:value:: tty-spawn-id :canonical: expect/tty-spawn-id :scope: dynamic :type: :ref:`expect/struct-spawn ` ``tty-spawn-id`` is a spawn-id representing :file:`/dev/tty`. If :file:`/dev/tty` is not available, ``tty-spawn-id`` is ``#f``. .. warning:: Calling :ref:`exp-close ` or :ref:`exp-wait ` with ``tty-spawn-id`` may have undesired consequences. .. _`expect/exp-timeout`: .. idio:value:: exp-timeout :type: fixnum :canonical: expect/exp-timeout :scope: dynamic :default: ``-1`` ``exp-timeout`` is the timeout used by :ref:`exp-case ` measured in seconds. A value of 0 represents a poll of the device. A value of -1, the default, represents an infinite timeout. .. note:: :manpage:`expect(1)` defaults to a timeout of 10 (seconds). Don Libes has indicated some regret over this value and that it should be off by default (see `Writing a Tcl Extention in only... 7 Years` in the Proceedings of the Fifth Annual Tcl/Tk Workshop Boston, Massachusetts, July 1997). .. _`expect/exp-match-max`: .. idio:value:: exp-match-max :type: fixnum :canonical: expect/exp-match-max :scope: dynamic :default: ``2000`` ``exp-match-max`` is the number of code points to retain in the buffer between rounds. .. _`expect/exp-slow`: .. idio:value:: exp-slow :type: pair :canonical: expect/exp-slow :scope: dynamic :default: ``(600 50)`` -- 600 code points and a 50ms delay ``exp-slow`` is a tuple of the number of code points in a burst prefixed by a delay of a number of milliseconds. The default is roughly equivalent to a 115200 baud modem (if the code points were ASCII). .. _`expect/exp-human`: .. idio:value:: exp-human :type: pair :canonical: expect/exp-human :scope: dynamic :default: ``(180 240 1 45 360)`` ``exp-human`` is a tuple of: * the average gap between in-word code points * the average gap transitioning from an in-word code point to a non-word code point * a moderating factor, K: "tiredness" might be represented by a K < 1 and preternaturally consistent typing by a K > 1 * the minimum inter-code point gap, defaulting to a quarter of the in-word gap * the maximum inter-code point gap, defaulting to twice the in-word gap The default is roughly equivalent to a 60 wpm typist. The algorithm used to calculate the inter-code point gap is the inverse cumulative distribution function of the Weibull distribution. The same as Don Libes' :manpage:`expect(1)`. .. include:: ../commit.rst