aboutsummaryrefslogtreecommitdiff
path: root/doc/jim_man.txt
blob: fca664c625df6c608e6cad1a8bd719caa592be7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Jim(n)
======

NAME
----
Jim - a better Tcl

SYNOPSIS
--------

  cc <source> -ltcl6

or

  jimsh <script>

INTRODUCTION
------------
# what: jim commands, description, points to ponder

jim 
	set var [value]

	dict

	array [get | set ]
	set $array($elem) $val
		the array command and array syntax $array($elem) is 
		an wrapper around dict!

	
package eventloop
	after time/ms script
		the script is mandatory! a blocking wait is not implemented ( good!? )
		returns event_handle
		open: after cancel and remaining time query. ( stubs in C exist UK)

	vwait variable
		work the eventloop until variable is accessed.
		currently works only on change of variable content!!
		returns ?variable value?

package aio
	aio.open 
		returns handle ?aio.file<nnn>?

	aio.socket <socketspec> <serverspec>|<remotehostspec> 
		socketspec       may be stream, stream.server ( TODO : dgram , domain, ..... ) 
		serverspec       may be [ANY|<InterfaceIPorName>]:<port|servicename>
		remotehostspec   may be <hostIPorName>:<port|servicename>
		returns handle ?aio.socket<nnn>? | aio.

	$aio.handle
		close 
		tell
		seek
		gets 
		read 
		write 
		ndelay [1|0]
		readable [ {} | <readable event script> [ <eof event script> ] ]
			noargs: return the scripts for readable event, optional eof event script.
			returns {} on not setup
			[ list <readable script> <eof script> ]
			arg {} : remove event
			arg <readable script> : setup script or read event, fold eof into this script
			arg <readable script> <eof script> same as above, eof is handled separately.

		writable
			same for writable, no eof though
		onexception
			same for out-of-band data

		accept
			applys only to server sockets and should be used in a fileevent.
			returns a new socket handle for the accepted connection.


package posix
	signal <signame> [ <sigaction> ]
		tell signal action for signal $signame or if given set action to $sigaction
		$sigaction can be either default, ignore , debug or ( TODO: an action script 
		that works like a fileevent )
		in all cases the previous action is returned.

	sleep	<seconds> 
		sleep number of seconds

	usleep	<delay> [ <units> ]
		call usleep/nanosleep with given value
		bare or time as float plus unit ( one of s ms us ns )
		
	pit
		return unix second ( since epoch ) as a float(double)
	Jpit
		return Julian Date in days as a float(double)!
		see http://en.wikipedia.org/wiki/Julian_Date