-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusrlib.joy
78 lines (63 loc) · 1.7 KB
/
usrlib.joy
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
(* FILE: usrlib.joy - if it exists, then it is loaded by default *)
LIBRA
RAWJOY1 == "the primitives of the Joy1 system\n";
_usrlib == true;
putchars == [putch] step;
(* personalise:
myname == "Abigail Aardvark";
myphone == 12345678;
etc *)
HIDE
returned == "\007\nReturned to Joy\n" putchars
IN
(* unix: *)
unix == true;
control-eof == 'D;
terminal == "/dev/tty";
ls == "ls -la" system;
editor == "vi ";
escape ==
"\nTo return to Joy, type: exit\n" putchars
"csh" system
returned;
(* etc *)
(* vms:
vms == true;
control-eof == 'Z;
terminal == "tt:";
dir == "DIR/DATE" system returned;
editor == "TECO ";
escape ==
"\nTo return to Joy, hit Control-" putchars
control-eof putch '\n putch
"@tt:" system
returned;
etc *)
edit ==
dup editor swap concat system
dup "Including " putchars putchars '\n putch
include
returned;
find-in ==
[ [ [ [unix] first body null not ]
" " swap concat concat "grep " swap concat system ]
[ [ [vms] first body null not ]
swap " " swap concat concat "SEARCH " swap concat system ]
[ "unknown operating system for find-in\n" putchars ] ]
cond
returned;
standard-setting == 1 setautoput (* 1 setundeferror *);
USRLIB == "usrlib.joy - (personal) user library\n"
END . (* end HIDE and LIBRA *)
(* demo:
"library" "*.joy" find-in.
etc *)
"usrlib is loaded\n" putchars.
standard-setting.
"inilib.joy" include.
(* assuming inilib.joy was included: *)
"agglib.joy" include.
(* "numlib.joy" include. *)
(* show-todaynow. *)
DEFINE verbose == true. (* Example of over-riding inilib.joy *)
(* END usrlib.joy *)