-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEXTENS.TXT
127 lines (86 loc) · 4.11 KB
/
EXTENS.TXT
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
This is file extens.txt for Moscow SML 1.02 (11 September 1994)
Extensions
==========
* Strings can be compared with `<', `>', `<=', `>='.
* `std_err' is a stream corresponding to `stderr' in C. All
output to std_err is flushed immediately.
* The `use' command enables a file containing declarations
and expressions to be read as if its contents was entered
from the console. Syntactically ,`use' is a top-level
"declaration" of the form:
use "filename";
A file loaded by means of a `use' command may, in turn,
contain `use' commands.
Non-standard primitives
=======================
quit : unit -> unit
Evaluating `quit()' quits Moscow SML immediately.
system : string -> int
`system "xxx"' causes the command xxx to be executed by the
operating system.
If a non-zero integer is returned, this must indicate that
the operating system has failed to execute the command.
But, under MS DOS, the integer returned always equals to
zero...
The primitive `system' will work only if the corresponding
primitive has been added to the Caml Light run-time system.
print : 'a -> 'a
`print' is a polymorphic function provided as a quick
debugging aid. This is an identity function, which as a
side-effect prints its argument exactly as it would be
printed at top-level.
The effect of `print' is different from that in
SML/NJ `print' when the argument is a string (but similar
to that of Edinburgh ML). A function similar to SML/NJ `print'
for printing strings can be defined as follows:
fun show t = output(std_out, t)
printDepth : int ref
This variable determines the depth (in terms of nested
constructors, records, tuples, and lists) to which values
are printed by the top-level value printer and the function
`print'. The components of the value whose depth is greater
than `printDepth' are printed as `#'.
The initial value of `printDepth' is 20. This value can be
changed by the user's program at any moment.
printLength : int ref
This variable determines the way in which list values are
printed by the top-level value printer and the function
`print'. If the length of a list is greater than
`printLength', only the first `printLength' elements are
printed, whereas the remaining elements are printed as
`...'.
The initial value of `printLength' is 200. This value
can be changed by the user's program at any moment.
makestring : 'a -> string
`makestring' is an overloaded function whose argument must
be resolved as either `int', `real', or `string'. It
returns a string what `print' would produce on the screen.
flush_out : outstream -> unit
`flush_out' ensures that the consumer associated with an
outstream has received all of the characters that have been
written to that stream.
can_input : instream * int -> bool
`can_input' takes an instream and a number and determines
whether or not that many characters may be read from that
stream without blocking. NOTE: In future releases, the type
of can_input may change to instream -> int (as in SML/NJ).
input_line : instream -> string
`input_line' returns a string consisting of the characters
from an instream up through, and including, the next
end-of-line character. If the end-of-stream is reached
without reaching an end-of-line character, all remaining
characters from the stream (without an end-of-line
character!) are returned.
open_append : string -> outstream
Files may be open for output while preserving
their contents by using `open_append'. Subsequent output to
the outstream returned by `open_append' is appended to the
contents of the specified file.
Loading files from the command line
===================================
Entering
mosml.exe filename1 ... filenameN
is equivalent to entering
mosml.exe
and, when Moscow SML have started, entering
use "filename1"; ... use "filenameN";