|
|
1.1 root 1: BUGS:
2: ARGC and ARGV include a - for stdin when there are no args.
3:
4: WISH LIST:
5:
6: %c
7: re parsing function of some kind
8: save compiled state
9: lazy field evaluation
10: type decls
11: scanf
12: access to run-time fcns
13: c output, link to c
14: char fcns, left side fcns (e.g., lsubstr)
15: coercion of expr to condition and vice versa
16: begin & end in patterns
17: limits on arrays, etc., ought to be dynamic instead of static.
18:
19:
20: CHANGES SO FAR (Jul 85):
21:
22: added & in replacement of sub() and gsub(); use \& to quote it
23:
24: mutiple BEGIN's and END's concatenated
25:
26: replaced error reporting mechanism
27:
28: "function" is a synonym for "func"
29:
30: "delete array[elem]" removes elem from array
31:
32: Fixed bug in field handling for ~ 25% speed up.
33:
34: Augmented the getline function:
35: getline
36: sets $0, NR, NF, $1..., from next input record
37: getline x
38: sets x from next input record, sets NR,
39: but NOT $0, NF, etc.
40: getline < "foo"
41: sets $0 from file foo. sets NF, $1...,
42: but NOT NR
43: getline x < "foo"
44: sets x from foo. no effect on $0, NF, NR, etc.
45:
46: Files are as for print; they are matched by name,
47: and remain open until explicitly closed.
48: Input pipes work; syntax is
49: "whatever" | getline
50: "something" | getline x
51: (This adds a reduce/reduce conflict
52: to the grammar, so it may be a bad idea.)
53:
54: getline returns 0 on EOF, -1 on error, >0 normally
55:
56: Added close function:
57: close("foo") calls fclose for right file or pclose for pipe
58:
59: Added sub(regexp, replacement, str) and gsub(...).
60: Substitutes replacement for leftmost occurrence
61: of regexpr in str, or in $0 if no str supplied.
62: Gsub substitutes for all. Number of changes
63: is returned.
64:
65: Regular expressions can be dynamic. Any constant string
66: or variable can be used as a regular expression
67: in sub(), gsub, or after ~ and !~.
68:
69: Field separators can be regular expressions, both in FS
70: and as the 3rd argument of split().
71:
72: Added "i in arr" condition, for if (...) and patterns.
73: i in arr is true if arr[i] has been defined.
74: Note that this is different from asking if
75: arr[n] == i for some i! We are searching for
76: a subscript, not a value.
77:
78: terminal i/o, eg stderr
79: at least for output, no change needed:
80: print | "cat -u 1>&2"
81: can only have one of these active at one time.
82:
83: ARGC and ARGV[] exist, essentially as in C.
84: ARGC is the number of arguments including the program name.
85: ARGV[0]..ARGV[ARGC-1] are the arguments
86: These can be modified in any way at any time.
87: If an ARGV[i] for i>0 is not null, it is assumed to be
88: the name of a file and is opened in the normal sequence.
89: New members of ARGV can be added dynamically beyond the
90: ones currently processed.
91: The argument '-' is added when input is stdin.
92:
93:
94: added system(), rand(), srand(), sin, cos, atan2
95:
96: added variable FNR -- line number in current file
97: can test FNR == 1 to see if in new file
98:
99: Fixed so that \f, \b, \r, \ddd work in strings as in C
100:
101: Functions are in:
102: recursive
103: arguments are call by value for scalars, by ref for arrays
104: declaration is
105: func f(arg list) statement
106: arguments by name
107: arguments are local; all others global
108: return [expr]
109:
110: Order rules relaxed:
111: BEGIN, END, func declarations can occur anywhere a pattern can.
112:
113: Added awkcheck when syntax error encountered,
114: for better identification of some errors.
115: Other error messages better. Line number in source
116: and input line line both given for dynamic errors.
117: Some previously uncaught things now flagged
118: e.g. print <= "foo"
119: print > foo (where foo is null)
120: detects calls of undefined functions, like foo(bar)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.