expect Values

value spawn-id
Canonical:

expect/spawn-id

Scope:

dynamic

Type:

expect/struct-spawn

spawn-id is set by and returned from 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, exp-wait does not modify a list-variant spawn-id and it will continue as a list of (expired) spawned processes.

value user-spawn-id
Canonical:

expect/user-spawn-id

Scope:

dynamic

Type:

expect/struct-spawn

user-spawn-id is a spawn-id representing the user, more particularly libc/STDIN_FILENO.

Warning

Calling exp-close or exp-wait with user-spawn-id may have undesired consequences.

value tty-spawn-id
Canonical:

expect/tty-spawn-id

Scope:

dynamic

Type:

expect/struct-spawn

tty-spawn-id is a spawn-id representing /dev/tty.

If /dev/tty is not available, tty-spawn-id is #f.

Warning

Calling exp-close or exp-wait with tty-spawn-id may have undesired consequences.

value exp-timeout
Type:

fixnum

Canonical:

expect/exp-timeout

Scope:

dynamic

Default:

-1

exp-timeout is the timeout used by 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

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).

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.

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).

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’ expect(1).

Last built at 2024-05-17T06:10:46Z+0000 from 62cca4c (dev) for Idio 0.3.b.6