Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /archive/0.93/doc/bugs/masterbugs
ViewVC logotype

Annotation of /archive/0.93/doc/bugs/masterbugs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4958 - (view) (download)

1 : dbm 4958 Master Bug List, Standard ML of New Jersey as of June 26, 1991.
2 :     Most of these bugs have been fixed; these are all bugs ever reported.
3 :    
4 :     -------------------------------------------------------------------------------
5 :     1. Identifier as functor body (dbm)
6 :     Problem:
7 :     Using a parameter structure variable as the body of a functor yields an
8 :     error message.
9 :     Code:
10 :     functor F(structure A: sig end) = A
11 :     Messages:
12 :     Error: unbound structure id: A
13 :     Comment:
14 :     Status: fixed in 0.20, along with some related bugs involving lack of
15 :     visibility of parameters on the rhs of functor declarations.
16 :     -------------------------------------------------------------------------------
17 :     2. Mispelled nonnullary constructors in patterns
18 :     Problem:
19 :     Mispelling a constructor with arguments in a pattern leads to misleading
20 :     error messages.
21 :     Version: 0.18
22 :     Code: (in typing/typecheck.sml)
23 :     ...
24 :     app genType rvbs
25 :     end
26 :     | EXCEPTIONdec(ebs) =>
27 :     let fun checkWeak(VARty(ref(UNBOUND id))) =
28 :     if tyvarWeakness id > abs
29 :     then condemn "type variable in exception type too strong"
30 :     ...
31 :     Status: Fixed in 0.50
32 :     -------------------------------------------------------------------------------
33 :     3. Redefining an open structure at top level
34 :     Problem:
35 :     It appears that redeclaration of an opened structure S releases the
36 :     runtime binding of S, even though we can still refer to its component
37 :     x. We get the effect of a kind of dangling reference. Need to avoid
38 :     reclaiming S if S is open at the point where it is redeclared.
39 :     Version: 0.18
40 :     Code:
41 :     - structure S = struct datatype t = A val x = A end;
42 :     structure S : <sig>
43 :     - S.x;
44 :     val it = A : S.t
45 :     - open S;
46 :     open S
47 :     - x;
48 :     val it = A : t
49 :     - type t = bool;
50 :     type t = bool
51 :     - x;
52 :     val it = A : S.t
53 :     - structure S = struct end;
54 :     structure S : <sig>
55 :     - x;
56 :     uncaught exception Intmap
57 :     -
58 :     Comment:
59 :     Need to detect the fact that a structure has been opened at the top level
60 :     and if so it's lvar binding should not be deleted from the top-level environment.
61 :     Status: fixed in 0.20. top level opens copy bindings into top level environment.
62 :     --------------------------------------------------------------------------------
63 :     4. duplicate specifications not checked
64 :     Problem:
65 :     No checking for duplicated specifications in signatures.
66 :     Version: 0.18
67 :     Comment:
68 :     This should be done when building the signature symbol table.
69 :     See bug 81. (elg)
70 :     Status: fixed in 0.73
71 :     --------------------------------------------------------------------------------
72 :     5. exportML environment
73 :     Problem:
74 :     Subtle bug in exportML: it exports the environment of the person who
75 :     originally booted the system, and this environment is restored when
76 :     the image is started up. This effects system, execute, and
77 :     subsequent exportML's. On startup, exportFN destroys the environment
78 :     and command-line args, and this too could have adverse effects on
79 :     those functions.
80 :     Version: 0.18
81 :     Status: fixed in version 0.31
82 :     --------------------------------------------------------------------------------
83 :     6. open file descriptors
84 :     Problem:
85 :     File descriptors open in the ML system remain open on a call of system.
86 :     Version: 0.18
87 :     Comment:
88 :     I haven't decided what I want to do about this yet. We
89 :     might like only stdin, stdout, and stderr to remain open.
90 :     Note that if the parent closes one of them, it will be closed in the
91 :     child as well (it inherits them rather than getting new ones).
92 :     Note that
93 :     ioctl(fd,FIOCLEX,(void *)0)
94 :     will cause a file descriptor to be closed on an exec. This could be
95 :     called after each open (but shouldn't be called on pipes).
96 :     Another possibility is just to leave them all open.
97 :     Status: not a bug, reflects Unix semantics
98 :     --------------------------------------------------------------------------------
99 :     7. constructor representation
100 :     Problem:
101 :     There is a bug involving constructor representation. The compiler
102 :     examines the structure of a datatype and tries to determine an efficient
103 :     runtime representation for it. For example, for the list datatype, nil
104 :     can be represented as an integer, and :: can just be a pointer to its
105 :     tuple argument (integers and tuples are distinct). This fails in our system
106 :     at the structure level. For example:
107 :     Version: 0.18
108 :     Code:
109 :     signature S = sig
110 :     type 'a t
111 :     datatype 'a list = nil | :: of 'a t
112 :     end
113 :     structure A : S = struct
114 :     datatype 'a list = nil | :: of 'a * 'a list
115 :     withtype 'a t = 'a * 'a list
116 :     end
117 :     Comment:
118 :     Here the compiler can deduce the efficient representation for the
119 :     (local) list datatype in structure A; but this cannot be deduced in
120 :     the signature S (an object of type 'a t might not be a pointer).
121 :     Status: An error message is now generated (0.54) when this occurs.
122 :     --------------------------------------------------------------------------------
123 :     8. interactive error recovery
124 :     Problem:
125 :     In the interactive mode, parser error recovery should be suppressed
126 :     (but isn't); the parser may continue to look for input after an error,
127 :     when the user would expect to be back at top level.
128 :     Version: 0.18
129 :     Status: Fixed in 0.52
130 :     --------------------------------------------------------------------------------
131 :     9. behavior at limits (e.g. stack overflow)
132 :     Problem:
133 :     The behavior of the system when it reaches limits is sometimes bizarre.
134 :     For instance, on a Sun, if the system runs out of stack space it
135 :     will die with "Illegal instruction". This is because the signal can't
136 :     be handled since the stack is full. A possible fix would be to use a
137 :     separate stack to handle signals, but the handler would have to be
138 :     smart, since SIGSEGV would be raised. Note that the stack limit can
139 :     be changed with the limit command; and hopefully this particular bug will
140 :     disappear with the next version of the code generator.
141 :     Version: 0.18
142 :     Status: fixed in version 0.31
143 :     --------------------------------------------------------------------------------
144 :     10. exhaustiveness messages at top-level
145 :     Problem: Top level bindings should not report on exhaustiveness, but they do.
146 :     Version: 0.18
147 :     Status: Not important.
148 :     --------------------------------------------------------------------------------
149 :     11. poor error messages [parser]
150 :     Problem: Poor error message (parens are needed around the hd::tl pattern):
151 :     Version: 0.18
152 :     Code:
153 :     - fun f hd::tl = 4;
154 :     Messages:
155 :     Error: expected EQUAL, found ID (::)
156 :     Error: expected nonfix-identifier, found ID ::
157 :     Error: unbound variable bogus
158 :     Error: type error: operator and operand don't agree
159 :     operator : ((wrong*wrong list) -> wrong list)
160 :     operand : (wrong*('aA list -> 'aA list))
161 :     expression:
162 :     bogus :: tl
163 :     -
164 :     Comment:
165 :     The "unbound variable bogus" in particular is confusing.
166 :     Status: Fixed in 0.52.
167 :     -----------------------------------------------------------------------------
168 :     12. loss of information in value printing
169 :     Problem:
170 :     When printing values formed using constructors created by functor application,
171 :     the argument type of the constructor can sometimes be lost, resulting in
172 :     inability to print the value accurately.
173 :     Version: 0.18
174 :     Code:
175 :     - functor F(type t) =
176 :     = struct
177 :     = datatype r = C of t
178 :     = end;
179 :    
180 :     - structure S = F(type t = int);
181 :    
182 :     - S.C 3;
183 :     [1] val it = C - : S.r
184 :    
185 :     But
186 :     - signature SS = sig type t datatype r = C of t end;
187 :    
188 :     - structure S = struct type t = int datatype r = C of t end;
189 :    
190 :     - S.C;
191 :     val it = fn : ?.t -> S.r
192 :    
193 :     - S.C 3;
194 :     val it = C 3 : S.r
195 :    
196 :     and
197 :     - structure S': SS = struct type t = int datatype r = C of t end;
198 :     - S'.C;
199 :     val it = fn : ?.t -> S'.r
200 :     - S'.C 3;
201 :     val it = C 3 : S'.r
202 :    
203 :     Comments:
204 :     Printing the argument type of C at [1] yields "IND/1/", indicating that
205 :     the type of C contains an indirection that is not interpreted in context.
206 :     It does not seem possible to recover the context from the structure S, because
207 :     there is no simple way to get back from the type S.r or the DATACON C to the
208 :     structure environment. This may be a reason for having type constructors
209 :     contain a pointer to their home structure rather than just the symbolic
210 :     path. Another alternative would be to follow the path in S.r to find the
211 :     structure S so that we can use it as context for the type of C.
212 :     Status: fixed in 0.58
213 :     -----------------------------------------------------------------------------
214 :     13. printing of types from abstraction structure
215 :     Problem:
216 :     Printing of types from an abstraction is not quite right.
217 :     Code: (test/sigs/test7)
218 :     signature FOO =
219 :     sig
220 :     type T1 and T2
221 :     val x1: T1 and x2: T2
222 :     sharing type T1 = T2
223 :     end
224 :    
225 :     abstraction Foo: FOO =
226 :     struct
227 :     datatype T1 = CON
228 :     type T2 = T1
229 :     val x1 = CON and x2 = CON
230 :     end
231 :    
232 :     [Foo.x1,Foo.x2];
233 :     Messages:
234 :     [-,-] : ?.T1 (* should be Foo.T1 *)
235 :     Status: Fixed in 0.56
236 :     --------------------------------------------------------------------------------
237 :     14. Bad printing of list values
238 :     Problem: list values printed with :: instead of [...]
239 :     Version:
240 :     Code:
241 :     datatype Foo = FOO of int list
242 :     val it = FOO [1, 2, 3]
243 :     Messages:
244 :     FOO (1 :: 2 :: 3 :: nil): Foo
245 :     Comments:
246 :     Status: Fixed in version 0.25.
247 :     --------------------------------------------------------------------------------
248 :     15. Error message
249 :     Problem: Unfortunate error message (I left out `type'):
250 :     Version: ?
251 :     Code:
252 :     - signature STWO = sig structure X:SIG and Y:SIG sharing X.t=Y.t end;
253 :     Messages:
254 :     Error: bad path is sharing specification
255 :     Comments:
256 :     (It's also misspelled.)
257 :     Status: fixed in 0.56
258 :     --------------------------------------------------------------------------------
259 :     16. "use" errors
260 :     Problem:
261 :     Untidy interface to "use". "use" on a nonexistent file still prints the
262 :     "[opening ...]" message and then raises Io_failure - shouldn't it just
263 :     say "[cannot open ...]" or something?
264 :     Status: fixed
265 :     --------------------------------------------------------------------------------
266 :     17. Inaccurate line numbers
267 :     Problem:
268 :     Misleading line numbers for some things (eg. type errors in multi-line
269 :     datatype declarations). Could the system print something like
270 :     "Line 33ff", or a line range a la LaTeX, for these?
271 :     Status: fixed in 0.53
272 :     --------------------------------------------------------------------------------
273 :     18. Bad error messages for illegal record expression
274 :     Version: [< 0.16]
275 :     Problem:
276 :     interesting diagnostic in the (meaningless) expression
277 :     Code:
278 :     - {3};
279 :     Messages:
280 :     Error: expected RBRACE, found INT
281 :     Error: type error: operator and operand don't agree
282 :     operator : unit
283 :     operand : int
284 :     expression:
285 :     () 3
286 :    
287 :     Error: declaration or expression expected, found RBRACE
288 :     Comment:
289 :     What's the "() 3"?
290 :     Status: fixed in 0.53
291 :     --------------------------------------------------------------------------------
292 :     19. Exception declaration with ":"
293 :     Problem: This gives a type error rather than a syntax error: odd:
294 :     Version: ?
295 :     Code:
296 :     - signature FOO = sig exception Foo of string end;
297 :    
298 :     - structure Foo: FOO = struct exception Foo: string end;
299 :     =-> ^ <-=
300 :     Messages:
301 :     Error: Type in structure doesn't match signature
302 :     name = Foo
303 :     spec = (string -> exn)
304 :     actual = exn
305 :     Comments:
306 :     Without signature constraint ":FOO" in declaration of Foo you get a syntax
307 :     error: "expected END, found COLON". With the signature, you get the above
308 :     type error but no complaint about the ":".
309 :     Status: fixed in 0.53
310 :     --------------------------------------------------------------------------------
311 :     20. "print" seems overloaded rather than polymorphic:
312 :     Problem: print is overloaded rather than being polymorphic
313 :     Version: -
314 :     Code:
315 :     - datatype Foo = FOO1 | FOO2;
316 :     - print FOO1;
317 :     Messages:
318 :     Error: type error: no match for overloaded variable:
319 :     print
320 :     Comments:
321 :     according to the original SML report, both "print" and "makestring"
322 :     should be polymorphic identity functions. In our compiler, "print"
323 :     is correctly polymorphic. "makestring" is (incorrectly) overloaded,
324 :     disallowing "makestring FOO1". Needless to say, I want to be able
325 :     to do "makestring" on datatypes.
326 :     Status: not a bug
327 :     --------------------------------------------------------------------------------
328 :     21. Bad error recovery in the typechecker:
329 :     Problem:
330 :     Version: 0.15a
331 :     Code:
332 :     - signature SIG = sig
333 :     exception Foo of int
334 :     val A: int
335 :     val B: int
336 :     val C: int
337 :     end;
338 :    
339 :     - structure S: SIG =
340 :     struct
341 :     exception Foo: int
342 :     ^
343 :     val A = 1
344 :     val B = 2
345 :     val C = 3
346 :     end
347 :     Messages:
348 :     Error: Type in structure doesn't match signature
349 :     name = Foo
350 :     spec = (int -> exn)
351 :     actual = exn
352 :     Error: unmatched val spec: A
353 :     Error: unmatched val spec: B
354 :     Error: unmatched val spec: C
355 :     ^ there can be a lot of these!
356 :     Comments:
357 :     Sometimes the exception error doesn't appear, just giving the unmatched
358 :     spec errors, rather misleadingly.
359 :     Status: fixed in 0.53
360 :     --------------------------------------------------------------------------------
361 :     22. inherited environment of subprocesses
362 :     Problem:
363 :     (one you know about) - subprocesses created via "execute" inherit
364 :     the environment present when the ML system was built! Also: broken
365 :     pipe errors should be caught and raise Io_failure?
366 :     Status: fixed in 0.31
367 :     --------------------------------------------------------------------------------
368 :     23. circularity in substructure relationship
369 :     Problem:
370 :     No checking for circular sharing constraints. Circular constraints cause
371 :     unhandled Notfound_Table exception.
372 :     Code:
373 :     - signature Sig =
374 :     sig
375 :     structure D: sig
376 :     structure E: sig end
377 :     end
378 :    
379 :     sharing D = D.E
380 :     end;
381 :     Messages:
382 :     uncaught exception Notfound_Table
383 :     Comments:
384 :     By the way - why is "sharing structure D = D.E" illegal above? (it
385 :     dislikes the word "structure".)
386 :     See bug 33. (elg)
387 :     Status:
388 :     Not considered a bug (signature can't be matched, -- this property could
389 :     be statically detected in the compiler, but isn't).
390 :     --------------------------------------------------------------------------------
391 :     24. incomplete write
392 :     Submitter: Nick
393 :     Comments:
394 :     I'm trying to put in some bullet-proof error recovery into my
395 :     subprocess software, so that "^C" at ML top-level doesn't
396 :     confuse the daemon. What happens if an "output" operation is
397 :     active when ^C is hit - does it do a partial write? I seem to be
398 :     getting some buffer corruption somewhere, as a partial write is
399 :     immediately followed by another complete write. It might make
400 :     my life easier if "output" could be guaranteed atomic under "^C"
401 :     (i.e. any single output operation will complete before Interrupt
402 :     gets raised).
403 :     Just a thought. I'll perhaps put timers into the daemon and ML code
404 :     so that they flush and restart properly - this may solve the problem.
405 :     Status: New signal-handling stuff in 0.56 makes this less important.
406 :     --------------------------------------------------------------------------------
407 :     25. parser vs grammar (?)
408 :     Problem: Parser doesn't accept "vb ::= rec rec vb".
409 :     Status: language problem
410 :     --------------------------------------------------------------------------------
411 :     26. export ML within a use
412 :     Problem:
413 :     Awkward behaviour when exportML is called while a file is being
414 :     "use"'d - the saved state falls over with Io_failure. Shouldn't
415 :     restarting clear the use stack?Version:
416 :     Status:
417 :     Modified in version 18 so the image doesn't die. It still raises
418 :     Io_failure, though. (tyj)
419 :     Fixed in 0.56
420 :     --------------------------------------------------------------------------------
421 :     27. different numbers of arguments in curried clauses cause bogus type error
422 :     Version: 0.15
423 :     Code:
424 :     fun compose [] = (fn x => x) |
425 :     compose (f::fl) x = compose fl (f x);
426 :     Messages:
427 :     Error: type error: rules don't agree
428 :     expected: ('a list -> ('b -> 'b))
429 :     found:
430 :     (f :: fl,x) => compose fl (f x)
431 :     : ((('c -> 'd) list*'c) -> 'e)
432 :     Status: fixed in 0.19.
433 :     --------------------------------------------------------------------------------
434 :     28. tyvars in top-level type constraint
435 :     Submitter: Carl Gunter, gunter@linc.cis.upenn.edu (also Reppy, 4/20/88)
436 :     Date: 3/27/88
437 :     Version: 0.18
438 :     Problem: tyvars not accepted in top-level type constraint
439 :     Code:
440 :     - length : 'a list -> int;
441 :     Messages: (compiler messages associated with bug)
442 :     Error: lookTyvar -- unbound tyvar in closed scope
443 :     Error: Impossible error: generalizeTy -- bad arg
444 :     undef list -> int
445 :     Status: fixed in 0.20 (put protectTyvars around top level expression parse).
446 :     --------------------------------------------------------------------------------
447 :     29. use_string in structure definition
448 :     Submitter: Nick
449 :     Date: 3/24/88
450 :     Version: 0.18
451 :     Problem: use_string can cause uncaught Intmap exception
452 :     Code:
453 :     - structure Foo =
454 :     struct
455 :     val x = use_stream(open_string "val _ = Foo.x;")
456 :     end;
457 :     Messages:
458 :     [opening <instream>]
459 :     [closing <instream>]
460 :     uncaught exception Intmap
461 :     Comments: This code shouldn't work, but the Intmap exception should be caught.
462 :     Status: Fixed in 0.54
463 :     --------------------------------------------------------------------------------
464 :     30. weakness 0 in constraint
465 :     Date: 4/5/88
466 :     Version: 0.18
467 :     Problem:
468 :     Code:
469 :     - fn (x: '0a) => x;
470 :     Messages:
471 :     Error: lookTyvar -- inbound tyvar in closed scope
472 :     Error: Impossible error: generalizeTy -- bad arg
473 :     undef -> undef
474 :     Comments:
475 :     Weak-tyvars of level 0 should raise an error when they occur in
476 :     constraints.
477 :     Status:
478 :     fixed (indirectly) in 0.20. causes error
479 :     Error: can't generalize weak type variable
480 :     '0a -> '0a
481 :     --------------------------------------------------------------------------------
482 :     31. redefining an open structure orphans r/t bindings
483 :     Submitter: John Reppy, jhr@svax.cs.cornell.edu
484 :     Date: 4/4/88
485 :     Version: 0.18
486 :     Problem:
487 :     Redefining a structure after opening it makes its components inaccessible
488 :     at runtime even though they are still visible, because the structure
489 :     binding is removed from the r/t intmap environment.
490 :     Code:
491 :     val it = () : unit
492 :     - structure S = struct type t = int; val x = 1 end;
493 :     structure S : <sig>
494 :     - open S;
495 :     open S
496 :     - structure S = struct type t = bool; val x = true end;
497 :     structure S : <sig>
498 :     - x;
499 :     Messages:
500 :     uncaught exception Intmap
501 :     Comments: can't eliminate a structure from r/t env if it has been opened
502 :     See bug 1. (elg)
503 :     Status: fixed
504 :     --------------------------------------------------------------------------------
505 :     32. printing loops
506 :     Submitter: Andrew
507 :     Date: 4/6/88
508 :     Version: 0.18
509 :     Problem: printing a cyclic data structure involving a ref loops
510 :     Code:
511 :     datatype A = B | C of A ref
512 :     val x = C(ref B);
513 :     val C y = x;
514 :     y := x;
515 :     x;
516 :     Messages:
517 :     prints endlessly
518 :     Comments:
519 :     probably not handling ref constructors properly in tracking depth
520 :     Status: fixed in 0.20. missing base (depth = 0) in printDcon in printval.sml.
521 :     --------------------------------------------------------------------------------
522 :     33. cyclical sharing not checked, parsing problem
523 :     Submitter: Mads
524 :     Date: 4/12/88
525 :     Version: 0.18
526 :     Problem: cyclical sharing not detected, but leads to parsing bug
527 :     Code:
528 :     (1)
529 :    
530 :     signature Sig =
531 :     sig structure a:
532 :     sig structure b: sig end
533 :     end
534 :     structure a': sig end sharing a = a'
535 :     structure b': sig end sharing b' = a.b
536 :     sharing a' = b'
537 :     end
538 :    
539 :     This example should be rejected because it would lead to a cycle in
540 :     the signature for 'a' (the semantics Section 5.4). If one deletes the
541 :     last sharing obtaining
542 :    
543 :     (2)
544 :    
545 :     signature Sig =
546 :     sig structure a:
547 :     sig structure b: sig end
548 :     end
549 :     structure a': sig end sharing a = a'
550 :     structure b': sig end sharing b' = a.b
551 :     end
552 :    
553 :     one get a legal program. However these examples do not survive
554 :     parsing. (I get an "uncaught exception Notfound_Table"). Ignoring
555 :     this, will your sharing algorithm cope with this subtlety?
556 :     Messages:
557 :     uncaught exception Notfound_Table (now fixed)
558 :     Comments:
559 :     We may not try to find cycles, since they would in any case prevent
560 :     the signature from matching any structure. [dbm]
561 :     Status: partially fixed in 0.20. cycle not detected, but exception is handled.
562 :     --------------------------------------------------------------------------------
563 :     34. uncaught Instantiate in type checking
564 :     Submitter: Trevor
565 :     Date: 4/14/88
566 :     Version: 0.18
567 :     Problem: uncaught Instantiate exception during type checking
568 :     Code:
569 :     structure foo =
570 :     struct
571 :    
572 :     local
573 :     exception Sort
574 :     in
575 :     fun sort (op > : ('x * 'x -> bool))
576 :     = let fun select(min, best, hd::tl) = select(min,
577 :     if best > min
578 :     then if best > hd andalso hd > min
579 :     then hd else best
580 :     else hd,
581 :     tl)
582 :     | select(min, best, nil) = best;
583 :     fun lowest(best, hd::tl) = lowest( (if hd>best then best else hd), tl)
584 :     | lowest(best, nil) = best;
585 :     fun s (l as (hd::tl), min) = min
586 :     | s _ = raise Sort
587 :     in fn (l as (hd::tl)) => let val v = lowest(hd,tl) in v :: s(l, v) end
588 :     | nil => nil
589 :     end
590 :     end (* local *)
591 :    
592 :     end
593 :     Messages:
594 :     uncaught exception Instantiate
595 :     Comments:
596 :     Status: fixed in 0.20.
597 :     --------------------------------------------------------------------------------
598 :     35. Compiler bug: abstractType
599 :     Submitter: Andrew
600 :     Date: 4/6/88
601 :     Version: 0.18
602 :     Problem: type error in functor definition causes Compiler bug error
603 :     Code:
604 :     signature FORMULA =
605 :     sig
606 :     type formula
607 :     val NUM : formula
608 :     end
609 :    
610 :     functor Parse(F : FORMULA) =
611 :     struct
612 :    
613 :     fun parse() : F.formula = (0, F.NUM)
614 :     (* val parse : unit -> F.formula = (fn () => (0, F.NUM)) -or-
615 :     (* val parse : F.formula = (0, F.NUM) -- don't cause abstractType error *)
616 :    
617 :     end
618 :     Messages:
619 :     Error: expression and constraint don't agree (tycon mismatch)
620 :     expression: int * ?.formula
621 :     constraint: ?.formula
622 :     in expression:
623 :     (0,NUM)
624 :     Error: Compiler bug: abstractType
625 :     Status: fixed
626 :     --------------------------------------------------------------------------------
627 :     36. overloading resolution and order of recursive definitions
628 :     Submitter: Dave
629 :     Date: 5/2/88
630 :     Version: 0.18
631 :     Problem:
632 :     overloading resolution can depend on the order in which mutually
633 :     recursive definitions occur
634 :     Code:
635 :     fun f x = x + x
636 :     and g() = f 1
637 :     (* + is not resolved *)
638 :     fun g() = f 1
639 :     and f x = x + x
640 :     (* + is resolved *)
641 :     Status: fixed in 0.52, approximately.
642 :     --------------------------------------------------------------------------------
643 :     37. type printing
644 :     Submitter: Nick
645 :     Date: 5/3/88
646 :     Version: 0.18
647 :     Problem: valid path is not printed for a type
648 :     Code:
649 :     - signature SIG = sig type t val x: t end
650 :     structure S: SIG = struct type t = int val x = 3 end;
651 :     Messages:
652 :     signature SIG
653 :     structure S : <sig>
654 :     - S.x;
655 :     val it = 3 : ?.t
656 :     ^ ???
657 :     Comments:
658 :     Status: fixed in 0.20. (not sure how! as side-effect of another fix?)
659 :     --------------------------------------------------------------------------------
660 :     38. incompatible sharing raises Notfound_Table
661 :     Submitter: Nick
662 :     Date: 5/3/88
663 :     Version: 0.18
664 :     Problem:
665 :     sharing specification between two incompatible structures causes an
666 :     uncaught Notfound_Table exception.
667 :     Code:
668 :     - signature FOO1 =
669 :     sig
670 :     structure S: sig type S end
671 :     structure T: sig type T end
672 :     sharing S = T
673 :     end;
674 :     Messages:
675 :     uncaught exception Notfound_Table
676 :     Status: fixed in 0.20. Added handlers for Notfound_Table in function
677 :     sMerge in typing/sharing.sml.
678 :     --------------------------------------------------------------------------------
679 :     39. type abbrev not recognized as function type
680 :     Submitter: dbm
681 :     Date: 5/12/88
682 :     Version: 0.19
683 :     Problem:
684 :     type abbreviation expands to function type, but not recognized as
685 :     a functional type by the type checker
686 :     Code:
687 :     type 'a church = ('a -> 'a) -> ('a -> 'a);
688 :     val zero = fn f => fn x => x
689 :     val succ = fn n => fn f => fn x => f (n f x)
690 :     val pred = fn n : 'a church =>
691 :     ((fn (_,b)=>b) (n (fn (a,b) => (succ a, a)) (zero,zero)))
692 :     Messages:
693 :     Error: operator is not a function
694 :     operator: 'a church
695 :     in expression:
696 :     n (fn (a,b) => (succ <exp>,a))
697 :     Comments:
698 :     Status: fixed in 0.20. reduced the ratorTy in APPexp case of expType in
699 :     typecheck.sml.
700 :     --------------------------------------------------------------------------------
701 :     40. Exception aliasing (match compiler)
702 :     Submitter: Dave
703 :     Date: 5/12/88
704 :     Version: 0.19
705 :     Problem:
706 :     Match compiler doesn't cope with exception aliasing (through functor
707 :     parameters, for instance).
708 :     Status: fixed in 0.54
709 :     --------------------------------------------------------------------------------
710 :     41. missing substructure
711 :     Submitter: Dave
712 :     Date: 5/18/88
713 :     Version: 0.19
714 :     Problem:
715 :     substructure required by signature is not declared but appears anyway.
716 :     Code:
717 :     signature AS = sig val x: int end
718 :    
719 :     structure A : AS = struct val x = 3 end
720 :    
721 :     signature BS =
722 :     sig
723 :     structure A : AS
724 :     end
725 :    
726 :     structure B : BS =
727 :     struct
728 :     open A
729 :     end
730 :     Messages:
731 :     should complain, but doesn't
732 :     Comments:
733 :     Status: fixed in 0.20.
734 :     --------------------------------------------------------------------------------
735 :     42. Two signature matching problems.
736 :     Submitter: Bob Harper
737 :     Date: 5/20/88
738 :     Version: 0.18
739 :     Problem:
740 :     (1) missing substructures found in environment,
741 :     (2) bind exception processing sig specs after missing substructure
742 :     Code:
743 :     signature SIG = sig type t val x:t end;
744 :    
745 :     signature SIG' = sig structure S:SIG val y:S.t end;
746 :    
747 :     structure T : SIG = struct type t=int val x = 3 end;
748 :    
749 :     structure T' : SIG' = struct structure S=T val y=S.x end;
750 :    
751 :     (* This yields a sensible error message, then an uncaught exception Bind. *)
752 :     structure T'' : SIG' = struct val y=T.x end;
753 :    
754 :     signature SIG'' = sig structure T:SIG val y:T.t end;
755 :    
756 :     (* This should not succeed, but it does! The unbound structure appears
757 :     in the global environment, so it doesn't notice that the substructure T
758 :     is missing.
759 :     *)
760 :     structure U : SIG'' = struct val y = T.x end;
761 :     Messages:
762 :     Comments:
763 :     (1) missing substructure was found because lookSTR was being used to
764 :     look for structure components in SigMatch.realize. Fixed by introducing
765 :     lookSTRlocal that does not search through STRlayer.
766 :     (2) TypesUtil.lookTycPath was causing bind exception because the missing
767 :     substructure defaulted to the unexpected form INDstr(~1). Caused
768 :     lookTycPath to raise an exception that was caught by typeInContext,
769 :     which then returns ERRORty. SigMatch.compareTypes ignores the ERRORty.
770 :     Status: fixed in 0.20
771 :     --------------------------------------------------------------------------------
772 :     43. incorrect error message for sharing constraints
773 :     Submitter: Bob Harper
774 :     Date: 5/21/88
775 :     Version: 0.18
776 :     Problem:
777 :     "unbound structure id in sharing spec" error message was reporting the
778 :     wrong structure id.
779 :     Code:
780 :     signature SIG = sig end;
781 :    
782 :     signature SIG' = sig
783 :     structure S:SIG
784 :     end;
785 :    
786 :     (* Here it complains that S' is unbound in the sharing specification, but
787 :     actually it's S'.T that is unbound! *)
788 :    
789 :     signature SIG'' = sig
790 :     structure S':SIG'
791 :     structure T:SIG
792 :     sharing S'.T = T
793 :     end;
794 :     Messages:
795 :     Error: unbound structure id in sharing specification: S'
796 :     Comments:
797 :     Moved one of the handlers for Notfound_Table from findStr to getStr
798 :     in sharing.sml.
799 :    
800 :     0.65 now gives output
801 :    
802 :     std_in:19.3-21.19 Error: unbound structure id in sharing specification: T
803 :    
804 :     it would be better to say that S'.T is unbound.
805 :     Status: fixed in 0.20
806 :     --------------------------------------------------------------------------------
807 :     44. subscript exception during parsing
808 :     Submitter: Dave, Bob Harper
809 :     Date: 3/20/88
810 :     Version: 0.18
811 :     Problem:
812 :     Subscript exception raised during parsing
813 :     Code:
814 :     /usr/nml/bugs/bob.4, /usr/nml/examples/micro-ml/make
815 :     Messages:
816 :     uncaught exception Subscript
817 :     Comments:
818 :     path created by function search in EnvAccess.iterFct was in reversed order.
819 :     added rev.
820 :     Status: fixed in 0.20
821 :     --------------------------------------------------------------------------------
822 :     45. equality on simple recursive datatype causes compiler to loop
823 :     Submitter: Dave
824 :     Date: 5/27/88
825 :     Version: 0.19
826 :     Problem:
827 :     Compiling equality for a trivial recursive datatype causes the compiler
828 :     to loop in Equal.equal.(test).
829 :     Code:
830 :     datatype t = A of t
831 :     fun f(x:t) = (x=x)
832 :     Comments:
833 :     Of course this is a useless datatype, but someone could define it by mistake
834 :     and cause the compiler to loop. The problem is the treatment of datatypes
835 :     with a single transparent constructor in the function test in equal. It
836 :     recursively calls test on the argument type of the constructor, which in this
837 :     case is justs t again. A datatype like
838 :    
839 :     datatype t = A of t * int
840 :    
841 :     does not cause the loop.
842 :     Status: fixed in 0.20
843 :     --------------------------------------------------------------------------------
844 :     46. equality type checking and flexrecords
845 :     Submitter: Dave
846 :     Date: 6/3/88
847 :     Version: 0.20
848 :     Problem:
849 :     when flexrecords are used a nonequality type may be accepted in a context
850 :     where an equality record type is required
851 :     Code:
852 :     fun f(r as {a,...},true) = (r = r) (* checks only that a admits equality *)
853 :     | f({b,...},false) = b 3 (* oops, the b field is a function! *)
854 :     Messages:
855 :     val f = fn : {a:''a,b:int -> bool} * bool -> bool
856 :     (* argument type is not an equality type *)
857 :     Comments:
858 :     A fix probably requires a change in the way flexrecords are represented.
859 :     Status: fixed in 0.54. [actually only correctly fixed in 0.85]
860 :     --------------------------------------------------------------------------------
861 :     47. scope of user bound type variable
862 :     Submitter: Mads Tofte (Edinburgh)
863 :     Date: 3/8/88
864 :     Version: 0.18
865 :     Problem:
866 :     some uses of user-bound type variables have strange effects
867 :     Code:
868 :     fun f(x) = let val y : 'a = x in y y end;
869 :     val f = fn : 'a -> 'a
870 :     - f 3;
871 :     Messages:
872 :     Error: operator and operand don't agree (bound type var)
873 :     operator domain: 'a
874 :     operand: int
875 :     in expression:
876 :     f 3
877 :     Comments:
878 :     y gets the type !'a.'a, which allows the expression "y y" to type check
879 :     x gets the user bound type variable 'a as its type and it is not generalized
880 :     either when y's type is generalized or when f's type is generalized
881 :     the result type 'a refers to a generically bound type variable which
882 :     coincidentally is printed as 'a
883 :     Status: fixed in 0.20
884 :     generates an error message indicating that the user-bound type variable was
885 :     propagated out of its scope. This is a rather obscure error message, but it
886 :     is not easy to do better. This seems much better that allowing the propagation
887 :     of the user bound type variable out of its natural syntactic scope, since it
888 :     would be necessary to do arbitrary amounts of type checking to simply determine
889 :     whether two explicit type variables are the same.
890 :     --------------------------------------------------------------------------------
891 :     48. printing of identity withtype declarations
892 :     Submitter: Dave
893 :     Date: 6/9/88
894 :     Version: 0.20
895 :     Problem:
896 :     A simple identity declaration in the withtype clause of a datatype declaration
897 :     will not be printed properly.
898 :     Code:
899 :     datatype foo = A
900 :     withtype t = int;
901 :     Messages:
902 :     datatype foo
903 :     con A : foo
904 :     type t = t
905 :     Comments:
906 :     This happens because the backpatching of the type constructor puts the new
907 :     name in the defining type as well as in the defined type binding.
908 :     Status: fixed by 0.54
909 :     --------------------------------------------------------------------------------
910 :     49. equality status of type constructors after functor application
911 :     Submitter: Dave
912 :     Date: 6/10/88
913 :     Version: 0.20
914 :     Problem:
915 :     type constructors defined in a functor should sometimes become
916 :     equality type constructors when the functor is applied, but they don't.
917 :     Status: fixed in 0.20 (* unfixed in 0.56, refixed in 0.57? *)
918 :     Given up on for the time being (since it's not required by the
919 :     standard). (elg)
920 :     --------------------------------------------------------------------------------
921 :     50. free refs to sibling structures within a signature
922 :     Submitter: Dave
923 :     Date: 6/13/88
924 :     Version: 0.20
925 :     Problem:
926 :     Free references to a sibling structure in a signature are not allowed
927 :     Code:
928 :     signature SS =
929 :     sig
930 :     structure A : sig type t end
931 :     structure B : sig val x : A.t end
932 :     end
933 :     Messages:
934 :     Error: free ref to sibling struct in sig not implemented
935 :     Comments:
936 :     Outer signature env has default info, giving rise to Subscript exception when
937 :     attempting to interpret A.
938 :     Status: fixed in 0.31
939 :     --------------------------------------------------------------------------------
940 :     51. free refs to param struct in functor result signature
941 :     Submitter: Dave
942 :     Date: 6/13/88
943 :     Version: 0.20
944 :     Problem:
945 :     Free references to the functor parameter are not allowed in the result
946 :     signature.
947 :     Code:
948 :     functor F(S: sig type t val x: t end) : sig val y : S.t end =
949 :     struct
950 :     val y = S.x
951 :     end
952 :     Messages:
953 :     Error: unbound head structure: S
954 :     in path: S.t
955 :     Comments:
956 :     Status: fixed in 0.39
957 :     -------------------------------------------
958 :     52. input of large strings
959 :     Submitter: Appel&Duba
960 :     Date: 9/9/88
961 :     Version: 0.20
962 :     System: any
963 :     Problem: (input f k) was unreliable for k>1024
964 :     Status: fixed in 0.22
965 :     -------------------------------------------
966 :     53. exportFn broken
967 :     Submitter: Appel&Duba
968 :     Date: 9/9/88
969 :     Version: 0.20
970 :     System: any
971 :     Problem: exportFn produced an executable that dumped core
972 :     Status: fixed in 0.22
973 :     -------------------------------------------
974 :     54. problems in Sun Unix version 4.0
975 :     Submitter: Appel&Duba
976 :     Date: 9/9/88
977 :     Version: 0.20
978 :     System: Sun 3/SunOS 4.0
979 :     Problem: doesn't work; can't boot sml
980 :     Status: fixed in 0.22
981 :     ------------------------------------------
982 :     55. type constraint on field abbreviation
983 :     Submitter: Duba
984 :     Date: 11/2/88
985 :     Version: 0.22
986 :     System: any
987 :     Problem: won't except type constraint in abbreviated records
988 :     Code: fun f{x : int} = 1;
989 :     Message: Error: expected EQUAL after label, found COLON
990 :     Status: fixed
991 :     ------------------------------------------
992 :     56. big integer constants
993 :     Submitter: Duba
994 :     Date: 11/8/88
995 :     Version: 0.22
996 :     System: cps
997 :     Problem: interger constants must be less than 31 bits
998 :     Code: 1000000000
999 :     Message: Error: Compiler bug: Overflow in cps/generic.sml
1000 :     Status: fixed in 0.24
1001 :     ---------------------------------------------------------------------------
1002 :     57. open_out causes SystemCall exception
1003 :     Submitter: dbm
1004 :     Date: 11/10/88
1005 :     Version: 0.23
1006 :     System: --
1007 :     Problem: opening nonwriteable file causes uncaught exception SystemCall
1008 :     Code:
1009 :     LexGen.lexGen "ml.lex";
1010 :     uncaught exception SystemCall
1011 :     - system "ls -l";
1012 :     total 38
1013 :     -r--r--r-- 2 dbm 993 Nov 9 12:03 ascii.sml
1014 :     -r--r--r-- 2 dbm 3207 Nov 9 12:03 hookup.sml
1015 :     -r--r--r-- 2 dbm 2813 Nov 9 12:03 ml.lex
1016 :     -r--r--r-- 2 dbm 23900 Nov 9 12:03 ml.lex.sml
1017 :     -r--r--r-- 2 dbm 2698 Nov 9 12:03 symbols.sml
1018 :     -r--r--r-- 2 dbm 2599 Nov 9 12:03 timelex.sml
1019 :     val it = () : unit
1020 :     Messages:
1021 :     Comments: Attempting to open an unreadable file for input raises Io_failure,
1022 :     but attempting to open an unwriteable file for output raises
1023 :     SystemCall.
1024 :     Status: fixed.
1025 :     ---------------------------------------------------------------------------
1026 :     58. incorrect string value in Io_failure exception
1027 :     Submitter: dbm
1028 :     Date: 11/10/88
1029 :     Version: 0.23
1030 :     System: vax/v9
1031 :     Problem: string returned by Io_failure invoked by open_in is bogus
1032 :     Code:
1033 :     [assume "all" is the name of an unreadable file]
1034 :     (open_in "all"; "abc") handle Io_failure s => s;
1035 :     Messages:
1036 :     val it = "open_in: open" : string
1037 :     Comments: should be "open_in: all"
1038 :     Status: fixed in 0.49.
1039 :     ---------------------------------------------------------------------------
1040 :     59. memory fault on sun
1041 :     Submitter: Benjamin Pierce, CMU (Benjamin.Pierce@prood.ergo.cs.cmu.edu)
1042 :     Date: 10/18/88
1043 :     Version: 0.22
1044 :     System: Sun 3 / SunOS 4.0 (3.x?)
1045 :     Problem: memory fault
1046 :     Code: see shamash:/usr/sml/bugs/benli/test1.sml
1047 :     Messages: see shamash:/usr/sml/bugs/benli/log1
1048 :     Comments: Test program works on Vax
1049 :     Status: fixed in 0.24 [bug in polymorphic equality for constructions]
1050 :     ---------------------------------------------------------------------------
1051 :     60. floating point coprocessor problem on Sun 3
1052 :     Submitter: M. C. Atkins, University of York, UK., ...!ukc!minster!martin
1053 :     Date: 10th Nov 1988
1054 :     Version: 0.22, 10 October 1988
1055 :     System: Sun3/SunOS 3.5
1056 :     Problem: sml core dumps with illegal instruction (COPROCESSOR PROTOCOL ERROR)
1057 :     Code: (This is what I was given!)
1058 :     val start_seed1 = 0.71573298;
1059 :     val start_seed2 = 0.31872973;
1060 :     val start_seed3 = 0.45832123;
1061 :    
1062 :     val mul1 = 147.0;
1063 :     val mul2 = 375.0;
1064 :     val mul3 = 13.0;
1065 :    
1066 :    
1067 :     fun random seed mul = let val x = seed*mul*3.0
1068 :     in x - real(floor x)
1069 :     end;
1070 :    
1071 :     fun randlist seed1 seed2 seed3 0 = [] |
1072 :     randlist seed1 seed2 seed3 n = let val s1 = random seed1 mul1
1073 :     val s2 = random seed2 mul2
1074 :     val s3 = random seed3 mul3
1075 :     val rn = (floor ((random (s1*s2*s3) 743.0)*37.0) )
1076 :     in rn::(randlist s1 s2 s3 (n-1))
1077 :     end;
1078 :    
1079 :    
1080 :     fun rlist n = randlist start_seed1 start_seed2 start_seed3 n;
1081 :    
1082 :     Messages: No compiler messages. At runtime the following is written to the console:
1083 :     sml: USER COPROCESSOR PROTOCOL ERROR
1084 :     trap address 0x34, pid 147, pc = ea92a, sr = 4, stkfmt 9, context 3
1085 :     D0-D7 3 3 196838 f 0 0 1966b0 efffc50
1086 :     A0-A7 efff274 1affec 0 efffd98 efffda4 0 1b0004 efff264
1087 :    
1088 :     Comments:
1089 :     To duplicate `use' the given code, and then evaluate `rlist
1090 :     300' two or three times. Typically the first evaluation succeeds, but
1091 :     subsequent evaluations fail, giving a core dump (Illegal Instruction)
1092 :     and the above error on the console.
1093 :    
1094 :     I have duplicated the behaviour on both a Sun 3/50, and a Sun
1095 :     3/280 - both equipped with MC68881 floating point coprocessors.
1096 :     /usr/etc/mc68881version gives the following output:
1097 :     on 3/50:
1098 :     MC68881 available; mask set appears to be A93N.
1099 :     Approximate MC68881 frequency 16.5 MHz.
1100 :     on 3/280:
1101 :     MC68881 available; mask set appears to be A93N.
1102 :     Approximate MC68881 frequency 20.3 MHz.
1103 :     Status: fixed in 0.31
1104 :     ---------------------------------------------------------------------------
1105 :     61. lexer bug
1106 :     Submitter: Trevor
1107 :     Date: 11/6/88
1108 :     Version: 0.22
1109 :     System: any?
1110 :     Problem: illegal character causes loss of next line of input
1111 :     Code:
1112 :     - 234;^? (* That's a true delete (or ^A or whatever) that accidentally *)
1113 :     val it = 234 : int (* got stuck in there. *)
1114 :     Error: illegal character
1115 :     - "hello"; (* This line gets discarded *)
1116 :     - 3;
1117 :     val it = 3 : int
1118 :     -
1119 :     Comments:
1120 :     Status: fixed in 0.24
1121 :     ---------------------------------------------------------------------------
1122 :     62. share runtime on SunOS 3.n
1123 :     Submitter: Nick
1124 :     Date: 10/28/88
1125 :     Version: 0.22
1126 :     System: Sun 3, SunOS 3.n
1127 :     Problem: runtime built with share parameter doesn't work on SunOS 3.n
1128 :     Comment: SunOS 3.n object format is not supported
1129 :     Status: no action
1130 :     ---------------------------------------------------------------------------
1131 :     63. curried, clausal def of infix function
1132 :     Submitter: Paulson
1133 :     Version: Version 0.20, 13 June 1988
1134 :     System: Sun3/SunOS
1135 :     Problem: parsing of infixes
1136 :     Code: (minimal code fragment that causes bug)
1137 :     - infix orelf;
1138 :     - fun (f orelf g) x = 0;
1139 :     Error: expected EQUAL, found RPAREN
1140 :     Error: atomic expression expected
1141 :     Error: declaration or expression expected, found RPAREN
1142 :    
1143 :     - fun f orelf g = fn x => 0;
1144 :     val orelf = fn : 'a * 'b -> 'c -> int
1145 :     Comments:
1146 :     This use of an infix in a pattern seems legal and is accepted by Poly/ML.
1147 :     Status: fixed in 0.54
1148 :     ---------------------------------------------------------------------------
1149 :     64. unclosed comment is not reported
1150 :     Submitter: Duba
1151 :     Date: 12/2/88
1152 :     Version: 0.22 and later
1153 :     System: Any
1154 :     Problem: unclosed comment is not reported
1155 :     Code: (* ...
1156 :     Status: fixed in 0.54.
1157 :     ---------------------------------------------------------------------------
1158 :     65. arrayoflist should have weak type.
1159 :     Submitter: Nick
1160 :     Date: 11/24/88
1161 :     Version: 0.24
1162 :     Status: fixed in 0.33
1163 :     ---------------------------------------------------------------------------
1164 :     66. floor(~3.9) gives ~5.
1165 :     Submitter: Nick
1166 :     Date: 11/24/88
1167 :     Version: 0.24
1168 :     System: Sun 3
1169 :     Status: fixed in 0.33
1170 :     ---------------------------------------------------------------------------
1171 :     67. won't parse "fn {x: ty} => x".
1172 :     Submitter: Nick
1173 :     Date: 11/24/88
1174 :     Version: 0.24
1175 :     System: Sun 3
1176 :     Status: fixed in 0.33
1177 :     ---------------------------------------------------------------------------
1178 :     68. spurious error message -- doesn't match sig spec
1179 :     Submitter: Nick
1180 :     Date: 11/24/88
1181 :     Version: 0.24
1182 :     System: Sun 3
1183 :     Code:
1184 :     - structure S: sig val x: int end = struct val x = hd "s" end;
1185 :     Error: operator and operand don't agree (tycon mismatch)
1186 :     operator domain: 'S list
1187 :     operand: string
1188 :     in expression:
1189 :     hd "s"
1190 :     Error: value type in structure doesn't match signature spec
1191 :     name: x
1192 :     spec: int
1193 :     actual: error
1194 :     Status: fixed in 0.54
1195 :     ---------------------------------------------------------------------------
1196 :     69. printing of exn spec in inferred signature
1197 :     Submitter: Nick
1198 :     Date: 11/24/88
1199 :     Version: 0.24
1200 :     System: Sun 3
1201 :     Code:
1202 :     - structure Blah = struct exception BLAH end;
1203 :     structure Blah :
1204 :     sig
1205 :     exception BLAH of exn (* "of exn" should not appear *)
1206 :     end
1207 :     Status: fixed in 0.54
1208 :     ---------------------------------------------------------------------------
1209 :     70. constructor shouldn't appear in printed structure signature
1210 :     Submitter: Nick
1211 :     Date: 11/24/88
1212 :     Version: 0.24
1213 :     System: Sun 3
1214 :     Code:
1215 :     signature SIG =
1216 :     sig
1217 :     type t
1218 :     end
1219 :    
1220 :     structure S:SIG =
1221 :     struct
1222 :     datatype t = foo of int
1223 :     val x = 3
1224 :     end
1225 :     Messages:
1226 :     structure S :
1227 :     sig
1228 :     datatype t
1229 :     con foo : int -> t (* shouldn't be printed *)
1230 :     end
1231 :     Comment: constructor foo is not accessible as component of S
1232 :     Also, from Dave Berry (2/2/89):
1233 :     NJ ML prints the constructors of a datatype when that datatype is
1234 :     matched against a "type" in a signature, even if the signature
1235 :     doesn't include the constructors.
1236 :    
1237 :     This seems a trivial point (except that it's confusing for the novices on
1238 :     the course we teach). However, with some complicated programs the compiler
1239 :     bombs out, raising the subscript exception. You are left in the ML system,
1240 :     but it won't compile your code.
1241 :    
1242 :     I don't have a small example of this. It first hit me preparing
1243 :     examples for the aforementioned course, and it's just hit me again.
1244 :     Status: fixed in 0.56
1245 :     ---------------------------------------------------------------------------
1246 :     71. Failure to restore enviroment after exception in "use"
1247 :     Submitter: Nick
1248 :     Date: 11/24/88
1249 :     Version: 0.24
1250 :     System: Sun 3
1251 :     Code:
1252 :     For a file "y.sml" containing "val y = 4";
1253 :    
1254 :     - val x = (use "y.sml";
1255 :     let exception X in raise X end
1256 :     );
1257 :     [opening y.sml]
1258 :     val y = 4 : int
1259 :     [closing y.sml]
1260 :     uncaught exception X
1261 :     - (* so far so good... *)
1262 :     - x;
1263 :     uncaught exception Runbind
1264 :     Comment: needs to be a protect around use to trap exceptions and restore env
1265 :     Status: fixed in 0.54
1266 :     ---------------------------------------------------------------------------
1267 :     72. equality types with abstype declarations
1268 :     Submitter: kevin
1269 :     Date: 11/30/88
1270 :     Version: 0.24?
1271 :     System: Sun 3
1272 :     Code:
1273 :     (* The following definition is accepted by the compiler, resulting in
1274 :     the declaration test: ''a foo -> bool *)
1275 :    
1276 :     abstype 'a foo = Foo of 'a list
1277 :     with fun test(Foo x) = (x = []) end;
1278 :    
1279 :     (* The next declaration fails with the error
1280 :     Error: operator and operand don't agree (equality type required)
1281 :     operator domain: ''S * ''S
1282 :     operand: 'T foo * 'U foo
1283 :     in expression:
1284 :     x = Foo nil *)
1285 :    
1286 :     abstype 'a foo = Foo of 'a list
1287 :     with fun test(x as Foo _) = (x = Foo []) end;
1288 :    
1289 :     (* I'm not sure why one should be allowed and not the other - the old
1290 :     Edinburgh compiler accepted both. *)
1291 :     Status: fixed in 0.54
1292 :     ---------------------------------------------------------------------------
1293 :     73. strange function definition
1294 :     Submitter: Trevor
1295 :     Date: 12/10/88
1296 :     Version: 0.24?
1297 :     System: vax
1298 :     Problem:
1299 :     Code:
1300 :     - fun add-a x = x+1;
1301 :     val a = fn : int -> int
1302 :     - a 3;
1303 :     val it = 4 : int
1304 :     Comments:
1305 :     The intent was to have a hyphen in a function name
1306 :     (something like "fun add_a ...".
1307 :     Status: fixed in 0.54
1308 :     ---------------------------------------------------------------------------
1309 :     74. withtype with identity type definition (printing only?)
1310 :     Submitter: Nick
1311 :     Date: 12/15/88
1312 :     Version: 0.22
1313 :     Code:
1314 :     - datatype Foo = FOO of Forest
1315 :     = withtype Forest = Tree list
1316 :     = and Tree = Foo;
1317 :     datatype Foo
1318 :     con FOO : Forest -> Foo
1319 :     type Forest = Tree list
1320 :     type Tree = Tree <-= Huh?
1321 :     Comments: probably an artifact of printing from symbol table, not abstract syntax
1322 :     Status: fixed in 0.54
1323 :     ---------------------------------------------------------------------------
1324 :     75. improper type variable causes Substring exception
1325 :     Submitter: John Reppy
1326 :     Date: 12/17/89
1327 :     Version: 0.24
1328 :     System: Sun 3
1329 :     Code:
1330 :     - (nil : ' list);
1331 :     uncaught exception Substring
1332 :     Status: fixed in 0.56
1333 :     ---------------------------------------------------------------------------
1334 :     76. parenthesized infix expression in fun lhs
1335 :     Submitter: Dave Berry
1336 :     Date: 12/22/88
1337 :     Version: 0.24?
1338 :     Code:
1339 :     infix o;
1340 :     fun (f o g) x = f (g x);
1341 :     Comments: This is correct according to the Definition (according to Berry)
1342 :     Status: fixed in 0.54
1343 :     ---------------------------------------------------------------------------
1344 :     77. unparenthesized infix expressions in fun lhs
1345 :     Submitter: Dave Berry
1346 :     Date: 12/22/88
1347 :     Version: 0.24?
1348 :     Code:
1349 :     infix 4 %;
1350 :     infix 3 %%;
1351 :    
1352 :     datatype foo = op % of int * int;
1353 :     fun a % b %% c % d = 0;
1354 :    
1355 :     NJ ML accepts this, as does Edinburgh ML. It is incorrect; brackets
1356 :     are required as follows:
1357 :    
1358 :     fun (a % b) %% (c % d) = 0;
1359 :    
1360 :     This is defined on page 68 of the definition. The lhs and rhs of the
1361 :     infixed operator being defined are required to be atomic patterns.
1362 :     Status: fixed in 0.54
1363 :     ---------------------------------------------------------------------------
1364 :     78. bad signature allowed
1365 :     Submitter: Nick
1366 :     Date: 1/20/89
1367 :     Version: 0.24
1368 :     Code:
1369 :     signature FRED =
1370 :     sig
1371 :     type Fred
1372 :     val x: 'a Fred
1373 :     end
1374 :     Comments: This should be caught as an ill-formed signature
1375 :     Status: fixed in 0.39
1376 :     ---------------------------------------------------------------------------
1377 :     79. withtype
1378 :     Submitter: Simon (from abstract hardware) via Mike Fourman
1379 :     Date: 1/31/88
1380 :     Version: 0.24
1381 :     Problem:
1382 :     "Did you know that the following is not valid ML?
1383 :    
1384 :     datatype type1 = T of type2 * type3
1385 :     withtype type2 = int (* this could be a large expression *)
1386 :     and type3 = type2 * string;
1387 :    
1388 :     The reason is that the "datatype datbind withtype typbind" construct is
1389 :     expanded out into "datatype datbind'; type typbind" where "datbind'" is
1390 :     the the result of using "typbind" to expand "datbind". Note that this
1391 :     construct does *not* expand "typbind" itself, so "type2" is out of scope
1392 :     in its occurrence in "type3". This simultaneous definition property of
1393 :     "withtype" is quite annoying, especially as there is no way to get the
1394 :     effect of sequential definition (other than manually expanding out the
1395 :     body of "type3" - but that is precisely the problem that "withtype" is
1396 :     supposed to solve)."
1397 :    
1398 :     Code:
1399 :     -
1400 :     datatype type1 = T of type2 * type3
1401 :     withtype type2 = int (* this could be a large expression *)
1402 :     and type3 = type2 * string;
1403 :    
1404 :    
1405 :     - = = Error: Compiler bug: defineEqTycon/eqtyc 1
1406 :     -
1407 :     datatype type1 = T of type2 * type3
1408 :     withtype type3 = type2 * string
1409 :     withtype type2 = int (* this could be a large expression *);
1410 :    
1411 :    
1412 :     - = = Error: unbound type constructor (in datatype): type2
1413 :     Error: unbound type constructor (in datatype): type2
1414 :     Error: Compiler bug: defineEqTycon/eqtyc 1
1415 :     -
1416 :     Comment: withtype should have sequential bindings, not simultaneous
1417 :     Status: fixed in 0.54
1418 :     ---------------------------------------------------------------------------
1419 :     80. simultaneous type declarations
1420 :     Submitter: Dave Berry
1421 :     Date: 2/1/89
1422 :     Version: 0.24
1423 :     Code:
1424 :     - type type2 = int
1425 :     = and type3 = type2 * string;
1426 :     type type2 = int
1427 :     type type3 = type2 * string
1428 :     Comments:
1429 :     This is wrong: type2 shouldn't be bound before the declaration of type3.
1430 :     Status: fixed in 0.54
1431 :     ---------------------------------------------------------------------------
1432 :     81. repeated specs in signatures
1433 :     Submitter: John Reppy
1434 :     Date: 2/12/89
1435 :     Version: 0.24
1436 :     Problem:
1437 :     I noticed that a signature of the form
1438 :    
1439 :     sig
1440 :     val x : int
1441 :     val x : string
1442 :     end
1443 :    
1444 :     is acceptable. Although this is in keeping with redeclaration in other
1445 :     scopes, it isn't very useful, and lets detectable errors get by. I would
1446 :     suggest that redeclaration of identifiers in signatures ought to at least
1447 :     generate a warning message (if not an error).
1448 :     Status: same as #4
1449 :     ---------------------------------------------------------------------------
1450 :     82. compiler bug caused by type in datatype declaration
1451 :     Submitter: Andrew
1452 :     Date: 2/20/89
1453 :     Version: 0.28?
1454 :     Code:
1455 :     datatype a = A of int;
1456 :     datatype b = B of A; (* typo for B of a *)
1457 :     Messages:
1458 :     Error: unbound type constructor (in datatype): A
1459 :     Error: Compiler bug: defineEqTycon/eqtyc 1.
1460 :     Status: fixed in 0.39
1461 :     ---------------------------------------------------------------------------
1462 :     83. unexpected parsing of erroneous datatype declaration
1463 :     Submitter: Carl Gunter
1464 :     Date: 2/24/88
1465 :     Version: 0.20
1466 :     Code:
1467 :     - datatype complex = Complex (real,real);
1468 :     datatype complex
1469 :     con Complex : complex
1470 :     val it = (fn,fn) : (int -> real) * (int -> real)
1471 :     Comments:
1472 :     implicit "val it = " inserted after constructor Complex breaks the
1473 :     declaration into a valid datatype declaration and a top-level value
1474 :     expression (implicit value declaration). This could probably be
1475 :     detected and suppressed.
1476 :     Status: fixed in 0.54
1477 :     ---------------------------------------------------------------------------
1478 :     84. definition of open_out and open_append
1479 :     Submitter: Nick
1480 :     Date: 2/28/89
1481 :     Version: 0.29
1482 :     Problem:
1483 :     the following code from perv.sml is faulty:
1484 :    
1485 :     val open_out = open_o WRITE
1486 :     handle Assembly.SystemCall s =>
1487 :     raise Io("open_out: " ^ s)
1488 :     val open_append = open_o APPEND
1489 :     handle Assembly.SystemCall s =>
1490 :     raise Io("open_append: " ^ s)
1491 :    
1492 :     Another lambda-abstraction is needed to catch errors on the application
1493 :     of open_o, rather than these bindings.
1494 :     Status: fixed in 0.33
1495 :     ---------------------------------------------------------------------------
1496 :     85. bad error message for failed signature match
1497 :     Submitter: John Reppy
1498 :     Date: 3/6/89
1499 :     Version: 0.28
1500 :     Code:
1501 :     structure Foo : sig
1502 :     type foo
1503 :     val f : foo -> int
1504 :     end = struct
1505 :     type Foo = int
1506 :     fun f x = x
1507 :     end;
1508 :     Messages:
1509 :     Error: unmatched type spec: foo
1510 :     tycStamp: INDtyc []
1511 :     Error: Compiler bug: tycStamp
1512 :     Status: fixed in 0.54
1513 :     ---------------------------------------------------------------------------
1514 :     86. incorrectly allows redefining of "="
1515 :     Submitter: Dave Berry
1516 :     Date: 3/15/89
1517 :     Version: 0.29
1518 :     Problem:
1519 :     NJML handles the = symbol incorrectly in some cases.
1520 :    
1521 :     - val op = = op = ;
1522 :     - nonfix =;
1523 :     - = (true, true);
1524 :     Error: declaration or expression expected, found EQUAL
1525 :     Comment:
1526 :     The = symbol may not be redefined (Definition, page 4). The top definition
1527 :     does seem to redefine =, despite the lack of response from the system.
1528 :     I can't see anything in the Definition that forbids making = nonfix,
1529 :     so I suppose it should be possible to use it in a nonfix way.
1530 :     Status: fixed by 0.69 (rebinding = gives a warning message; parses better)
1531 :     ---------------------------------------------------------------------------
1532 :     87. execute subprocess dies on interrupt on blocked input
1533 :     Submitter: dbm
1534 :     Date: 3/19/89
1535 :     Version: 0.31
1536 :     System: Sun3/100, SunOS 4.0.1; VAX8550, V9
1537 :     Problem: interrupting blocked call of input from execute subprocess
1538 :     kills subprocesss
1539 :     Code:
1540 :     val (ins,outs) = execute "cat"
1541 :     input ins 5;
1542 :     ^Cuncaught exception Interrupt
1543 :     Messages:
1544 :     After interrupt, System.system("ps x"), indicates that "cat"
1545 :     subprocess has disappeared, and subsequent attempt to flush output
1546 :     to outs raises exeption Io("output: write failed").
1547 :     Comments:
1548 :     end_of_stream also blocks, and interrupting a call of end_of_stream
1549 :     seems to have the same effect.
1550 :    
1551 :     jhr: This isn't a bug, but rather a "feature." The sub-process inherits
1552 :     the control terminal (/dev/tty) from its parent. This means that the
1553 :     SIGINT generated by ^C is passed to both processes. I assume that
1554 :     there is a work-around, but the semantics are correct for Unix.
1555 :     Status: not a bug
1556 :     ---------------------------------------------------------------------------
1557 :     88. subscript exception while printing type
1558 :     Submitter:
1559 :     Thorsten Altenkirch
1560 :     Technische Universitaet Berlin
1561 :     alti%theo@tub.BITNET
1562 :     Date: Fri Mar 31 18:42:20 MET DST 1989
1563 :     Version: 0.24
1564 :     System: SunOS Release 4.0_Export
1565 :     Problem: "uncaught exception Subscript" while printing type.
1566 :     Code:
1567 :     signature A = sig type t end;
1568 :     functor F1(a:A) = struct
1569 :     datatype t2 = f of a.t
1570 :     end;
1571 :     functor F2(a:A) = struct
1572 :     structure S = F1(a);
1573 :     open S
1574 :     end;
1575 :     structure SA = struct type t = int end;
1576 :     structure F2SA = F2(SA);
1577 :     Messages:
1578 :     ..
1579 :     structure F2SA :
1580 :     sig
1581 :     structure S : sig...end
1582 :     datatype t2
1583 :     con f : [closing /tmp/sml.tmp.l10641]
1584 :     uncaught exception Subscript
1585 :     Comments:
1586 :     The error may be caused by the handling of indirect types
1587 :     in src/basics/printtype.sml (printPath).
1588 :     Status: fixed in 0.39
1589 :     ---------------------------------------------------------------------------
1590 :     89. continuation line string escape at beginning of string
1591 :     Submitter: dbm
1592 :     Date: 4/3/89
1593 :     Version: 0.33
1594 :     System: Sun 3, SunOS 4.0.1
1595 :     Code:
1596 :     - "\ (* CR after \ at beginning of string *)
1597 :     - akdk";
1598 :     Error: unclosed string
1599 :     = (* second CR typed *)
1600 :     Error: unclosed string
1601 :     Error: unbound variable kdk
1602 :     = ;
1603 :     Error: operator is not a function
1604 :     operator: string
1605 :     in expression:
1606 :     "" kdk
1607 :     Status: fixed in 0.49.
1608 :     ---------------------------------------------------------------------------
1609 :     90. secondary prompt is not set in multi-line strings and comments.
1610 :     Submitter: dbm and duba
1611 :     Date: 4/3/89
1612 :     Version: 0.33
1613 :     System: All
1614 :     Status: fixed in 0.49
1615 :     ---------------------------------------------------------------------------
1616 :     91. misparsing of fun lhs
1617 :     Submitter: dbm and duba
1618 :     Date: 4/3/89
1619 :     Version: 0.33
1620 :     System: All
1621 :     Code:
1622 :     - fun a+b (x) = a;
1623 :     Error: Compiler bug: generalizeTy -- bad arg
1624 :     b : 'S -> undef
1625 :     Status: fixed in 0.54
1626 :     ---------------------------------------------------------------------------
1627 :     92. uncaught Nth exception after type constructor arity mismatch in sigmatch
1628 :     Submitter: David Tarditi, Princeton University, drt@notecnirp.princeton.edu
1629 :     Date: 6/23/89
1630 :     Version: 0.33
1631 :     System: Vax/4.3 BSD
1632 :     Problem: Mismatching arities on types causes uncaught exception Nth
1633 :     later in signature checking.
1634 :    
1635 :     Example:
1636 :    
1637 :     functor OrdSet(B : sig
1638 :     type elem
1639 :     val gt : elem * elem -> bool
1640 :     val eq : elem * elem -> bool
1641 :     end) =
1642 :     struct
1643 :     end
1644 :    
1645 :     structure Bad =
1646 :     struct
1647 :     type 'a elem = int * 'a
1648 :     val gt = fn ((a:int,_),(b,_)) => a > b
1649 :     val eq = fn ((a:int,_),(b,_)) => a = b
1650 :     end
1651 :    
1652 :     structure X = OrdSet(Bad)
1653 :    
1654 :     Result:
1655 :    
1656 :     Standard ML of New Jersey, Version 0.33, 1 April 1989
1657 :     val it = () : unit
1658 :     std_in, line 18: Error: mismatching tycon arities: elem
1659 :     uncaught exception Nth
1660 :    
1661 :     Comments:
1662 :    
1663 :     The uncaught exception Nth appears to occur while matching the actual types
1664 :     of eq and gt against the types in the signature of the formal
1665 :     structure parameter.
1666 :    
1667 :     Status: fixed in 0.56
1668 :     ---------------------------------------------------------------------------
1669 :     93. type propagation failure with functor application
1670 :     Submitter: David Tarditi, Princeton University, drt@notecnirp
1671 :     Date: 7/25/89
1672 :     Version: 0.33
1673 :     System: Vax/4.3 BSD
1674 :     Problem: Type in a structure passed to a functor remains an opaque
1675 :     type outside the functor.
1676 :    
1677 :     Example code:
1678 :    
1679 :     signature T =
1680 :     sig type 'pos token
1681 :     end
1682 :    
1683 :     signature L =
1684 :     sig structure T : T
1685 :     end
1686 :    
1687 :     functor P(structure L : L) =
1688 :     struct
1689 :     open L
1690 :     end
1691 :    
1692 :     structure L =
1693 :     struct
1694 :     structure T = struct
1695 :     type 'a token = int * 'a * 'a
1696 :     end
1697 :     end
1698 :    
1699 :     structure B = P(structure L = L)
1700 :    
1701 :     val x = (5,"","")
1702 :     val _ = x : string L.T.token (* this works *)
1703 :     val _ = x : string B.T.token (* this causes a type error - why ? *)
1704 :    
1705 :     Comments:
1706 :    
1707 :     I thought that the type token should be an abstract (opaque) type only
1708 :     inside the functor P. It should be non-opaque in the structure created by
1709 :     applying the functor P.
1710 :    
1711 :     Status: fixed in 0.37
1712 :     ---------------------------------------------------------------------------
1713 :     94. uncaught Bind exception parsing functor body
1714 :     Submitter: David Tarditi, Princeton University, drt@notecnirp
1715 :     Date: 7/25/89
1716 :     Version: 0.33
1717 :     System: Vax/4.3 BSD
1718 :     Problem: The compiler failed by raising a Bind exception
1719 :     which was not caught.
1720 :    
1721 :     Example code:
1722 :    
1723 :     functor mkDummy () : sig end =
1724 :     struct
1725 :     end
1726 :    
1727 :     functor mkLalr () =
1728 :     struct
1729 :     datatype lcore = LCORE of int
1730 :     end
1731 :    
1732 :     functor mkTable () =
1733 :     struct
1734 :     structure Dummy = mkDummy()
1735 :     structure Lalr = mkLalr()
1736 :     val x = fn (Lalr.LCORE l) => l
1737 :     end
1738 :    
1739 :     Comment:
1740 :     It seems that the compiler fails while compiling an access to a data
1741 :     constructor inside a functor. The data constructor must have the
1742 :     special characteristic that it is created by applying another functor
1743 :     inside the functor being compiled:
1744 :    
1745 :     Status: fixed in 0.37 (0 should have been 1 in envaccess.sml *)
1746 :     ---------------------------------------------------------------------------
1747 :     95. infix declaration interferes with type parsing
1748 :     Submitter: David Tarditi, Princeton University, drt@notecnirp
1749 :     Date: 4/30/89
1750 :     Version: 0.33
1751 :     System: Vax/4.3 BSD
1752 :     Problem: Spurious declaration of infix for an identifier causes problems
1753 :     when it is used as a type constructor later.
1754 :    
1755 :     Sample Run:
1756 :    
1757 :     Standard ML of New Jersey, Version 0.33, 1 April 1989
1758 :     val it = () : unit
1759 :     - type ('a,'b) --> = 'a -> 'b;
1760 :     type ('a,'b) --> = 'a -> 'b
1761 :    
1762 :     - val a = fn _ => 5;
1763 :     val a = fn : 'a -> int
1764 :    
1765 :     - a : ('a,int) -->;
1766 :     val it = fn : 'a -> int
1767 :    
1768 :     - infix -->;
1769 :    
1770 :     - a : ('a,int) -->;
1771 :     Error: (user) bound type variable propagated out of scope
1772 :     it : 'aU -> int
1773 :    
1774 :     Comments:
1775 :     The declaration of an identifier to be infix should not
1776 :     affect type constructors. Infix declarations apply only to data
1777 :     constructors and value identifiers. The declaration of '-->' to
1778 :     be infix should not affect the use of '-->' as a type constructor,
1779 :     even though the declaration is spurious.
1780 :    
1781 :     P.S.
1782 :     Maybe there should be a way to declare type identifiers to be
1783 :     infix. I was trying to declare '-->' to be infix because I was creating
1784 :     different kinds of arrows for my effects inference. --> could denote
1785 :     a function that is pure, while -*-> could denote a function with an
1786 :     effect. I need to do this to bootstrap the pervasive environment
1787 :     without assuming that all built-in functions have side-effects.
1788 :    
1789 :     Status: fixed in 0.54
1790 :     ---------------------------------------------------------------------------
1791 :     96. uncaught exception Unbound parsing signature
1792 :     Submitter: Martin Wirsing
1793 :     Date: 7/18/89
1794 :     Version: 0.33
1795 :     System: VAX/V9
1796 :     Description: uncaught exception Unbound while parsing a signature
1797 :     Code
1798 :     signature Sigtest =
1799 :     sig
1800 :     structure S:
1801 :     sig
1802 :     type t1
1803 :     val x:t1->t1
1804 :     end
1805 :     structure R:
1806 :     sig
1807 :     type t2
1808 :     val x:t2->t2
1809 :     end
1810 :     type t
1811 :     val f:t1->R.t2
1812 :     end
1813 :     = = = = = = = = = = = = = uncaught exception Unbound
1814 :     - Error: declaration or expression expected, found END
1815 :    
1816 :     Status: fixed in 0.39
1817 :     ---------------------------------------------------------------------------
1818 :     97. Type checking
1819 :     Submitter: Mads Tofte
1820 :     Date: 6/30/89
1821 :     Version: 0.33
1822 :     Description:
1823 :     Here is a program which, although type correct, does not type check
1824 :     on the NJ compiler --- one gets a type error in the last line.
1825 :     It does type check on Poly ML.
1826 :     The problem disappears is one erases the explicit result signature
1827 :     on SymTblFct and it seems that the problem is that sharing is
1828 :     not propagated correctly in functor application when the signature
1829 :     has an explicit result signature.
1830 :     When the internal type stamps are printed, one sees that
1831 :     the types of the second and the third arguments are ``abstract''
1832 :     and not instantiated to the stamps for string and real, respectively.
1833 :    
1834 :     Code:
1835 :     signature IntMapSig=
1836 :     sig
1837 :     type 'a map
1838 :     exception NotFound
1839 :     val apply: 'a map * int -> 'a
1840 :     val update: 'a map * int * 'a -> 'a map
1841 :     val emptyMap: 'a map
1842 :     end;
1843 :    
1844 :     signature ValSig =
1845 :     sig
1846 :     type value
1847 :     end;
1848 :    
1849 :     signature SymSig=
1850 :     sig
1851 :     eqtype sym
1852 :     val hash: sym -> int
1853 :     end;
1854 :    
1855 :    
1856 :     functor SymTblFct(
1857 :     structure IntMap: IntMapSig
1858 :     structure Val: ValSig
1859 :     structure Sym: SymSig):
1860 :    
1861 :     sig
1862 :     type table
1863 :     exception Lookup
1864 :     val emptyTable: table
1865 :     val update: table * Sym.sym * Val.value -> table
1866 :     end=
1867 :    
1868 :     struct
1869 :     datatype table = TBL of
1870 :     (Sym.sym * Val.value)list IntMap.map
1871 :     val emptyTable = TBL IntMap.emptyMap;
1872 :    
1873 :     exception Lookup
1874 :    
1875 :     fun update(TBL map,s,v)=
1876 :     let val n = Sym.hash(s)
1877 :     val l = IntMap.apply(map,n) handle IntMap.NotFound => []
1878 :     val newmap= IntMap.update(map,n,(s,v)::l)
1879 :     in TBL newmap
1880 :     end
1881 :    
1882 :     end;
1883 :    
1884 :     functor FastIntMap(): IntMapSig=
1885 :     struct (* dummy implementation of int maps *)
1886 :     datatype 'a map = N of int * 'a * 'a map * 'a map
1887 :     | EMPTY
1888 :     val emptyMap = EMPTY
1889 :     exception NotFound
1890 :     fun apply _ = raise NotFound;
1891 :     fun update _ = raise NotFound;
1892 :     end;
1893 :    
1894 :     functor ValFct(): ValSig=
1895 :     struct
1896 :     type value = real
1897 :     end;
1898 :    
1899 :     functor SymFct(): SymSig=
1900 :     struct
1901 :     type sym = string
1902 :     fun hash(s:sym)= ord s
1903 :     end;
1904 :    
1905 :     structure MyTbl=
1906 :     SymTblFct(structure IntMap = FastIntMap()
1907 :     structure Val = ValFct()
1908 :     structure Sym = SymFct()
1909 :     );
1910 :    
1911 :     open MyTbl;
1912 :    
1913 :     update(emptyTable,"ape",10.0);
1914 :    
1915 :     Comment: parameters Val and Sym appear in result signature of SymTblFct.
1916 :     This has not been supported previously.
1917 :    
1918 :     Status: fixed in 0.37
1919 :     ---------------------------------------------------------------------------
1920 :     98. eqtype determination
1921 :     Submitter: Carl Gunter (gunter@linc.cis.upenn.edu) [Jakov Kucan]
1922 :     Date: 7/18/89
1923 :     Version: 0.33
1924 :     Problem: compiler bug: defineEqTycon/eqtyc 1
1925 :     Code:
1926 :    
1927 :     datatype constant_type = CONSTANT;
1928 :    
1929 :     datatype composed_type = Constructor of int * CONSTANT;
1930 :    
1931 :     Messages:
1932 :    
1933 :     Standard ML of New Jersey, Version 0.20, 13 June 1988
1934 :     val it = () : unit
1935 :     - use "bug.ml";
1936 :     [opening bug.ml]
1937 :     datatype constant_type
1938 :     con CONSTANT : constant_type
1939 :     bug.ml, line 7: Error: unbound type constructor (in datatype): CONSTANT
1940 :     bug.ml, line 7: Error: Compiler bug: defineEqTycon/eqtyc 1
1941 :    
1942 :     Status: fixed in 0.37
1943 :     ---------------------------------------------------------------------------
1944 :     99. include bug
1945 :     Submitter: Nick Rothwell
1946 :     Date: 7/19/89
1947 :     Version: 0.33
1948 :     Problem: include doesn't work
1949 :     Code:
1950 :     signature A = sig end
1951 :     signature B = sig include A end;
1952 :     Messages:
1953 :     Error: Compiler bug: SigMatch.setParent
1954 :     Status: fixed in 0.39
1955 :     ---------------------------------------------------------------------------
1956 :     100. constructor not printed after open declaration
1957 :     Submitter: Nick Rothwell
1958 :     Date: 7/18/89
1959 :     Version: 0.33
1960 :     Problem:
1961 :     In this case, a datatype is being printed as a type: the constructor isn't
1962 :     shown (although it's still bound):
1963 :     Code:
1964 :    
1965 :     - signature X = sig datatype T = T end;
1966 :     signature X =
1967 :     sig
1968 :     datatype T
1969 :     con T : T
1970 :     end
1971 :    
1972 :     - structure X: X = struct datatype T = T end;
1973 :     structure X :
1974 :     sig
1975 :     datatype T
1976 :     con T : T
1977 :     end
1978 :    
1979 :     - open X;
1980 :     type T = T
1981 :    
1982 :     Status: fixed in 0.49
1983 :     ---------------------------------------------------------------------------
1984 :     101. Duplicate labels (in either types or values) are not detected
1985 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
1986 :     Date: 7/28
1987 :     Version: 0.33
1988 :     Code:
1989 :     - {x=1,x=true} : {x:int,x:bool};
1990 :     val it = {x=1,x=true} : {x:int,x:bool}
1991 :     Status: fixed in 0.54
1992 :     ---------------------------------------------------------------------------
1993 :     102. One-tuples are not printed sensibly.
1994 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
1995 :     Date: 7/28
1996 :     Version: 0.33
1997 :     Code:
1998 :     - (* a one-tuple *) {1 = 999};
1999 :     val it = (999) : int
2000 :     - it = 999;
2001 :     Messages:
2002 :     Error: operator and operand don't agree (tycon mismatch)
2003 :     operator domain: (int) * (int)
2004 :     operand: (int) * int
2005 :     in expression:
2006 :     it = 999
2007 :     Status: fixed in 0.54
2008 :     ---------------------------------------------------------------------------
2009 :     103. Space missing in an error message (which might be more informative).
2010 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2011 :     Date: 7/28
2012 :     Version: 0.33
2013 :     Code:
2014 :     - {999};
2015 :     Messages:
2016 :     Error: numeric label abbreviation999
2017 :     Status: fixed in 0.54
2018 :     ---------------------------------------------------------------------------
2019 :     104. Labels with leading zeroes should not be accepted (this is made
2020 :     explicit on page 5 of version 3 of the Standard).
2021 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2022 :     Date: 7/28
2023 :     Version: 0.33
2024 :     Code:
2025 :     - {0000002 = 999};
2026 :     val it = {2=999} : {2:int}
2027 :     Status: fixed in 0.54
2028 :     ---------------------------------------------------------------------------
2029 :     105. Large numeric labels are disallowed.
2030 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2031 :     Date: 7/28
2032 :     Version: 0.33
2033 :     Code:
2034 :     - {9999999999999999999999 = 999};
2035 :     Messages:
2036 :     Error: integer too large
2037 :     Error: nonpositive integer label, found 0
2038 :     Status: not important
2039 :     ---------------------------------------------------------------------------
2040 :     106. Something strange is happening with "it".
2041 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2042 :     Date: 7/28
2043 :     Version: 0.33
2044 :     Code:
2045 :     Standard ML of New Jersey, Version 0.33, 1 April 1989
2046 :     val it = () : unit
2047 :     - raise it;
2048 :     Error: argument of raise is not an exception
2049 :     raised: unit
2050 :     in expression:
2051 :     raise it
2052 :     - raise it;
2053 :     Error: argument of raise is not an exception
2054 :     raised: unit
2055 :     in expression:
2056 :     raise it
2057 :     - raise it;
2058 :     uncaught exception Runbind
2059 :     - raise it;
2060 :     uncaught exception Runbind
2061 :     -
2062 :     Comment:
2063 :     The problem of an exception leaving the system in an uncertain
2064 :     state seems to occur in other contexts too.
2065 :     Status: fixed in 0.54
2066 :     ---------------------------------------------------------------------------
2067 :     107. NJML disappears into an infinite loop when trying to parse large real numbers;
2068 :     presumably some error recovery code is flakey.
2069 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2070 :     Date: 7/28
2071 :     Version: 0.33
2072 :     Code:
2073 :     - 1.0E308;
2074 :     val it = 1.0E308 : real
2075 :     - 1.0E309;
2076 :     Error: Real constant out of range
2077 :     - 2.0E308; (* wait a long time ... *)
2078 :     val it = uncaught exception Interrupt
2079 :     -
2080 :     Comment:
2081 :     Furthermore, a failing program elaboration or evaluation (such as the above)
2082 :     should not rebind the variable "it" (ML Standard v3, rules 194 and 195).
2083 :     NJML sometimes does (as above).
2084 :    
2085 :     Furthermore, trying to print "it" when it has been bound to such an
2086 :     exception sometimes seems to crash the system (it refuses to respond to
2087 :     further input); at other times the exception Runbind is raised.
2088 :    
2089 :     Does anyone know why the largest integer NJML will parse is 1073741775 ?
2090 :     This is 2^30 - 49, which seems a funny number to choose. (Mike Crawley
2091 :     suggests the fact that 49 is the ASCII code for "1" may be significant.)
2092 :    
2093 :     Status: fixed in 0.56
2094 :     ---------------------------------------------------------------------------
2095 :     108. More faulty error recovery?
2096 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2097 :     Date: 7/28
2098 :     Version: 0.33
2099 :     Code:
2100 :     -
2101 :     (* calculates ~ 2^30 *) ~1073741775 - 49;
2102 :    
2103 :     [Increasing heap to 4096k]
2104 :    
2105 :     [Major collection... 99% used (973164/976372), 8020 msec]
2106 :    
2107 :     [Increasing heap to 7568k]
2108 :     val it = uncaught exception Interrupt
2109 :     -
2110 :     Status: fixed in 0.56
2111 :     ---------------------------------------------------------------------------
2112 :     109. sharing of datatypes not handled properly
2113 :     Submitter: Simon Finn (simon%abstract-hardware-ltd.co.uk@nsfnet-relay.ac.uk)
2114 :     Date: 7/28
2115 :     Version: 0.33
2116 :     Code:
2117 :     signature EQSIG =
2118 :     sig
2119 :     type r
2120 :     datatype s = S of r
2121 :     and t = T of s
2122 :     sharing type r = t
2123 :     end;
2124 :    
2125 :     functor F(X : EQSIG) =
2126 :     struct
2127 :     fun test(x : X.t) = (x = x);
2128 :     end;
2129 :     Messages:
2130 :    
2131 :     signature EQSIG =
2132 :     sig
2133 :     type r
2134 :     datatype s
2135 :     con S : r -> s
2136 :     datatype t
2137 :     con T : s -> t
2138 :     end
2139 :     Error: operator and operand don't agree (equality type required)
2140 :     operator domain: ''S * ''S
2141 :     operand: ?.t * ?.t
2142 :     in expression:
2143 :     x = x
2144 :     Error: Compiler bug: abstractType
2145 :    
2146 :     Comment:
2147 :     Both are wrong, as the signature EQSIG elaborates to the same semantic object
2148 :     as the following (which both treat correctly):
2149 :    
2150 :     signature EQSIG =
2151 :     sig
2152 :     type r
2153 :     datatype s = S of t
2154 :     and t = T of s
2155 :     sharing type r = t
2156 :     end;
2157 :    
2158 :     Status: fixed in 0.54
2159 :     ---------------------------------------------------------------------------
2160 :     110. val rec
2161 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2162 :     Date: 7/18/89
2163 :     Version: 0.33
2164 :     System: Sun3/SunOS 4.0
2165 :     Problem: val rec form of definition rejected
2166 :     Code:
2167 :    
2168 :     - val x = 1 and rec y = fn z => z; (* should compile *)
2169 :     Error: expected an atomic pattern, found REC
2170 :     Error: expected EQUAL, found REC
2171 :     Error: atomic expression expected, found REC
2172 :     Error: declaration or expression expected, found REC
2173 :    
2174 :     Comment: the compiler should accept the above declaration.
2175 :     Status: not a bug; the Definition is silly
2176 :     ---------------------------------------------------------------------------
2177 :     111. local polymorphic definitions
2178 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2179 :     Date: 7/18/89
2180 :     Version: 0.33
2181 :     System: Sun3/SunOS 4.0
2182 :     Problem: local polymorphic definitions rejected
2183 :     Code:
2184 :    
2185 :     - val q = let exception x of '_a in 1 handle x _ => 2 end;
2186 :     Error: type variable in exception type not weak enough
2187 :    
2188 :     - local exception x of '_a in val q = 1 handle x _ => 2 end;
2189 :     Error: type variable in exception type not weak enough
2190 :    
2191 :    
2192 :     Comment: the compiler should accept both the above definitions,
2193 :     which are valid, since the imperative type variable '_a
2194 :     is *not* free in the top level declaration.
2195 :     Comment: (dbm) Consider the following, which leads to insecurity:
2196 :     local exception X of '_a in val exn0 = X(3) fun h(X(b:bool)) = b end;
2197 :     raise exn0 handle e => h(e);
2198 :     Status: not a bug
2199 :     ---------------------------------------------------------------------------
2200 :     112. equality
2201 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2202 :     Date: 7/18/89
2203 :     Version: 0.33
2204 :     System: Sun3/SunOS 4.0
2205 :     Problem: equality misbehaving
2206 :     Code:
2207 :    
2208 :     (0.0 = ~0.0, 0.0 = ~ 0.0, ~0.0 = ~ 0.0); (* (true,true,true) *)
2209 :    
2210 :     infix eq; fun x eq y = x = y;
2211 :     (0.0 eq ~0.0, 0.0 eq ~ 0.0, ~0.0 eq ~ 0.0); (* (true,false,false) *)
2212 :    
2213 :     infix eq; fun (x:real) eq y = x = y;
2214 :     (0.0 eq ~0.0, 0.0 eq ~ 0.0, ~0.0 eq ~ 0.0); (* (true,true,true) *)
2215 :    
2216 :     Comment: the polymorphic equality function should give
2217 :     consistent results, even when the type of its
2218 :     argument is known to be real.
2219 :     Status: fixed in 0.49
2220 :     ---------------------------------------------------------------------------
2221 :     113. empty declarations
2222 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2223 :     Date: 7/18/89
2224 :     Version: 0.33
2225 :     System: Sun3/SunOS 4.0
2226 :     Problem: Parsing empty declarations
2227 :     Code:
2228 :    
2229 :     let val x = 1; (* empty declaration *) ; val y = 2 in x + y end;
2230 :     Error: expected IN, found SEMICOLON
2231 :     Error: atomic expression expected, found SEMICOLON
2232 :     Error: atomic expression expected, found VAL
2233 :     Error: expected END, found VAL
2234 :     Error: declaration or expression expected, found IN
2235 :    
2236 :     Comment: the above program is syntactically correct.
2237 :     Status: fixed in 0.49
2238 :     ---------------------------------------------------------------------------
2239 :     114. include broken (same as bug 99)
2240 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2241 :     Date: 7/18/89
2242 :     Version: 0.33
2243 :     System: Sun3/SunOS 4.0
2244 :     Problem: include in signatures
2245 :     Code:
2246 :    
2247 :     - signature old = sig type t end;
2248 :     signature old =
2249 :     sig
2250 :     type t
2251 :     end
2252 :    
2253 :     - signature new = sig include old end;
2254 :     Error: Compiler bug: SigMatch.setParent
2255 :    
2256 :     Status: fixed in 0.39
2257 :     ---------------------------------------------------------------------------
2258 :     115. cyclic signatures
2259 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2260 :     Date: 7/18/89
2261 :     Version: 0.33
2262 :     System: Sun3/SunOS 4.0
2263 :     Problem: cyclic signatures
2264 :     Code:
2265 :    
2266 :     (* shouldn't be allowed, since object (signature) is not cycle-free *)
2267 :     signature bad =
2268 :     sig
2269 :     structure A :
2270 :     sig
2271 :     structure B : sig end;
2272 :     end;
2273 :     sharing A = A.B;
2274 :     end;
2275 :    
2276 :     Comment: NJML accepts the above signature declaration, which should be
2277 :     rejected because it elaborates to a cyclic semantic object;
2278 :     cyclic objects are not semantically admissible.
2279 :    
2280 :     Status: not a bug? (signature will never match a structure)
2281 :     ---------------------------------------------------------------------------
2282 :     116. pattern declares no variables warning (?)
2283 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2284 :     Date: 7/18/89
2285 :     Version: 0.33
2286 :     System: Sun3/SunOS 4.0
2287 :     Problem: Missing warning message
2288 :     Code:
2289 :    
2290 :     let val _ = 1 in 2 end;
2291 :     local val _ = 1 in val it = 2 end;
2292 :    
2293 :    
2294 :     Comment: Each of the above should produce a "Pattern declares
2295 :     no variables" warning message, but neither does.
2296 :    
2297 :     Status: not a bug
2298 :     ---------------------------------------------------------------------------
2299 :     117. sharing and equality attributes
2300 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2301 :     Date: 7/18/89
2302 :     Version: 0.33
2303 :     System: Sun3/SunOS 4.0
2304 :     Problem: problems with equality attribute
2305 :     Code:
2306 :    
2307 :     (***************************************************************************)
2308 :     (* This is illegal in version 3 of the ML standard *)
2309 :     (* s may only be elaborated to a non-equality type (+ extra bits) *)
2310 :     (* t may only be elaborated to an equality type (for consistency with its *)
2311 :     (* constructor environment) *)
2312 :     (* Hence s and t can't share *)
2313 :     (***************************************************************************)
2314 :    
2315 :     signature BADSIG =
2316 :     sig
2317 :     datatype s = Dummy of bool -> bool
2318 :     datatype t = Dummy of int
2319 :     sharing type s = t;
2320 :     end;
2321 :    
2322 :     Comment: NJML accepts this signature but shouldn't. Getting the
2323 :     equality attribute right in the presence of sharing
2324 :     constraints seems to be quite a tricky problem.
2325 :    
2326 :     Status: fixed in 0.56
2327 :     ---------------------------------------------------------------------------
2328 :     118. deviation from Definition, div and mod
2329 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2330 :     Date: 7/18/89
2331 :     Version: 0.33
2332 :     System: Sun3/SunOS 4.0
2333 :     Problem: div / mod give non-standard results
2334 :     Code:
2335 :    
2336 :     fun divmod (m,n) = (m div n,m mod n);
2337 :     (* should give (1,2) *) divmod(5,3); (* gives (1,2) *)
2338 :     (* should give (~2,1) *) divmod(~5,3); (* gives (~1,~2) *)
2339 :     (* should give (~2,~1) *) divmod(5,~3); (* gives (~1,2) *)
2340 :     (* should give (1,~2) *) divmod(~5,~3); (* gives (1,~2) *)
2341 :    
2342 :     Comments: I'd like the initial dynamic basis to conform to the Standard.
2343 :     (More efficient, non-standard versions should be hidden away.)
2344 :     Status: fixed in 0.56
2345 :     ---------------------------------------------------------------------------
2346 :     119. deviation from Definition
2347 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2348 :     Date: 7/18/89
2349 :     Version: 0.33
2350 :     System: Sun3/SunOS 4.0
2351 :     Problem: I/O functions are curried, Standard has them uncurried
2352 :     Code:
2353 :    
2354 :     - input;
2355 :     val it = fn : instream -> int -> string
2356 :    
2357 :     Comments: I'd like the initial dynamic basis to conform to the Standard.
2358 :     (More efficient, non-standard versions should be hidden away.)
2359 :     Status: fixed in 0.56
2360 :     ---------------------------------------------------------------------------
2361 :     120. deviation from Definition
2362 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2363 :     Date: 7/18/89
2364 :     Version: 0.33
2365 :     System: Sun3/SunOS 4.0
2366 :     Problem: Prelude functions raise the wrong exceptions
2367 :     Code:
2368 :    
2369 :     0.0 / 0.0; (* raises Overflow *)
2370 :     1.0 / 0.0; (* raises Real *)
2371 :    
2372 :     Comments: I'd like the initial dynamic basis to conform to the Standard.
2373 :     (More efficient, non-standard versions should be hidden away.)
2374 :     This one is even trickier; Poly/ML doesn't raise any exception at all
2375 :     for these (it prints NaN.0 and Infinity.0 respectively).
2376 :     Status: fixed in 0.56, mostly
2377 :     ---------------------------------------------------------------------------
2378 :     121. Unimplemented parts of Standard
2379 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2380 :     Date: 7/18/89
2381 :     Version: 0.33
2382 :     System: Sun3/SunOS 4.0
2383 :     Problem: open in signatures apparently unsupported
2384 :     Code:
2385 :    
2386 :     - structure old = struct type t = int end;
2387 :     structure old :
2388 :     sig
2389 :     eqtype t
2390 :     end
2391 :     - signature new = sig open old end;
2392 :     Error: expected END, found OPEN
2393 :     Error: declaration or expression expected, found END
2394 :     -
2395 :     Status: This is a language design problem; see doc/localspec
2396 :     ---------------------------------------------------------------------------
2397 :     122. Unimplemented parts of Standard
2398 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2399 :     Date: 7/18/89
2400 :     Version: 0.33
2401 :     System: Sun3/SunOS 4.0
2402 :     Problem: let and local for structures apparently unsupported
2403 :     Code:
2404 :    
2405 :     - structure Y = struct local val x=1 in structure X = struct val y = 1 end end end;
2406 :     Error: expected END, found STRUCTURE
2407 :     Error: declaration or expression expected, found END
2408 :    
2409 :     - structure Y = let val x=1 in struct structure X = struct val y = 1 end end end;
2410 :     Error: expected a structure-expression, found LET
2411 :     -
2412 :     Status: fixed in 0.54
2413 :     ---------------------------------------------------------------------------
2414 :     122. Unimplemented parts of Standard
2415 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2416 :     Date: 7/18/89
2417 :     Version: 0.33
2418 :     System: Sun3/SunOS 4.0
2419 :     Problem: local in signature apparently unsupported
2420 :     Code:
2421 :    
2422 :     - signature SIG =
2423 :     sig
2424 :     structure S : sig type t end;
2425 :     local open S; in val x : t; end;
2426 :     end;
2427 :     = = = Error: expected END, found LOCAL
2428 :     Error: unbound structure name: S
2429 :     Error: unbound type constructor: t
2430 :     Error: expected EQUAL, found SEMICOLON
2431 :     Error: atomic expression expected, found SEMICOLON
2432 :     -
2433 :     Status: language problem: see doc/localspec
2434 :     ---------------------------------------------------------------------------
2435 :     123. error recovery
2436 :     Submitter: Simon Finn, Abstract Hardware Ltd, simon@uk.co.ahl
2437 :     Date: 18 July 1989
2438 :     Version: 0.33
2439 :     System: Sun3/SunOS 4.0
2440 :     Problem: NJML error recovery is flakey
2441 :     Code:
2442 :     val it = () : unit
2443 :     - infix xxx;
2444 :     - fun (a xxx b) = 3;
2445 :     Error: expected EQUAL, found RPAREN
2446 :     Error: atomic expression expected, found RPAREN
2447 :     Error: declaration or expression expected, found RPAREN
2448 :     - fun output (s,w) = output s w;
2449 :     Error: pattern and expression in val rec dec don't agree (circularity)
2450 :     pattern: 'S -> 'T -> 'U
2451 :     expression: 'S * 'T -> 'U
2452 :     in declaration:
2453 :     output = (fn arg => (case arg
2454 :     of <pat> => <exp>))
2455 :     - output;
2456 :     uncaught exception Runbind
2457 :    
2458 :     Comments: The declaration of "xxx" should be accepted - this is a minor
2459 :     known (?) parsing bug. The redeclaration of "output" is a user
2460 :     error. The two in succession seem to severely confuse the
2461 :     compiler; either independently seems to be OK.
2462 :     Status: fixed
2463 :     ---------------------------------------------------------------------------
2464 :     124. compiler bug after incomplete qualified identifier
2465 :     Submitter: David Tarditi, Princeton University, drt@notecnirp
2466 :     Date: 4/21/89
2467 :     Version: 0.33
2468 :     System: Vax/4.3 BSD
2469 :     Problem: compiler error results when incomplete qualified identifier is used.
2470 :     Sample Run:
2471 :    
2472 :     Standard ML of New Jersey, Version 0.33, 1 April 1989
2473 :     val it = () : unit
2474 :     -Integer.;
2475 :     Error: incomplete qualified identifier
2476 :     Error: Compiler bug: EnvAccess.lookPathinStr.getStr
2477 :     -
2478 :    
2479 :     Comments:
2480 :     Caused by using an incomplete qualified identifier.
2481 :    
2482 :     Status: fixed in 0.56, sort of.
2483 :     ---------------------------------------------------------------------------
2484 :     125. constructor exported from abstype declaration
2485 :     Submitter: Carl Gunter <gunter@CENTRAL.CIS.UPENN.EDU>
2486 :     Date: 6/25/89
2487 :     Version: 0.33
2488 :     Problem: constructor for abstract type visible outside abstype decl
2489 :     Code:
2490 :     abstype
2491 :     intset = Set of int list
2492 :     with
2493 :     val empty_set = Set [];
2494 :     end
2495 :    
2496 :     - Set;
2497 :     val it = fn : int list -> intset
2498 :    
2499 :     Status: fixed in 0.39
2500 :     ---------------------------------------------------------------------------
2501 :     126. scope of explicit type variables
2502 :     Submitter: Mads Tofte <mads%lfcs.edinburgh.ac.uk@NSFNET-RELAY.AC.UK>
2503 :     Date: 7/11/89
2504 :     Version: 0.33
2505 :     Problem:
2506 :     New Jersey ML (Version 33) does not accept the following declarations.
2507 :     It complains that a user bound type variable escapes out of scope in `insert'.
2508 :     But the scope of ''a and 'b is the whole of the fun declaration. The problem
2509 :     seems to be associated with mutual recursion.
2510 :    
2511 :     type (''a, 'b)map = (''a * 'b) list
2512 :    
2513 :     fun plus(l:(''a,'b)map ,[]: (''a, 'b)map ): (''a, 'b)map = l
2514 :     | plus(l,hd::tl) = plus(insert(l,hd), tl)
2515 :     and insert([], p) = [p]
2516 :     | insert((x,y)::rest, (x',y')) =
2517 :     if x=x' then (x',y')::rest
2518 :     else (x,y) :: insert(rest,(x',y'));
2519 :    
2520 :     Status: fixed in 0.54
2521 :     ---------------------------------------------------------------------------
2522 :     127. sharing and equality types
2523 :     Submitter: Mads Tofte <mads%lfcs.edinburgh.ac.uk@NSFNET-RELAY.AC.UK>
2524 :     Date: 7/11/89
2525 :     Version: 0.33
2526 :     Problem:
2527 :     New Jersey ML does not accept the following functor declaration (it
2528 :     complains that S.x is not of equality type). According to the
2529 :     Definition, two types share only if they have the same name (stamp).
2530 :     In particular, since equality is an attribute of type names (Version
2531 :     3, page 16), one admits equality iff the other does (one cannot have
2532 :     different ``views'' of equality).
2533 :    
2534 :     Presumably the problem is a bug in the unification of type names.
2535 :    
2536 :     Code:
2537 :     functor f(structure S : sig type t val x: t end
2538 :     structure T : sig eqtype t end
2539 :     sharing S = T
2540 :     )=
2541 :     struct val b:bool = S.x = S.x
2542 :     end;
2543 :    
2544 :     Status: fixed in 0.54
2545 :     ---------------------------------------------------------------------------
2546 :     128. question mark as reserved word
2547 :     Submitter: Mads Tofte <mads%lfcs.edinburgh.ac.uk@NSFNET-RELAY.AC.UK>
2548 :     Date: 7/11/89
2549 :     Version: 0.33
2550 :     Problem:
2551 :     New Jersey ML treats ? as a reserved word (it once was).
2552 :    
2553 :     Status: fixed in 0.54
2554 :     ---------------------------------------------------------------------------
2555 :     129. Bind exception parsing functor (same as 94)
2556 :     Submitter:
2557 :     Hans Bruun
2558 :     Department of Computer Science, Technical University of Denmark
2559 :     hb@iddth.dk
2560 :     Date: 9-June-1989
2561 :     Version: 0.33
2562 :     System: Vax/Ultrix
2563 :     Problem: parsing functor raises Bind
2564 :     Code:
2565 :     signature S_sig=
2566 :     sig
2567 :     type 'a T
2568 :     val fs: 'a T -> 'a T
2569 :     end;
2570 :    
2571 :     functor S() =
2572 :     struct
2573 :     datatype 'a T = C
2574 :     fun fs (x: 'a T )= C: 'a T
2575 :     end ;
2576 :    
2577 :     functor F (type t)=
2578 :     struct
2579 :     structure S1: S_sig= S();
2580 :     open S1
2581 :     type FT = t T
2582 :     fun ff (x : FT)= fs x
2583 :     end;
2584 :    
2585 :     Messages: uncaught exception Bind
2586 :     Comments:
2587 :     Without ': FT' or ': S_sig' the code is accepted by the compiler.
2588 :    
2589 :     Status: Fixed in 0.37
2590 :     ---------------------------------------------------------------------------
2591 :     130. compiler bug on functor application
2592 :     Submitter:
2593 :     Hans Bruun
2594 :     Department of Computer Science, Technical University of Denmark
2595 :     hb@iddth.dk
2596 :     Date: 24-May-1989
2597 :     Version: 0.33
2598 :     System: Vax/Ultrix
2599 :     Code:
2600 :    
2601 :     structure S =
2602 :     struct
2603 :     datatype 'a T = C
2604 :     fun fs (x: 'a T)= x
2605 :     end ;
2606 :    
2607 :     functor F (type t)=
2608 :     struct
2609 :     open S
2610 :     type FT = t T
2611 :     fun ff (x : FT)= fs x
2612 :     end;
2613 :    
2614 :     structure SF= F(type t=int);
2615 :    
2616 :     Messages:
2617 :     structure S :
2618 :     sig
2619 :     datatype 'a T
2620 :     con C : 'a T
2621 :     val fs : 'a T -> 'a T
2622 :     end
2623 :     functor F : <sig>
2624 :     bug.sml, line 15: Error: Compiler bug: SigMatch.applyFunctor/insttyc
2625 :    
2626 :     Status: fixed in 0.39
2627 :     ---------------------------------------------------------------------------
2628 :     131. dying on files of certain lengths
2629 :     Submitter: Jussi Rintanen, Helsinki University of Technology, jur@hutcs.hut.fi
2630 :     Date: 15 June 1989
2631 :     Version: 0.33 1 April 1989
2632 :     System: Vax 4.3 BSD, Sun-4 SunOS Release4-3.2 (?)
2633 :     Problem: Neither the batch compiler not the interactive system accept
2634 :     source files of size 2049, 4097, ...(???).
2635 :     Code: Tested with 2 signatures, I inserted white space, works properly
2636 :     if the file size is a byte lower or higher.
2637 :     Messages: Sun-4 dumps core, uVax raises Io
2638 :    
2639 :     Status: fixed in 0.37
2640 :     ---------------------------------------------------------------------------
2641 :     132. rebinding of "=" allowed
2642 :     Submitter: Mike Fourman (mikef%lfcs.ed.ac.uk)
2643 :     Date: 6/8/89
2644 :     Version: 0.33
2645 :     Problem: NJML allows = to be rebound (contrary to page 4 of the definition)
2646 :     Code:
2647 :     - val op = = op < : int * int -> bool;
2648 :     val = = fn : int * int -> bool
2649 :     -
2650 :     Status: not important
2651 :     ---------------------------------------------------------------------------
2652 :     133. overloading resolution is weaker than Edinburgh SML or Poly ML
2653 :     Submitter: Larry Paulson (lcp@computer-lab.cambridge.ac.uk)
2654 :     Date: 5/8/89
2655 :     Version: 0.33
2656 :     Problem:
2657 :     Code:
2658 :     datatype 'a tree = Stree of 'a list * (string * 'a tree) list
2659 :     fun insert ((key::keys, x), Stree(xs,alist)) =
2660 :     let fun inslist((keyi,tri)::alist) =
2661 :     if key<keyi then alist else (keyi,tri) :: inslist alist
2662 :     in Stree(xs, inslist alist) end;
2663 :     Messages:
2664 :     Error: overloaded variable "<" cannot be resolved
2665 :     Status: fixed in 0.54
2666 :     ---------------------------------------------------------------------------
2667 :     134. type checking
2668 :     Submitter:
2669 :     Erik Tarnvik
2670 :     Department of Computing Science
2671 :     University of Umea
2672 :     SWEDEN
2673 :     erikt@cs.umu.se
2674 :     Date: 5/12/89
2675 :     Version: 0.33
2676 :     System: Sun3
2677 :     Problem:
2678 :     The compiler reports a type clash were it shouldn't.
2679 :    
2680 :     Code:
2681 :     type 'a ft = (int * 'a) list;
2682 :    
2683 :     fun f ([]:'a ft) x = []:'a ft
2684 :     | f (((y,fy)::l):'a ft) x =
2685 :     if x = y
2686 :     then l:'a ft
2687 :     else (y,fy)::(f l x):'a ft
2688 :    
2689 :     and g (l:'a ft) (x,fx) = (x,fx) :: (f l x):'a ft;
2690 :    
2691 :     Messages:
2692 :     type 'a ft = (int * 'a) list
2693 :     line 10: Error: operator and operand don't agree (bound type var)
2694 :     operator domain: (int * 'aU) list
2695 :     operand: 'aU ft
2696 :     in expression:
2697 :     f l
2698 :     Comments:
2699 :     The Edinburgh SML (ver 3.3) does not report an error on this code.
2700 :     If the 'and' in the last line is changed to 'fun', no error is reported.
2701 :     I hope I haven't missunderstood something about SML. This is a bug, isn't it?
2702 :    
2703 :     Status: fixed in 0.49
2704 :     ---------------------------------------------------------------------------
2705 :     135. eqtype vs abstype
2706 :     Submitted: Bernard Sufrin (sufrin%prg.oxford.ac.uk@NSFnet-Relay.AC.UK)
2707 :     Date: 7/26/89
2708 :     Version: 0.33
2709 :     Problem: interaction of abstype and eqtype
2710 :    
2711 :     I ran into this problem whilst writing you a long note concerning
2712 :     abstraction bindings structure bindings and their respect for type and
2713 :     eqtype specifications. Here's a miniature version of the larger
2714 :     problem.
2715 :    
2716 :     We want a pair of types Open and Shut, and transfer functions between
2717 :     them. The two signatures below are candidates for describing such a
2718 :     structure: the latter leaves visible the equality on Open, the former
2719 :     should not.
2720 :    
2721 :     signature T =
2722 :     sig
2723 :     type Shut
2724 :     type Open
2725 :     val Shut:Open->Shut
2726 :     and Open: Shut->Open
2727 :     end
2728 :    
2729 :     signature U =
2730 :     sig
2731 :     type Shut
2732 :     eqtype Open
2733 :     val Shut:Open->Shut
2734 :     and Open: Shut->Open
2735 :     end
2736 :    
2737 :     Now we design a functor which simply wraps something up in order to shut it.
2738 :    
2739 :     functor absT(type Open) =
2740 :     struct
2741 :     type Open = Open
2742 :     abstype Shut = SHUT of Open with
2743 :     val Shut = SHUT
2744 :     fun Open(SHUT x) = x
2745 :     end
2746 :     end
2747 :    
2748 :     Now we instantiate it:
2749 :    
2750 :     structure b:T = absT(type Open=int)
2751 :    
2752 :     Compiler yields:
2753 :    
2754 :     structure b :
2755 :     sig
2756 :     eqtype Shut <----- can't be right, surely
2757 :     eqtype Open
2758 :     val Open : Shut -> Open
2759 :     val Shut : Open -> Shut
2760 :     end
2761 :    
2762 :     The equality on Shut has leaked, despite the fact that the actual
2763 :     representation of Shut is an abstype. (The same happens if absT is
2764 :     itself constrained to yield a T)
2765 :    
2766 :     - b.Shut 3=b.Shut 4;
2767 :     val it = false : bool
2768 :    
2769 :     On the other hand using an abstraction binding
2770 :    
2771 :     abstraction ab:T = absT(type Open=int)
2772 :    
2773 :     Compiler yields, correctly,
2774 :    
2775 :     structure ab :
2776 :     sig
2777 :     type Shut
2778 :     type Open
2779 :     val Open : Shut -> Open
2780 :     val Shut : Open -> Shut
2781 :     end
2782 :    
2783 :     but I cannot actually apply ab.Shut to an integer (its domain is not
2784 :     int, but an opaque and different type, namely ab.Open). Now let's try
2785 :    
2786 :     abstraction au:U = absT(type Open=int)
2787 :    
2788 :     Compiler yields, correctly,
2789 :    
2790 :     structure au :
2791 :     sig
2792 :     type Shut
2793 :     eqtype Open
2794 :     val Open : Shut -> Open
2795 :     val Shut : Open -> Shut
2796 :     end
2797 :    
2798 :     but I still can't apply au.Shut to an integer. Incidentally in my
2799 :     original note I asked (a) whether I ought to be able to, (b) if so,
2800 :     whether eqtype was not getting a bit overloaded [equality visible AND
2801 :     representation visible] (c) if not, how could one do this sort of
2802 :     thing at all?
2803 :    
2804 :     Meanwhile
2805 :    
2806 :     structure argh:U = absT(type Open=int)
2807 :    
2808 :     still makes Open and Shut both eqtypes. More bizarrely, we have
2809 :    
2810 :     abstype opaque = opaque of int with
2811 :     val hide = opaque
2812 :     val show = fn(opaque x)=>x
2813 :     end
2814 :    
2815 :     structure biz:T = absT(type Open=opaque)
2816 :    
2817 :     Compiler yields
2818 :    
2819 :     structure biz :
2820 :     sig
2821 :     eqtype Shut <--- wow!
2822 :     type Open
2823 :     val Open : Shut -> Open
2824 :     val Shut : Open -> Shut
2825 :     end
2826 :    
2827 :     Shut is now an eqtype despite being an abstype whose representation
2828 :     includes another abstype!
2829 :    
2830 :     Status: fixed in 0.54
2831 :     ---------------------------------------------------------------------------
2832 :     136. linkdata problem
2833 :     Submitter: John Reppy (ulysses!jhr, jhr@cs.cornell.edu)
2834 :     Date: 7/12/89
2835 :     Version: 0.36
2836 :     System: Sun 3, SunOS 4.0.3
2837 :     Problem: failure to build
2838 :     Code:
2839 :     When I tried to build 0.36 on the sun-3, I got the message
2840 :    
2841 :     ld: : Is a directory
2842 :    
2843 :     on the load of the runtime system. The problem is with the allmo.o
2844 :     file. I am able to build the system using "-noshare".
2845 :    
2846 :     Status: fixed in 0.49
2847 :     ---------------------------------------------------------------------------
2848 :     137. profiler failure
2849 :     Submitter: Ian Dickinson, HP Labs, Information Systems Centre, Bristol
2850 :     ijd%otter@hplabs.hp.com
2851 :     Date: 9/28/89
2852 :     Version: 0.33
2853 :     System: HP 9000 HP-UX 6.3
2854 :     Problem:
2855 :     I have a small, compute intensive program (around 2K lines of code including
2856 :     comments). With the profiler turned on, njml fails repeatably at the first
2857 :     major collect:
2858 :    
2859 :     - test 30 30;
2860 :     Case 30: TOLUENE, A,O-DICHLORO
2861 :    
2862 :     [Major collection... 54% used (2332228/4249436), 2483 msec]
2863 :     unknown signal: 20
2864 :    
2865 :     Process SML exited abnormally with code 148
2866 :    
2867 :     Priority: A
2868 :     ---------------------------------------------------------------------------
2869 :     138. numeric labels not equivalent to tuples
2870 :     Submitter: Russ Green <rjg%lfcs.edinburgh.ac.uk@NSFnet-Relay.AC.UK>
2871 :     Date: Thu, 23 Nov 89 11:10:18 GMT
2872 :     Version: 0.43
2873 :     Problem: numeric labels over 9 not treated properly
2874 :     Code:
2875 :    
2876 :     New Jersey ML seems to get confused with records composed of n numeric
2877 :     labels where n > 9. (Poly ML doesn't)
2878 :    
2879 :     - val a = {1=0,2=0,3=0,4=0,5=0,6=0,7=0,8=0,9=0};
2880 :     val a = (0,0,0,0,0,0,0,0,0) : int * ... * int (* OK *)
2881 :    
2882 :     - val b = {1=0,2=0,3=0,4=0,5=0,6=0,7=0,8=0,9=0,10=0};
2883 :     val b = {1=0,10=0,2=0,3=0,4=0,5=0,6=0,7=0,8=0,9=0} :
2884 :     {1:int,10:int,2:int,3:int,4:int,5:int,6:int,7:int,8:int,9:int}
2885 :    
2886 :     The resulting record type will not unify with the corresponding tuple
2887 :    
2888 :     - a = (0,0,0,0,0,0,0,0,0);
2889 :     val it = true : bool (* OK *)
2890 :    
2891 :     - b = (0,0,0,0,0,0,0,0,0,0);
2892 :     Error: operator and operand don't agree (tycon mismatch)
2893 :     operator domain:{1:int,10:int,2:int,3:int,4:int,5:int,6:int,7:int,8:int,9:int}
2894 :     * {1:int,10:int,2:int,3:int,4:int,5:int,6:int,7:int,8:int,9:int}
2895 :     operand: {1:int,10:int,2:int,3:int,4:int,5:int,6:int,7:int,8:int,9:int}
2896 :     * (int * int * int * int * int * int * int * int * int * int)
2897 :     in expression:
2898 :     b = (0,0,0,0,0,0,0,0,0,0)
2899 :     Comments:
2900 :     Presumably something to do with the sorting of the record labels (10 comes
2901 :     before 2)?
2902 :     Status: fixed in 0.54
2903 :     --------------------------------------------------------------------------------
2904 :     139. compiling with gcc doesn't work
2905 :     Submitter: Brian Boutel, brian@comp.vuw.ac.nz
2906 :     Date: 9 November 1989
2907 :     Version: 0.36 & later
2908 :     System: HP/Sun 3
2909 :     Problem: compiling with gcc doesn't work
2910 :     Description:
2911 :    
2912 :     I have been trying again to port sml to H-P 68030 boxes running
2913 :     MORE/bsd, using the Gnu C compiler.
2914 :    
2915 :     We have a mix of Sun3 and H-P machines, and, although I have installed
2916 :     sml on the suns, it would be convenient to have it available on the H-Ps as well.
2917 :    
2918 :     The H-P port has not worked, and to separate the problems arising from
2919 :     the Operating System from those arising from the use of gcc, I have
2920 :     tried building sml on the suns with gcc (using the -traditional
2921 :     option). The build completes, but the resulting sml dies immediately
2922 :     while doing a major garbage collection. It does not get as far as
2923 :     announcing itself as Standard ML of .....
2924 :     I have tried various options, (optimiser on/off some of the gcc -f
2925 :     options) without effect. Have you tried gcc? I am anxious to persue
2926 :     this as I think getting a gcc compiled version to run on the suns is
2927 :     the right first step towards porting to the H-Ps. Can you offer any suggestions?
2928 :    
2929 :     I am using sml version 0.36. ( I tried today to ftp to
2930 :     research.att.com to check for a later version, but found an empty
2931 :     directory when logging on as anonymous, and was refused permission to
2932 :     log on as mldist.)
2933 :    
2934 :    
2935 :     Changes made to the source are summarised as
2936 :    
2937 :     ------
2938 :     gnu C compiler requires f68881 to be changed to m68881
2939 :     Changed in makeml by introducing $CCOMP, set to GNUCC for machine hp300,
2940 :     otherwise "", and testing it in defining CFL for M68
2941 :    
2942 :     ----------------
2943 :     for H-P, sys/exec.h defines MID_HP300 instead of M_68020
2944 :     linkdata.c and export.c have conditional code if HP300 defined
2945 :     makeml has to pass HP300 to make for linkdata
2946 :     -------------
2947 :     for H-P, callgc.c has FPE_TRAPV_TRAP undefined, and
2948 :     TRAPV returns FPE_INTOVF_TRAP
2949 :     so FPE_TRAPV_TRAP is defined as FPE_INTOVF_TRAP in callgc.c
2950 :     ----------
2951 :     _minitfp_ and _fp_state_mc68881 not defined anywhere for H-P
2952 :     .globl omitted if HP300 in M68.prim.s
2953 :     --------------------
2954 :     run dies because stack clobbered by apply
2955 :     Registers saved ala NeXT/MACH in saveregs/restoreregs in prim.s if GNUCC
2956 :     Status: fixed in 0.44
2957 :     --------------------------------------------------------------------------------
2958 :     140. comment to end of file (see also bug 64)
2959 :     Submitter: Conal Elliott, Kestrel Institute, conal@kestrel.edu
2960 :     Date: Wed Nov 8 11:15:35 1989
2961 :     Version: 0.39
2962 :     System: Sparc
2963 :     Problem: The compiler doesn't give an error message if the file ends in
2964 :     the middle of a comment.
2965 :     Messages: None (that's the problem)
2966 :     Comments: This has tripped me up a few times, and was quite puzzling.
2967 :     Status: fixed in 0.54
2968 :     --------------------------------------------------------------------------------
2969 :     141. interrupting gc dumps core
2970 :     Submitter: peter@central.cis.upenn.edu (Peter Buneman)
2971 :     Date: 18 November 1989
2972 :     Version: 0.39
2973 :     System: ??
2974 :     Problem:
2975 :     I've found occasions on which our current version of ML goes a bit
2976 :     flakey after being interrupted during garbage collection. I haven't
2977 :     been able to pin it down until now. The following interactive session
2978 :     appears to be repeatable.
2979 :     Code:
2980 :     % sml
2981 :     Standard ML of New Jersey, Version 0.39, 8 September 1989
2982 :     val it = () : unit
2983 :     - fun foo() = 1::foo();
2984 :     val foo = fn : unit -> int list
2985 :     - foo();
2986 :    
2987 :     [Major collection...
2988 :     [Increasing heap to 7144k]
2989 :     70% used (1752720/2487664), 4810 msec]
2990 :    
2991 :     [Increasing heap to 7280k]
2992 :    
2993 :     [Major collection... 62% used (2484132/3975316), 7580 msec]
2994 :     *** I typed <cntrl>C during this garbage collection
2995 :     [Increasing heap to 11648k]
2996 :     uncaught exception Interrupt
2997 :     - fun bar() = bar();
2998 :     val bar = fn : unit -> 'a
2999 :     - bar(); *** I did not type <cntrl>C here !!
3000 :     uncaught exception Interrupt
3001 :     - bar(); *** nor here!!
3002 :     uncaught exception Interrupt
3003 :     -
3004 :     Comments:
3005 :     In 0.43d2 I can't repeat this behavior, but interrupting during gc causes
3006 :     a bus error or segmentation fault. [dbm]
3007 :     Status: fixed in 0.54
3008 :     --------------------------------------------------------------------------------
3009 :     142. import incompatible with interpreter only image
3010 :     Submitter: Bernard Sufrin <sufrin%prg.oxford.ac.uk@NSFnet-Relay.AC.UK>
3011 :     Date: 27 Sept 1989
3012 :     Version: 0.39
3013 :     System: Sun 3 ?
3014 :     Problem: import into interpreter
3015 :     Description:
3016 :     OK; when making the intepreter-only it seems one must:
3017 :    
3018 :     makeml -noshare -noclean -run
3019 :     makeml -ionly -noshare -norun
3020 :    
3021 :     Then one gets the smaller (by about 200k) file.
3022 :    
3023 :     Problem: it is not possible to import precompiled stuff; the compiler
3024 :     decides that the .bin file is not in the right format; tries to recompile,
3025 :     and fails for lack of a code generator.
3026 :    
3027 :     Here's an example...
3028 :    
3029 :     - import "/prg/pl/sml/lib/lex";
3030 :     [reading /prg/pl/sml/lib/lex.bin... ]
3031 :     [/prg/pl/sml/lib/lex.bin is the wrong format; recompiling]
3032 :     [closing /prg/pl/sml/lib/lex.bin]
3033 :     [reading /prg/pl/sml/lib/lex.sml]
3034 :     [reading /prg/pl/sml/lib/lib/lib/extend.bin... ]
3035 :     [/prg/pl/sml/lib/lib/lib/extend.bin is the wrong format; recompiling]
3036 :     [closing /prg/pl/sml/lib/lib/lib/extend.bin]
3037 :     [reading /prg/pl/sml/lib/lib/lib/extend.sml]
3038 :     /prg/pl/sml/lib/lib/lib/extend.sml, line 52: Error: Compiler bug: no code generator!
3039 :     [closing /prg/pl/sml/lib/lib/lib/extend.sml]
3040 :     [closing /prg/pl/sml/lib/lex.sml]
3041 :     IMPORT failed (compile-time exception: Syntax)
3042 :    
3043 :     When trying to reproduce the import bug
3044 :     you might try making the dependency graph more than three arcs deep.
3045 :    
3046 :     Comments:
3047 :     Obviously we don't want to have to dispense with import
3048 :     when using the intepreter-only (typically it'd be students loading
3049 :     precompiled libraries), but I presume we don't want the complication of
3050 :     lambda-formatted bin files as well as machine code bin files. May I
3051 :     propose the following:
3052 :    
3053 :     import from an ionly system should behave like import in the cg system if
3054 :     everything is up-to-date.
3055 :    
3056 :     if something is out of date, then import should either abort, or behave
3057 :     like use (I prefer the latter, I think, but you might make it
3058 :     controllable from a System.Control variable).
3059 :     Status: not important
3060 :     --------------------------------------------------------------------------------
3061 :     143. use failes on certain input files of a certain length
3062 :     Submitter: Jawahar Malhotra (malhotra%metasoft.uucp@BBN.COM)
3063 :     Date: 26 October 1989
3064 :     Version: ??
3065 :     System: ??
3066 :     Problem: use dumping core on magic input file length
3067 :     Description:
3068 :     I have a source file which contains a signature definition and a
3069 :     functor definition. When I load it using the "use" statement, the
3070 :     compiler responds with the signature defn and the functor defn but
3071 :     then dumps core just before its prints the [<closing file>] line.
3072 :     Strangely, if I add another blank line to the file, everything is
3073 :     OK. If you like, I can mail you the file; please let me know if
3074 :     you would like the file.
3075 :    
3076 :     Here is a reproduction of the compiler's output:
3077 :    
3078 :     - use "oareadattr.sml";
3079 :     [opening oareadattr.sml]
3080 :     signature OAREADATTR = ...
3081 :     ...
3082 :     ...
3083 :     end
3084 :     functor OAReadAttrFun : <sig>
3085 :     Segmentation Fault (core dumped)
3086 :     Comments:
3087 :     Status: not reproducible; possibly fixed.
3088 :     --------------------------------------------------------------------------------
3089 :     144. not waiting for child process
3090 :     Submitter: Jawahar Malhotra, Meta Software; malhotra%metasoft@bbn.com
3091 :     Date: 20 Oct 89
3092 :     Version: 0.33
3093 :     System: SUN OS 3.5
3094 :     Problem:
3095 :     njsml doesn't wait for child process (created by a call to
3096 :     execute) to terminate. Suppose I execute the following
3097 :     sml stmt:
3098 :    
3099 :     - execute "ls /users/malhotra";
3100 :    
3101 :     njsml creates a child process in which it runs ls. When ls
3102 :     is done, it does an exit(0). In order for the exit to
3103 :     complete, its parent process (njsml in this case) should
3104 :     do a wait(). However, njsml doesn't do this and hence the
3105 :     "ls" process blocks on its exit and remains until njsml
3106 :     exits. The state of this process (as displayed by "ps") is:
3107 :    
3108 :     malhotra 2376 0.0 0.1 0 0 p2 Z 0:00 <exiting>
3109 :    
3110 :     Comments:
3111 :     One fix would be to prevent the process created by "execute" from
3112 :     being njsml's child. In this case, njsml would not have to wait to
3113 :     collect the child's termination status. This can be done by
3114 :     forking twice. Hence the code for execute might look like:
3115 :     (assume njsml is process p1)
3116 :    
3117 :     ------------------------------------------------------------
3118 :    
3119 :     /* in process p1 */
3120 :    
3121 :     if (fork() == 0) { /* in p2 */
3122 :     if (fork() == 0) { /* in p3 */
3123 :     .........
3124 :     execl(......);
3125 :     .......
3126 :     }
3127 :     else { /* in p2 */
3128 :     exit(0);
3129 :     }
3130 :     }
3131 :    
3132 :     /* in p1 */
3133 :    
3134 :     wait(0); /* wait for p2 to exit */
3135 :    
3136 :     ------------------------------------------------------------
3137 :    
3138 :     Another fix (maybe easier to implement) is to install a signal
3139 :     handler for SIGCHLD.
3140 :    
3141 :     signal(SIGCHLD, ack);
3142 :    
3143 :     where ack() is simply:
3144 :    
3145 :     ack()
3146 :     {
3147 :     wait(0);
3148 :     }
3149 :     Status: not a bug
3150 :     --------------------------------------------------------------------------------
3151 :     145. stale top-level continuations cause type bugs
3152 :     Submitter: Andrzej Filinski, CMU Computer Science (andrzej@cs.cmu.edu)
3153 :     Date: Oct 11, 1989
3154 :     Version: 0.39 (8 September 1989)
3155 :     System: Sun3/4.3BSD
3156 :     Problem: Capturing top-level continuation messes up the type system
3157 :     Code:
3158 :    
3159 :     val cl = ref([]:int cont list);
3160 :     callcc (fn k=>(cl:=[k]; 42));
3161 :     val u = throw (hd (!cl)) 65; (* value 65 with universal type! *)
3162 :     u+1; (* u as integer *)
3163 :     u^"str"; (* u as string *)
3164 :     u:bool; (* u as boolean (cannot print) *)
3165 :     u:real; (* u as real (core dump) *)
3166 :    
3167 :     Comments: This may be a tricky problem, i.e. it is not quite clear
3168 :     what the "right" behavior should be when the top-level continuation
3169 :     is captured and carried across commands. Please don't take this as a
3170 :     criticism of callcc/throw in general, though; they're great! Any plans
3171 :     for integrating them more deeply in the language, like exceptions?
3172 :     Status: fixed in 0.49
3173 :     --------------------------------------------------------------------------------
3174 :     146. inputting 1025 characters fails
3175 :     Submitter: Jawahar Malhotra, Meta Software, malhotra%metasoft@bbn.com
3176 :     Date: 9/29/89
3177 :     Version: 0.33
3178 :     System: Sun3/SunOS 3.5
3179 :     Problem: "input" when applied to std_in and an int > 1024 returns "".
3180 :     Code:
3181 :     - input std_in 1025;
3182 :     > val it = "" : string
3183 :     Comments: It obviously works for all other kinds of instreams.
3184 :     Status: fixed in 0.43
3185 :     --------------------------------------------------------------------------------
3186 :     147. compiler blowup
3187 :     Submitter: Ian Dickinson, HP Labs, Information Systems Centre, Bristol
3188 :     ijd%otter@hplabs.hp.com
3189 :     Date: 27 Sept 1989
3190 :     Version: 0.33
3191 :     System: HP 9000 HP-UX 6.3
3192 :     Problem: compiler out to lunch
3193 :     Description:
3194 :     I have a large-ish list of type:
3195 :     (string * string list) list
3196 :    
3197 :     It has 1003 entries, and on average the string list in each pair is around
3198 :     3 elements. Each string is between 5 and 9 characters.
3199 :    
3200 :     The list is declared in a file in the form:
3201 :     val graph = [ ("foo", ["bar"]), ... etc ...];
3202 :     This is the only declaration in the file. Poly-ml compiles the file
3203 :     in about 10 seconds.
3204 :    
3205 :     Njml takes around an hour to increase the heap to 30Mbytes, performs several
3206 :     major collects, and then bombs with an out-of-memory error.
3207 :     Status: fixed in 0.43
3208 :     --------------------------------------------------------------------------------
3209 :     148. relational operators on empty string
3210 :     Submitter: jhr@cs.cornell.edu (John Reppy)
3211 :     also Erik Tarnvik, University of Umea, SWEDEN (erikt@cs.umu.se)
3212 :     Date: 14 Sept 1989
3213 :     Version: 0.39?
3214 :     Problem:
3215 :     The implementation of "<" on strings doesn't work for ("" < "").
3216 :     Comments:
3217 :     The fix is to replace line 835 of boot/perv.sml, which is
3218 :    
3219 :     fun sgtr(_,"") = true
3220 :    
3221 :     with the lines
3222 :    
3223 :     fun sgtr("","") = false
3224 :     | sgtr(_,"") = true
3225 :     Status: fixed in 0.43
3226 :     --------------------------------------------------------------------------------
3227 :     149. infinite gc loop with insufficient swap space
3228 :     Submitter: jhr@cs.cornell.edu (John Reppy)
3229 :     Date: 18 Sept 89
3230 :     Version: 0.39
3231 :     System: Vax
3232 :     Problem:
3233 :     SML/NJ is being used at Cornell for a course this semester, and we've
3234 :     run into a problem with it on multi-user vaxen. If there isn't sufficient
3235 :     swap space for the system to run, it seems to get into an infinite loop
3236 :     of garbage collection attempts. I should fail gracefully in this situation.
3237 :     Status: this is a long, finite loop; not a bug
3238 :     --------------------------------------------------------------------------------
3239 :     150. incomplete sharing spec accepted
3240 :     Submitter: Simon Finn <simon%abstract-hardware-ltd.co.uk@NSFnet-Relay.AC.UK>
3241 :     Date: 13 Sept 89
3242 :     Version: 0.33
3243 :     Problem:
3244 :     Both NJML (v0.33) and Poly/ML (v1.80x) erroneously parse the following:
3245 :    
3246 :     signature SIG =
3247 :     sig
3248 :     type t
3249 :     sharing type t
3250 :     end;
3251 :     Comments:
3252 :     The above signature is illegal, since sharing constraints must involve
3253 :     at least two types / structures ("n >= 2" in section 3.5, figure 7).
3254 :    
3255 :     This bug was found by Mike Crawley.
3256 :     Status: fixed in 0.54
3257 :     --------------------------------------------------------------------------------
3258 :     151. can't limit length of list printed
3259 :     Submitter: Lawrence C Paulson <lcp%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK>
3260 :     Date: 14 Sept 1989
3261 :     Version: ??
3262 :     Problem:
3263 :     How do you tell New Jersey ML not to print all the elements of a list?
3264 :     System.Control.Print.printDepth seems to consider nesting only.
3265 :     Code:
3266 :     - take(100,ms);
3267 :     val it = [1861294,62685628,105212158,14112418,78287461,35512822,180290056,316473
3268 :     64,72270388,168319897,212829007,43941079,142303594,174252739,117587239,56623288,
3269 :     96050461,46119052,152678905,140061256,13973941,209088847,109015732,167261566,142
3270 :     82215,159257329,69147538,162991570,121739197,19339324,52452037,18146911,23268574
3271 :     ,183534766,93272557,163056892,193407172,50009149,131379349,28143469,114167002,14
3272 :     8862536,85731877,182107423,28619248,67440382,145320439,121674259,172092145,16412
3273 :     2099,196052140,141367123,32002813,17851816,198701119,46866244,196351819,12166451
3274 :     8,163288573,14499193,10976578,64526104,139008271,417145,67962574,64746709,994460
3275 :     5,117181366,115999456,124879621,188830621,158322193,82998094,187333183,178599706
3276 :     ,158794345,17054389,62405431,142521907,182072470,22294474,162171034,163367647,12
3277 :     3860254,25498117,13136599,105899185,53939356,184226566,191249065,66913411,177659
3278 :     797,114495331,28730221,76001191,104114101,180588016,60920215,151887592,208100422
3279 :     ] : int list
3280 :    
3281 :     - [[[[[[[[[[[4]]]]]]]]]]];
3282 :     val it = [[[[[#]]]]] : int list list list list list list list list list list list
3283 :     -
3284 :     Status: fixed in 0.54
3285 :     --------------------------------------------------------------------------------
3286 :     152. floating point errors
3287 :     Submitter: Lawrence C Paulson <lcp%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK>
3288 :     Date: Thu, 14 Sep 89
3289 :     Version: ??
3290 :     Problem:
3291 :     Why cannot New Jersey handle integers that are well within the maximum
3292 :     available on the hardware?
3293 :     Code:
3294 :     - exp(31.0 * ln 2.0);
3295 :     val it = 2147483648.0 : real
3296 :    
3297 :     - floor 2000000000.0;
3298 :     uncaught exception Floor
3299 :     Status: fixed in 0.54; but the maximum integer is 1073741823 in SML-NJ
3300 :     --------------------------------------------------------------------------------
3301 :     153. interrupting coroutine loop dumps core
3302 :     Submitter: Bernard Sufrin <sufrin%prg.oxford.ac.uk@NSFnet-Relay.AC.UK>
3303 :     Date: Sep 15 11:14:13 1989
3304 :     Version: 0.43
3305 :     System: Sun 3
3306 :     Problem: producer consumer segementation fault
3307 :     interrupt consumer(producer) with a single ^c to cause a segmentation
3308 :     fault
3309 :     Code:
3310 :     datatype state = S of state cont;
3311 :    
3312 :     fun resume(S k: state) : state = callcc( fn k':state cont => throw k (S k'))
3313 :    
3314 :     fun initiate(p:state -> unit) = callcc( fn k : state cont => (p(S k); S k))
3315 :    
3316 :     val buf = ref 0;
3317 :    
3318 :     fun producer(s:state):unit =
3319 :     let val n=ref 0
3320 :     val ccont : state ref = ref(resume s)
3321 :     in
3322 :     while true do (inc n; buf := !n; ccont := resume(!ccont))
3323 :     end
3324 :    
3325 :     fun consumer(prod: state->unit) : unit =
3326 :     let val pcont = ref(initiate prod) in
3327 :     while true do (pcont := resume(!pcont); print (!buf))
3328 :     end
3329 :     Status: fixed in 0.56
3330 :     --------------------------------------------------------------------------------
3331 :     154. import smashing memory
3332 :     Submitter: Benjamin Pierce, CMU (bcp@cs.cmu.edu)
3333 :     Date: 11/34/89
3334 :     Version: 0.41
3335 :     System: Sun3/SunOS 3.5.2
3336 :     Problem: import seems to be smashing memory
3337 :     Comments:
3338 :     I've included a minimal version of program that exercises this bug on
3339 :     my machine. Slightly different versions give different incorrect
3340 :     results, or simply fail with bus errors. Removing the first line of
3341 :     tconst.sml (the import of globals, which is never used here) gives the
3342 :     correct answer.
3343 :     Transcript:
3344 :     Standard ML of New Jersey, Version 0.41, 25 October 1989
3345 :     val it = () : unit
3346 :     - use "main.sml";
3347 :     [opening main.sml]
3348 :     val it = () : unit
3349 :     [reading checker.sml]
3350 :     [reading tconst.sml]
3351 :     [reading globals.sml]
3352 :     [closing globals.sml]
3353 :     [writing globals.bin... done]
3354 :     [closing tconst.sml]
3355 :     [writing tconst.bin... done]
3356 :     [closing checker.sml]
3357 :     [writing checker.bin... done]
3358 :     signature GLOBALS
3359 :     signature CHECKER
3360 :     signature TCONST
3361 :     functor TConstFun : <sig>
3362 :     functor GlobalsFun : <sig>
3363 :     functor CheckerFun : <sig>
3364 :     structure TConst
3365 :     val it = "\000\^VG\200" : ?.t <--- Should be "int"
3366 :     [closing main.sml]
3367 :     val it = () : unit
3368 :     -
3369 :     Code:
3370 :     (* ------------------------ globals.sml: ---------------------- *)
3371 :     signature GLOBALS =
3372 :     sig
3373 :     val member: ''a -> ''a list -> bool
3374 :     end
3375 :    
3376 :     functor GlobalsFun() : GLOBALS =
3377 :     struct
3378 :     fun member x [] = false
3379 :     | member x (y::l) = (x=y) orelse (member x l)
3380 :     end
3381 :    
3382 :     (* ------------------------ tconst.sml: ---------------------- *)
3383 :     import "globals";
3384 :    
3385 :     signature TCONST =
3386 :     sig
3387 :     type t
3388 :     val from_string: string -> t
3389 :     end
3390 :    
3391 :     functor TConstFun((*structure Globals:GLOBALS*)): TCONST =
3392 :     struct
3393 :     exception IllegalTConst of string
3394 :     type t = string
3395 :     fun member x [] = false
3396 :     | member x (y::l) = (x=y) orelse (member x l)
3397 :     fun from_string s = if not (member s ["int", "real", "bool"])
3398 :     then raise IllegalTConst(s)
3399 :     else s
3400 :     end
3401 :    
3402 :     (* ------------------------ checker.sml: ---------------------- *)
3403 :     import "tconst";
3404 :     signature CHECKER = sig end (* CHECKER *)
3405 :     functor CheckerFun() : CHECKER = struct end (* CheckerFun *)
3406 :    
3407 :     (* ------------------------ main.sml: ---------------------- *)
3408 :     System.Control.Print.signatures := false;
3409 :     import "checker";
3410 :     (* structure Globals:GLOBALS = GlobalsFun(); *)
3411 :     structure TConst:TCONST = TConstFun((*structure Globals=Globals*));
3412 :     TConst.from_string "int";
3413 :     Status: fixed in 0.49
3414 :     --------------------------------------------------------------------------------
3415 :     155. Compiler bug caused by of missing structure
3416 :     Submitter: Benjamin Pierce (bcp@cs.cmu.edu)
3417 :     Date: 11/3/89
3418 :     Version: 0.52
3419 :     System: Sun3/SunOS
3420 :     Problem: Missing structure component shows up later as compiler bug
3421 :     Transcript:
3422 :    
3423 :     - use "bug155.sml";
3424 :     bug155.sml:16.1-18.3 Error: unmatched structure spec: A
3425 :     Error: Compiler bug: TypesUtil.lookTycPath.2
3426 :    
3427 :     Code: (bug155.sml)
3428 :    
3429 :     signature S1 =
3430 :     sig
3431 :     type t
3432 :     end;
3433 :    
3434 :     signature S2 =
3435 :     sig
3436 :     structure A : S1
3437 :     val x : A.t
3438 :     end;
3439 :    
3440 :     structure B : S2 =
3441 :     struct
3442 :     val x = 3
3443 :     end;
3444 :    
3445 :     Status: fixed in 0.54
3446 :     --------------------------------------------------------------------------------
3447 :     156. confusing parser error message
3448 :     Submitter: dbm
3449 :     Date: 4 Nov 1989
3450 :     Version: 0.43
3451 :     Problem:
3452 :     Misspelled constructor (VALbind instead of VARbind) in line
3453 :    
3454 :     | scan ((VALbind _)::_) = ...
3455 :    
3456 :     causes inappropriate message:
3457 :    
3458 :     basics/typesutil.sml, line 74: Error: identifiers in clauses don't match
3459 :     Status: fixed in 0.49
3460 :     --------------------------------------------------------------------------------
3461 :     157. nested imports corrupt memory (same as 154?)
3462 :     Submitter: sufrin%prg.oxford.ac.uk@NSFnet-Relay.AC.UK
3463 :     Date: 3 Nov 89
3464 :     Version: 0.39
3465 :     System: Sun 3
3466 :     Problem:
3467 :     I have had a good deal of trouble with transitive imports. Symptom is
3468 :     segmentation failure on first call of a procedure defined in a functor
3469 :     imported transitively.
3470 :    
3471 :     parser:
3472 :     defines abstractsyntax, lexer, and parser functors
3473 :    
3474 :     codegen:
3475 :     imports parser
3476 :     defines code generator
3477 :    
3478 :     main:
3479 :     imports codegen
3480 :     instantiates abstractsyntax, lexer, parser
3481 :     crashes at first invocation of procedure defined in parser.
3482 :    
3483 :     When I remove the "import parser" from codegen, and
3484 :     import it directly from main, then all is well.
3485 :    
3486 :     This actually arose in a student's system, and I haven't time to try it in
3487 :     smaller contexts. Does the symptom sound familiar? If not, I can send the
3488 :     whole lot to you.
3489 :     Status: fixed in 0.49
3490 :     --------------------------------------------------------------------------------
3491 :     158. sparc code generator problem
3492 :     Submitter: Dale Miller, UPenn, dale@linc.cis.upenn.edu
3493 :     Date: 22 Oct 89
3494 :     Version: 0.39
3495 :     System: Sun4 (unagi.cis.upenn.edu)
3496 :     Problem: Error: Compiler bug: [SparcCoder.move]
3497 :     Code: /pkg/ml.39/lib/lexgen/lexgen.sml
3498 :     Transcript:
3499 :     Standard ML of New Jersey, Version 0.39, 8 September 1989
3500 :     val it = () : unit
3501 :     - use "/pkg/ml.39/lib/lexgen/lexgen.sml";
3502 :     [opening /pkg/ml.39/lib/lexgen/lexgen.sml]
3503 :     /pkg/ml.39/lib/lexgen/lexgen.sml, line 1083: Warning: match not exhaustive
3504 :     (nil,nil) => ...
3505 :     (a :: a',b :: b') => ...
3506 :     /pkg/ml.39/lib/lexgen/lexgen.sml, line 1083: Warning: match not exhaustive
3507 :     1 => ...
3508 :     2 => ...
3509 :     3 => ...
3510 :     /pkg/ml.39/lib/lexgen/lexgen.sml, line 1083: Warning: match not exhaustive
3511 :     (tl,el) :: r => ...
3512 :    
3513 :     [Major collection... 68% used (1443980/2116924), 2760 msec]
3514 :    
3515 :     [Increasing heap to 4576k]
3516 :    
3517 :     [Major collection... 70% used (1724168/2441672), 3170 msec]
3518 :    
3519 :     [Increasing heap to 5520k]
3520 :    
3521 :     [Major collection... 88% used (2573912/2923048), 4620 msec]
3522 :    
3523 :     [Increasing heap to 8040k]
3524 :    
3525 :     [Major collection... 57% used (2395752/4198108), 4320 msec]
3526 :    
3527 :     [Major collection... 68% used (2819788/4139960), 5060 msec]
3528 :    
3529 :     [Increasing heap to 8368k]
3530 :    
3531 :     [Major collection... 78% used (3364372/4305528), 5940 msec]
3532 :    
3533 :     [Increasing heap to 10080k]
3534 :     /pkg/ml.39/lib/lexgen/lexgen.sml, line 1083: Error: Compiler bug: [SparcCoder.move]
3535 :     ?exception Syntax in SparcCM.storeindexl
3536 :     [closing /pkg/ml.39/lib/lexgen/lexgen.sml]
3537 :     -
3538 :     Status: fixed in 0.43
3539 :     --------------------------------------------------------------------------------
3540 :     159. nested structure reference causes compiler bug
3541 :     Submitter: Tom Murtagh, Rice University, tpm@rice.edu
3542 :     Date: 10/20/89
3543 :     Version: 0.38 and 0.39
3544 :     System: Sun4/SunOS 4.0.3c and Sun3/SunOS 4.0.?
3545 :     Problem: Compiler dies on reference to type from a nested structure
3546 :     Description:
3547 :     I ran into another problem with the compiler. This one does not
3548 :     appear to have anything to do with the port to SPARC. I ran it
3549 :     on a Sparcstation using verion 0.38 and on a Sun3 running version
3550 :     0.39 (Bruce's copy) and it died on both. It compiled without
3551 :     complaint on a Sun 3 running verions 0.33 (which is installed
3552 :     in the public local software directory here).
3553 :    
3554 :     Code: (smaller.sml = /usr/sml/bugs/code/bug.159)
3555 :     signature SYMTAB =
3556 :     sig
3557 :     type ident
3558 :     end
3559 :    
3560 :     signature LEX =
3561 :     sig
3562 :     structure Symtab : SYMTAB
3563 :    
3564 :     datatype lexeme =
3565 :     ID of Symtab.ident
3566 :     | DELIM
3567 :     end
3568 :    
3569 :     structure Symtab =
3570 :     struct
3571 :     type ident = string
3572 :     end
3573 :    
3574 :     functor lex( symtab : SYMTAB ) =
3575 :     struct
3576 :     structure Symtab : SYMTAB = symtab
3577 :     datatype lexeme =
3578 :     ID of Symtab.ident
3579 :     | DELIM
3580 :     end
3581 :    
3582 :     structure Lex : LEX = lex( Symtab )
3583 :    
3584 :     Transcript:
3585 :     % sml
3586 :     Standard ML of New Jersey, Version 0.38, 23 August 1989
3587 :     val it = () : unit
3588 :     - use "smaller.sml"
3589 :     = ;
3590 :     [opening smaller.sml]
3591 :     signature SYMTAB =
3592 :     sig
3593 :     type ident
3594 :     end
3595 :     signature LEX =
3596 :     sig
3597 :     structure Symtab : sig...end
3598 :     datatype lexeme
3599 :     con DELIM : lexeme
3600 :     con ID : Symtab.ident -> lexeme
3601 :     end
3602 :     structure Symtab :
3603 :     sig
3604 :     eqtype ident
3605 :     end
3606 :     functor lex : <sig>
3607 :     structure Lex :
3608 :     sig
3609 :     structure Symtab : sig...end
3610 :     datatype lexeme
3611 :     con DELIM : lexeme
3612 :     con ID : smaller.sml, line 31: Error: Compiler bug: TypesUtil.lookTycPath.
3613 :     1
3614 :     [closing smaller.sml]
3615 :    
3616 :     Status: fixed in 0.43
3617 :     --------------------------------------------------------------------------------
3618 :     160. errorty fails to match sig spec
3619 :     Submitter: dbm
3620 :     Date: 18 Oct 89
3621 :     Version: 0.43
3622 :     System: Sun 3
3623 :     Problem: error type not matched in checking signature spec
3624 :     Messages:
3625 :     typing/functor.sml, line 363: Error: value type in structure doesn't match
3626 :     signature spec
3627 :     name: abstractBody
3628 :     spec: Structure * stampsets -> Structure
3629 :     actual: Structure * error -> Structure
3630 :     Status: fixed in 0.54
3631 :     --------------------------------------------------------------------------------
3632 :     161. nested functor calls
3633 :     Submitter: Don Sannella <dts%lfcs.edinburgh.ac.uk@NSFnet-Relay.AC.UK>
3634 :     Date: Tue, 17 Oct 89 18:29:27 BST
3635 :     Version: 0.39
3636 :     System: Sun 3
3637 :     Problem: nested functor calls broken
3638 :     Code:
3639 :     signature SIG =
3640 :     sig type t
3641 :     end;
3642 :    
3643 :     functor F(X : SIG) : SIG
3644 :     = struct type t = X.t
3645 :     end;
3646 :    
3647 :     (* Replacing output signature by its definition: no problem *)
3648 :     functor F'(X : SIG) : sig type t end
3649 :     = struct type t = X.t
3650 :     end;
3651 :    
3652 :     functor G(X : SIG) : SIG
3653 :     = struct type t = X.t
3654 :     end;
3655 :    
3656 :     functor H(X : SIG) : SIG = G(F(X));
3657 :    
3658 :     (* Replacing output signature by its definition: fails with exception Bind *)
3659 :     functor H'(X : SIG) : sig type t end = G(F(X));
3660 :     signature SIG =
3661 :     sig type t
3662 :     end;
3663 :    
3664 :     functor F(X : SIG) : SIG
3665 :     = struct type t = X.t
3666 :     end;
3667 :    
3668 :     (* Replacing output signature by its definition: no problem *)
3669 :     functor F'(X : SIG) : sig type t end
3670 :     = struct type t = X.t
3671 :     end;
3672 :    
3673 :     functor G(X : SIG) : SIG
3674 :     = struct type t = X.t
3675 :     end;
3676 :    
3677 :     functor H(X : SIG) : SIG = G(F(X));
3678 :    
3679 :     (* Replacing output signature by its definition: fails with exception Bind *)
3680 :     functor H'(X : SIG) : sig type t end = G(F(X));
3681 :     Status: fixed in 0.43
3682 :     --------------------------------------------------------------------------------
3683 :     162. ByteArray subscript exception expected
3684 :     Submitter: Jawahar Malhotra, Meta Software Corp.,
3685 :     malhotra%metasoft@bbn.com
3686 :     Date: 10/17/89
3687 :     Version: 0.33
3688 :     System: Sun OS 3.5
3689 :     Problem: ByteArray.extract doesn't raise Subscript exception when I
3690 :     think it should.
3691 :     Code:
3692 :     val ba = ByteArray.array(4,0);
3693 :    
3694 :     (* I feel that the following SHOULD raise an exception *)
3695 :     ByteArray.extract(ba,4,0);
3696 :    
3697 :     (* the following two statements CORRECTLY raise exceptions *)
3698 :    
3699 :     ByteArray.extract(ba,5,0);
3700 :     ByteArray.sub(ba,4);
3701 :     Status: not a bug
3702 :     --------------------------------------------------------------------------------
3703 :     163. function definition syntax
3704 :     Submitter: Andy Gordon, Cambridge University, adg@cl.cam.ac.uk
3705 :     Date: Mon Oct 16 15:26:44 1989
3706 :     Version: Version 0.33, 1 April 1989
3707 :     System: Sun
3708 :     Problem: another strange function definition
3709 :     Code:
3710 :     fun cps-fact n k = cps-fact n k;
3711 :     Messages:
3712 :     Error: Compiler bug: generalizeTy -- bad arg
3713 :     fact : 'S -> 'T -> undef
3714 :     Comments:
3715 :     Like in bug 73, I was mistakenly trying to define a function whose identifier
3716 :     contained a hyphen, but this time the compiler complains of a Compiler bug.
3717 :    
3718 :     Status: fixed in 0.54
3719 :     --------------------------------------------------------------------------------
3720 :     164. NS32 in makeml
3721 :     Submitter: Allan E. Johannesen, wpi, aej@wpi.wpi.edu
3722 :     Date: 13-Oct-1989
3723 :     Version: 0.39, maybe. That was the number in the README
3724 :     System: Encore
3725 :     Problem: makeml error
3726 :     Code: makeml -encore
3727 :     Messages: makeml: must specify machine type
3728 :     Comments:
3729 :    
3730 :     please put NS32 in $MACHINE case of makeml
3731 :    
3732 :     maybe:
3733 :    
3734 :     NS32)
3735 :     if test "$OPSYS" != BSD
3736 :     then
3737 :     echo "makeml: bad os ($OPSYS) for encore"
3738 :     exit 1
3739 :     fi
3740 :     if test -z "$MO"
3741 :     then
3742 :     MO="../mo.encore"
3743 :     fi
3744 :     MODULE="$MODULEKIND"Encore
3745 :     ;;
3746 :    
3747 :     Status: no support for NS32, unfortunately
3748 :     --------------------------------------------------------------------------------
3749 :     165. NS32 problem in export.c
3750 :     Submitter: Allan E. Johannesen, wpi, aej@wpi.wpi.edu
3751 :     Date: 13-Oct-1989
3752 :     Version: 0.39, maybe. That was the number in the README
3753 :     System: Encore
3754 :     Problem: compile error
3755 :     Code: makeml -encore
3756 :     Messages: "export.c", line 108: Undefined member: a_syms
3757 :     Comments:
3758 :    
3759 :     please change:
3760 :    
3761 :     #ifndef NS32
3762 :     E.a_syms = 0;
3763 :     #endif NS32
3764 :     E.a_syms = 0;
3765 :    
3766 :     to:
3767 :    
3768 :     #ifndef NS32
3769 :     E.a_syms = 0;
3770 :     #endif NS32
3771 :    
3772 :     Status: no support for NS32, unfortunately
3773 :     --------------------------------------------------------------------------------
3774 :     166. sparc code generator
3775 :     Submitter: Konrad Slind <slind%calgary.cdn@relay.CDNnet.CA>
3776 :     (also Soren Christensen, Aarhus, schristensen@daimi.dk)
3777 :     Date: 13 Oct 89 0:52 -0600
3778 :     Problem:
3779 :     On the Sparcstation 1, under SunOS 4.0.3c, I get the following error:
3780 :    
3781 :     $ sml4
3782 :     Standard ML of New Jersey, Version 0.39, 8 September 1989
3783 :     val it = () : unit
3784 :     - val z = ref " ";
3785 :     val z = ref " " : string ref
3786 :     - z := " ";
3787 :     Error: Compiler bug: [SparcCoder.move]
3788 :     ?exception Syntax in SparcCM.storeindexl
3789 :     - z := "\n";
3790 :     Illegal instruction - core dumped
3791 :     $
3792 :    
3793 :     On just a regular old Sun4, under SunOS 4.0.3_Export, the above runs
3794 :     correctly.
3795 :     Status: fixed in 0.43
3796 :     --------------------------------------------------------------------------------
3797 :     167. repeated bound type variables in type declaration
3798 :     Submitter: Nick Rothwell
3799 :     Date: 5 Oct 89
3800 :     Version: 0.39?
3801 :     System: Sun 3
3802 :     Problem: multiple binding occurences of type variable accepted
3803 :     Code:
3804 :     - datatype ('a, 'a, 'a) T = A of 'a | B of 'a;
3805 :     datatype ('a,'b,'c) T
3806 :     con A : 'a -> ('a,'b,'c) T
3807 :     con B : 'a -> ('a,'b,'c) T
3808 :     Status: fixed in 0.54
3809 :     --------------------------------------------------------------------------------
3810 :     168. profiling on sparc
3811 :     Submitter: Tom Murtagh ( tpm@rice.edu)
3812 :     Date: Oct 4, 1989
3813 :     Version: 0.38
3814 :     System: Sun4/SunOS 4.0.3c
3815 :     Problem: unhandled exception Match in codegenerator when Profiling enabled
3816 :    
3817 :     I stumbled across what appears to be another problem in the Sparc code
3818 :     generator. It seems to fail when any function is compiled with
3819 :     profiling enabled. This time I do have a minimal code fragment:
3820 :    
3821 :     % sml
3822 :     Standard ML of New Jersey, Version 0.38, 23 August 1989
3823 :     val it = () : unit
3824 :     - System.Control.Profile.profiling := true;
3825 :     val it = () : unit
3826 :     - (fn x => x);
3827 :     ?exception Match in SparcCM.storeindexl
3828 :     uncaught exception Match
3829 :    
3830 :     Status: fixed in 0.43 (?)
3831 :     --------------------------------------------------------------------------------
3832 :     169. inferring eqtypes in signatures
3833 :     Submitter: Randy Pollack <rap%lfcs.edinburgh.ac.uk@NSFnet-Relay.AC.UK>
3834 :     Date: Wed, 27 Sep 89
3835 :     Problem: NJML (V0.39) is too liberal in inferring eqtypes in signatures
3836 :     Code:
3837 :     - functor F() = struct abstype t = E with val mk_t = E end end;
3838 :     functor F : <sig>
3839 :     - structure f = F();
3840 :     structure f :
3841 :     sig
3842 :     eqtype t (*** incorrect ***)
3843 :     val mk_t : t
3844 :     end
3845 :    
3846 :     however:
3847 :    
3848 :     - structure f = struct abstype t = E with val mk_t = E end end;
3849 :     structure f :
3850 :     sig
3851 :     type t (*** correct ***)
3852 :     val mk_t : t
3853 :     end
3854 :     Priority: A
3855 :     Status: fixed in 0.52
3856 :     --------------------------------------------------------------------------------
3857 :     170. error in makeml script
3858 :     Submitter: sufrin%prg.oxford.ac.uk@NSFnet-Relay.AC.UK
3859 :     Date: Wed Sep 27
3860 :     Transcript:
3861 :     26 % makeml -sun3 -ionly -o smli -m 3
3862 :     (cd runtime; make clean)
3863 :     rm -f *.o lint.out prim.s linkdata allmo.s
3864 :     rm -f mo
3865 :     ln -s ../mo.m68 mo
3866 :     (cd runtime; rm -f run allmo.o)
3867 :     (cd runtime; make MACHINE=M68 linkdata)
3868 :     cc -O -DM68 -o linkdata linkdata.c
3869 :     runtime/linkdata [runtime/IntNull.mos] > runtime/allmo.o
3870 :     (cd runtime; make MACHINE=M68 'DEFS= -DSUN3 -DSUN3 -DBSD' 'CFL=-n -Bstatic -f68881' 'ASMBLR=as')
3871 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c run.c
3872 :     cc: Warning: Obsolete option -B
3873 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c gc.c
3874 :     cc: Warning: Obsolete option -B
3875 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c callgc.c
3876 :     cc: Warning: Obsolete option -B
3877 :     /lib/cpp -DM68 -DSUN3 -DSUN3 -DBSD M68.prim.s > prim.s
3878 :     as -o prim.o prim.s
3879 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c prof.c
3880 :     cc: Warning: Obsolete option -B
3881 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c export.c
3882 :     cc: Warning: Obsolete option -B
3883 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c objects.c
3884 :     cc: Warning: Obsolete option -B
3885 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c cstruct.c
3886 :     cc: Warning: Obsolete option -B
3887 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -mc68020 -c trace.c
3888 :     cc: Warning: Obsolete option -B
3889 :     cc -O -n -Bstatic -f68881 -DM68 -DSUN3 -DSUN3 -DBSD -o run run.o gc.o callgc.o prim.o prof.o export.o objects.o cstruct.o trace.o allmo.o
3890 :     cc: Warning: Obsolete option -B
3891 :     _Loader: ld: allmo.o: multiply defined
3892 :     *** Error code 2
3893 :     make: Fatal error: Command failed for target `run'
3894 :     echo (System.Control.interp := true; exportML "smli"; output std_out System.version; output std_out "\n"); | runtime/run -m 3 -r 20 -h 2048 IntNull
3895 :     makeml: runtime/run: cannot execute
3896 :    
3897 :     Status: fixed (or else, old version of SunOS went away)
3898 :     --------------------------------------------------------------------------------
3899 :     171. illegal datatype declaration accepted
3900 :     Submitter: Russ Green <rjg%lfcs.edinburgh.ac.uk@NSFnet-Relay.AC.UK>
3901 :     Date: Tue, 26 Sep 89
3902 :     Problem:
3903 :     New Jersey ML (version 0.39) accepts the following (illegal) declaration:
3904 :    
3905 :     datatype t = C1 | C1 of int
3906 :    
3907 :     (rule (30) of the version 3 language definition prohibits any two
3908 :     constructors from having the same identifier)
3909 :     Priority: A
3910 :     Status: fixed in 0.52
3911 :     --------------------------------------------------------------------------------
3912 :     172. functor subscript error
3913 :     Submitter: Simon Finn <simon%abstract-hardware-ltd.co.uk@NSFnet-Relay.AC.UK>
3914 :     Date: Tue, 26 Sep 89
3915 :     Problem:
3916 :     The following fragment breaks NJML (v0.39)
3917 :    
3918 :     signature SIG1 =
3919 :     sig
3920 :     type s
3921 :     end;
3922 :    
3923 :     signature SIG2 =
3924 :     sig
3925 :     type t
3926 :     val x : t
3927 :    
3928 :     structure Sub :
3929 :     sig
3930 :     val f : t -> t
3931 :     end;
3932 :     end;
3933 :    
3934 :     functor F (structure Struct1 : SIG1
3935 :     structure Struct2 : SIG2) =
3936 :     struct
3937 :     val fx = Struct2.Sub.f Struct2.x;
3938 :     end;
3939 :    
3940 :     Messages:
3941 :    
3942 :     = = = Error: operator and operand don't agree (tycon mismatch)
3943 :     operator domain: ?.t
3944 :     operand: ?.t
3945 :     in expression:
3946 :     f x
3947 :     = Error: Compiler bug: abstractType
3948 :    
3949 :     Comment:
3950 :     Almost any perturbation of the above seems to make the bug disappear, e.g.
3951 :     (1) removing "structure Struct1 : SIG1"
3952 :     (2) or removing "type s" from SIG1
3953 :     (3) or taking "f" out of "Sub" and putting it at the top level of "Struct2"
3954 :     [dbm] behavior is different under 43d2. It produces a lookTycPath subscript
3955 :     exception.
3956 :    
3957 :     Priority: A
3958 :     Status: fixed in 0.52
3959 :     --------------------------------------------------------------------------------
3960 :     173. Runbind
3961 :     Submitter: Andrew Tolmach (apt@princeton.edu)
3962 :     Date: 31 Aug 89
3963 :     Version: ... 0.43
3964 :     Problem:
3965 :     - val s = t;
3966 :     Error: unbound variable t
3967 :     - val s = t;
3968 :     Error: unbound variable t
3969 :     - s;
3970 :     uncaught exception Runbind
3971 :     Priority: A
3972 :     Status: fixed in 0.52
3973 :     --------------------------------------------------------------------------------
3974 :     174. import and types
3975 :     Submitter: Lars Bo Nielsen, Aalborg University, Strandvejen 19,
3976 :     9000 Aalborg, DENMARK.
3977 :     Email : lbn@iesd.auc.dk
3978 :    
3979 :     Date: Dec. 4 - 1989
3980 :    
3981 :     Version: 0.43
3982 :    
3983 :     System: Sun 3/260 -- SunOs 4.0.1
3984 :     Sun Sparc -- SunOs 4.0.3c
3985 :    
3986 :     Severity: I think this is VERY critical.
3987 :    
3988 :     Problem: Types of values in Functors is treated differently when
3989 :     imported and used. (Sorry hard to explain, see Code and
3990 :     Transcript).
3991 :     My code that compiled without problem with version 0.42,
3992 :     DIDN't compile under 0.43.
3993 :    
3994 :     Code: Refered to as file: pop.sml
3995 :     =================================
3996 :     signature ASig =
3997 :     sig
3998 :     datatype POP = a | b
3999 :     end
4000 :    
4001 :     signature BSig =
4002 :     sig
4003 :     structure DT : ASig
4004 :     val f : DT.POP -> unit
4005 :     end
4006 :    
4007 :     functor AFun () : ASig =
4008 :     struct
4009 :     datatype POP = a | b
4010 :     end
4011 :    
4012 :     functor BFun (structure DT : ASig) : BSig =
4013 :     struct
4014 :     structure DT = DT
4015 :     open DT
4016 :     val f = fn _ => output std_out "Is Running\n"
4017 :     end
4018 :    
4019 :    
4020 :     Transcript: NOTE "<--" are my notes
4021 :     ===================================
4022 :    
4023 :     Standard ML of New Jersey, Version 0.43, 27 November 1989
4024 :     val it = () : unit
4025 :     - use "pop.sml";
4026 :     [opening pop.sml] <-- USE the file
4027 :     signature ASig =
4028 :     sig
4029 :     datatype POP
4030 :     con a : POP
4031 :     con b : POP
4032 :     end
4033 :     signature BSig =
4034 :     sig
4035 :     structure DT : sig...end
4036 :     val f : DT.POP -> unit
4037 :     end
4038 :     functor AFun : <sig>
4039 :     functor BFun : <sig>
4040 :     [closing pop.sml]
4041 :     val it = () : unit
4042 :     - structure A = AFun();
4043 :     structure A :
4044 :     sig
4045 :     datatype POP
4046 :     con a : ?.POP
4047 :     con b : ?.POP
4048 :     end
4049 :     - structure B = BFun ( structure DT = A);
4050 :     structure B :
4051 :     sig
4052 :     structure DT : sig...end
4053 :     val f : A.POP -> unit <--- A.POP -> unit
4054 :     end
4055 :     - open A;
4056 :     type POP = POP
4057 :     - val test = a;
4058 :     val test = a : POP
4059 :     - B.f test;
4060 :     Is Running
4061 :     val it = () : unit
4062 :     -
4063 :     -
4064 :     -
4065 :     - import "pop";
4066 :     [reading pop.bin... done] <--- IMPORT the file
4067 :     signature ASig =
4068 :     sig
4069 :     datatype POP
4070 :     con a : POP
4071 :     con b : POP
4072 :     end
4073 :     signature BSig =
4074 :     sig
4075 :     structure DT : sig...end
4076 :     val f : DT.POP -> unit
4077 :     end
4078 :     functor AFun : <sig>
4079 :     functor BFun : <sig>
4080 :     - structure A = AFun();
4081 :     structure A :
4082 :     sig
4083 :     datatype POP
4084 :     con a : ?.POP
4085 :     con b : ?.POP
4086 :     end
4087 :     - structure B = BFun ( structure DT = A);
4088 :     structure B :
4089 :     sig
4090 :     structure DT : sig...end
4091 :     val f : ?.POP -> unit <-- ?.POP -> unit
4092 :     end
4093 :     - open A;
4094 :     type POP = POP
4095 :     - val test = a;
4096 :     val test = a : POP
4097 :     - B.f test;
4098 :     Error: operator and operand don't agree (tycon mismatch)
4099 :     operator domain: ?.POP
4100 :     operand: POP
4101 :     in expression:
4102 :     B.f test
4103 :     -
4104 :     Comments: I changed yesterday (Dec 3) from 0.42 to 0.43, and I have
4105 :     been trying all day (Dec 4) to solve my problem, until I
4106 :     made the little test above. During the solving periode I also
4107 :     had a lot of:
4108 :    
4109 :     ../file, line xxx: Error: structure sharing violation
4110 :    
4111 :     In that periode I was using "import", not "use". These
4112 :     error messages may show up to be caused by the same bug.
4113 :    
4114 :     Fix: Sorry, I'm not able to fix it. But I hope my example have
4115 :     given you enough input to track down the bug.
4116 :     Status: fixed in 0.53
4117 :     ------------------------------------------------------------------------------
4118 :     175. redundant module loading
4119 :     Submitter: Tom Gordon, thomas@gmdzi.uucp
4120 :     Date: 6 Mar 90
4121 :     Version: 0.44
4122 :     System: Sparc, Sun OS
4123 :     Severity: minor
4124 :     Problem: The module loader reloads functors and signatures
4125 :     which have already been loaded. This drastically slows down the edit,
4126 :     test, debug cycle. Shouldn't only those modules be reloaded which
4127 :     depend on files which have been, or need to be, recompiled?
4128 :     Status: a wish, not a bug (desideratum for sourcegroups)
4129 :     ------------------------------------------------------------------------------
4130 :     176. include and sharing
4131 :     Submitter: Nick
4132 :     Date: 2/26/90
4133 :     Version: 0.44
4134 :     Problem:
4135 :     Poly/ML accepts the following, New Jersey ML (44a) rejects it:
4136 :    
4137 :     signature INCLUDE_1 = sig type Ty val x: Ty end
4138 :     signature INCLUDE_2 = sig type Ty val y: Ty end
4139 :    
4140 :     signature BOTH =
4141 :     sig
4142 :     type T
4143 :     include INCLUDE_1 sharing type Ty = T
4144 :     include INCLUDE_2 sharing type Ty = T
4145 :     end
4146 :    
4147 :     functor F(Both: BOTH) =
4148 :     struct
4149 :     val _ = [Both.x, Both.y]
4150 :     end;
4151 :     Comment: exact semantics of include not yet defined
4152 :     Status: not a bug
4153 :     --------------------------------------------------------------------------------
4154 :     177. clinkdata on sun 3
4155 :     Submitter: Dave
4156 :     Date: 3/8/90
4157 :     Version: 0.52
4158 :     System: Sun3, SunOS 4.0.1
4159 :     Problem: clinkdata doesn't work
4160 :     Transcript:
4161 :     nun% makeml -sun3 -sunos -noclean
4162 :     rm -f mo
4163 :     ln -s ../mo.m68 mo
4164 :     (cd runtime; rm -f run allmo.o)
4165 :     (cd runtime; make -f Makefile MACHINE=M68 'DEFS= -DSUN3 -DBSD' clinkdata)
4166 :     cc -g -DM68 -DSUN3 -DBSD -o clinkdata clinkdata.c
4167 :     runtime/clinkdata [runtime/IntM68.mos]
4168 :     as: error (runtime/allmo.s:4): Invalid op-code
4169 :     (cd runtime; make -f Makefile MACHINE=M68 'DEFS= -DSUN3 -DBSD' 'CFL=-n -Bstatic
4170 :     -f68881' 'ASMBLR=as' 'WARNPRIM=@:')
4171 :     cc -g -n -Bstatic -f68881 -DM68 -DSUN3 -DBSD -o run run.o gc.o callgc.o M68.dep.
4172 :     o prim.o prof.o export.o objects.o cstruct.o errstrings.o allmo.o
4173 :     ld: allmo.o: bad string table index (pass 1)
4174 :     *** Error code 4
4175 :     make: Fatal error: Command failed for target `run'
4176 :     echo ( exportML "sml"; output std_out System.version; output std_out (chr 10) (*
4177 :     newline *)); | runtime/run -m 4096 -r 20 -h 2048 IntM68
4178 :     makeml: runtime/run: not found
4179 :     Status: fixed in 0.56
4180 :     --------------------------------------------------------------------------------
4181 :     178. Missing NS32.dep.c, NS32k port not working
4182 :     --------------------------------------------------------------------------------
4183 :     179. compiler bug (783 in sigmatch)
4184 :     Submitter: John Reppy
4185 :     Date: 2/15/90
4186 :     Version: 0.51
4187 :     Transcript:
4188 :     - structure A = GG(); (* GG is unbound *)
4189 :     std_in:1.16-1.17 Error: unbound functor identifier: GG
4190 :     Error: Compiler bug: 783 in sigmatch
4191 :     Comments: Have to create bogus functor
4192 :     Status: fixed in 0.56
4193 :     --------------------------------------------------------------------------------
4194 :     180. "sharing violation" error messages not informative
4195 :     Submitter: Nick
4196 :     Date: 2/15/90
4197 :     Version: 0.44
4198 :     Problem:
4199 :     ... the diagnostic messages for sharing mismatches are not really
4200 :     useable: having a single message "structure sharing violation" for 100
4201 :     lines of nested functor applications is no use, and I often have to
4202 :     recompile the entire system in Poly/ML just to get more verbose
4203 :     diagnostics with the context of the offending functor application and
4204 :     the names of the offending structures/types.
4205 :     Status: fixed before 0.65
4206 :     --------------------------------------------------------------------------------
4207 :     181. 8-bit characters not supported in strings
4208 :     Submitter: Fritz Ruehr (krf@dip.eecs.umich.edu)
4209 :     Date: 2/8/90
4210 :     Version: 0.44
4211 :     Problem:
4212 :     I am looking to read in 8 bit characters in SML-NJ. I can get UNIX
4213 :     to pass 8 bits back & forth, and SML-NJ will PRINT strings containing
4214 :     escaped "8-bit characters" (i.e., \nnn) as honest 8-bit output, but for
4215 :     the life of me I cannot get it to READ 8-bit characters when i put them in
4216 :     a string (I get an "Ord exception"). Is this intended behavior?
4217 :     Is there any workaround (say, a switch I didn't notice?)?
4218 :     Status: fixed in 0.54
4219 :     --------------------------------------------------------------------------------
4220 :     182. uncaught exception after exportFn
4221 :     Submitter: Andy Koenig
4222 :     Date: 1/31/90
4223 :     Version: 0.49 (still in 0.52)
4224 :     Problem:
4225 :     Unwanted uncaught exception message printed after exportFn is called.
4226 :     Messages:
4227 :     Standard ML of New Jersey, Version 0.49, 26 January 1990
4228 :     val it = () : unit
4229 :     - fun hello _ = print "hello world\n";
4230 :     val hello = fn : 'a -> unit
4231 :     - exportFn ("a.out", hello);
4232 :    
4233 :     [Major collection... 98% used (492360/498444), 3900 msec]
4234 :    
4235 :     [Major collection... 2% used (13020/494516), 100 msec]
4236 :    
4237 :     [Decreasing heap to 254k]
4238 :     uncaught exception SystemCall with "closed outstream"
4239 :     Comments: this can be cosmetically improved, but resumption after
4240 :     an exportFn is not expected to be implemented
4241 :     Status: fixed in 0.59
4242 :     ------------------------------------------------------------------------------
4243 :     183. "raise" not synchronized with evaluation sequence
4244 :     Submitter: Andrzej Filinski <andrzej@cs.cmu.edu>
4245 :     Date: Jan 20, 1990
4246 :     Version: 0.44, 4 December 1989
4247 :     System: VAX, 4.3 BSD (also Sun 3, 4.3 BSD)
4248 :     Severity: minor
4249 :     Problem: "raise" not properly synchronized to expression row evaluation
4250 :     Code: (raise e, s := 2);
4251 :     Transcript: - exception e;
4252 :     exception e
4253 :     - val s = ref 0;
4254 :     val s = ref 0 : int ref
4255 :     - (s := 1, raise e);
4256 :     uncaught exception e
4257 :     - s;
4258 :     val it = ref 1 : int ref [OK, did assignment first]
4259 :     - (raise e, s := 2);
4260 :     uncaught exception e
4261 :     - s;
4262 :     val it = ref 2 : int ref [did not raise e immediately]
4263 :     -
4264 :     Comments: This is pathological code, but the Standard does specify
4265 :     left-to-right evaluation of expression row components.
4266 :     Status: fixed (in 0.50?)
4267 :     ------------------------------------------------------------------------------
4268 :     184. bindings introduced by open are not printed
4269 :     Submitter: Andy Koenig
4270 :     Date: 1/30/90
4271 :     Version: 0.52
4272 :     Problem:
4273 :     After a top level open, the bindings introduced are not printed
4274 :     Comment: may provide a separate capability for requesting printing of signatures
4275 :     and other static info.
4276 :     Status: not a bug
4277 :     --------------------------------------------------------------------------------
4278 :     185. exportML size
4279 :     Submitter: Soren Christensen,
4280 :     University of Aarhus, Computer Science Dep.,
4281 :     Denmark
4282 :     schristensen@daimi.dk
4283 :     Date: 24 jan 90
4284 :     Version: 0.44
4285 :     System: Sun4/280 / SunOS 4.0.1
4286 :     Severity: ???
4287 :     Problem:
4288 :     Ussualy I have build my application by declaring a number of structures,
4289 :     this could be done using less than 45Mb of heapspace, even if I set the
4290 :     the flags like:
4291 :    
4292 :     System.Control.CG.reducemore := 0;
4293 :     System.Control.CG.rounds := 10;
4294 :     System.Control.CG.bodysize := 20;
4295 :    
4296 :     The system produced from an "exportML" of this takes up app. 3Mb.
4297 :    
4298 :     >From "doc/optimize" I learned that the code could be optimized by
4299 :     enclosing it in one structure. I did like:
4300 :    
4301 :     structure whole :
4302 :     sig
4303 :     < ... >
4304 :     end =
4305 :     struct
4306 :     <The usual stuff ..>
4307 :     end;
4308 :     open whole;
4309 :    
4310 :     It meant that the heapsize had to be increased to 80 Mb and I had to reset
4311 :     the above flags.
4312 :    
4313 :     I observed a bug in the reporting of GC:
4314 :     ...
4315 :     [Major collection... 76% used (18670576/24426980), 34260 msec]
4316 :    
4317 :     [Increasing heap to 59632k]
4318 :    
4319 :     [Major collection... -57% used (25033788/31118476), 44190 msec]
4320 :    
4321 :     [Increasing heap to 68216k]
4322 :    
4323 :     [Major collection... -35% used (30575468/34993364), 54880 msec]
4324 :     ...
4325 :    
4326 :     The "-57%" should be "80%" and the "-35%" should be "87%".
4327 :    
4328 :     But the main problem is that the CG before the "exportML" only decreases
4329 :     the heap to 49Mb, and then it stops with the message "export" - due to no
4330 :     disk space (?)
4331 :    
4332 :     Comments: (appel) Setting these flags for optimization may cause the
4333 :     code generator to generate very large output. Use at your own risk.
4334 :    
4335 :     Status: can't reproduce; the negative percent messages are fixed in 0.64
4336 :     -------------------------------------------------------------------------------
4337 :     186. type error matching against bogus tycon
4338 :     Submitter: Dave
4339 :     Date: 1/12/90
4340 :     Version: 0.52?
4341 :     Messages:
4342 :     Error: value type in structure doesn't match signature spec
4343 :     name: instantiate
4344 :     spec: Basics.tyvar * Basics.ty -> unit
4345 :     actual: ?.bogus * ?.bogus -> unit
4346 :     Status: can't reproduce
4347 :     --------------------------------------------------------------------------------
4348 :     187. parsing clausal definitions with infix functions
4349 :     Submitter: Mick Francis
4350 :     Date: 1/11/90
4351 :     Version: 0.44(?)
4352 :     Problem:
4353 :     1) Infix function declarations using parentheses do not parse. E.g.
4354 :     infix xxx;
4355 :     fun (a xxx b) = b; (* Will not compile *)
4356 :     fun (a xxx b) c = c; (* Will not compile *)
4357 :    
4358 :     2) When an infix identifier appears as the first of more than 2 formal
4359 :     parameters in a function declaration, if the second formal parameter
4360 :     is an identifier, an attempt is made to declare a function with this
4361 :     name. E.g.
4362 :     infix xxx;
4363 :     fun a xxx b c = c; (* Compiles function b ??? *)
4364 :     fun a xxx nil c = c; (* Tries to bind nil - error *)
4365 :    
4366 :     Gamma% njml
4367 :     Standard ML of New Jersey, Version 0.44a, 13 December 1989
4368 :     val it = () : unit
4369 :     - infix xxx;
4370 :     - fun (a xxx b) y = y; (* Should work *)
4371 :     Error: expected EQUAL, found RPAREN
4372 :     Error: atomic expression expected, found RPAREN
4373 :     Error: declaration or expression expected, found RPAREN
4374 :     - fun (a xxx b) = b; (* Should work *)
4375 :     Error: expected EQUAL, found RPAREN
4376 :     Error: atomic expression expected, found RPAREN
4377 :     Error: declaration or expression expected, found RPAREN
4378 :     - fun a xxx b y = y; (* Shouldn't compile *)
4379 :     val b = fn : 'a -> 'a
4380 :     - fun a xxx nil d = d;
4381 :     Error: improper use of constructor nil in pattern
4382 :     Error: Compiler bug: generalizeTy -- bad arg
4383 :     xxx : 'S * 'T -> undef
4384 :    
4385 :     Incidentally, Poly/ML gets the following wrong :-
4386 :     infix xxx;
4387 :     fun a xxx b d = d;
4388 :    
4389 :     It gives the message :-
4390 :     Error- Constructor (b) has not been declared Found near b(y)
4391 :    
4392 :     It appears to be looking for a pat, not an atpat on either side of the xxx.
4393 :     Status: fixed in 0.52
4394 :     --------------------------------------------------------------------------------
4395 :     188. infinite loop parsing simple functor declaration
4396 :     Submitter: Simon Finn
4397 :     Version: 0.44
4398 :     Problem:
4399 :     loops trying to compile the following definitions
4400 :     Code:
4401 :     signature TRIVSIG = sig end;
4402 :     functor A(X : TRIVSIG) : TRIVSIG = X;
4403 :     functor B(X : TRIVSIG) : TRIVSIG = A(X);
4404 :     Status: fixed in 0.50 or so
4405 :     ------------------------------------------------------------------------------
4406 :     189. confusing error message for bad clausal syntax
4407 :     Submitter: Carl Gunter
4408 :     Date: 1/4/90
4409 :     Version: 0.44/0.52
4410 :     Problem:
4411 :     Parser error message is not as helpful as it could be.
4412 :     Transcript
4413 :     - fun (f:('a pair -> int)) x = 2;
4414 :     std_in:3.5-3.24 Error: illegal function symbol in clause
4415 :     Status: fixed
4416 :     --------------------------------------------------------------------------------
4417 :     190. unclosed string in interactive system
4418 :     Submitter: Trevor
4419 :     Date: 1/5/90
4420 :     Version: 0.44
4421 :     System: SparcStation, SunOs
4422 :     Severity: no prob, bob
4423 :     Problem: error recovery on unclosed string in interactive system
4424 :     Transcript:
4425 :     - wf "/u/trevor/.login
4426 :     = "; (* Shouldn't have done this *)
4427 :     Error: unclosed string (* but this warning came too late *)
4428 :     = ;
4429 :     Error: unclosed string
4430 :     Error: operator is not a function
4431 :     operator: unit
4432 :     in expression:
4433 :     wf "" ""
4434 :     -
4435 :     Comments: Guess I shouldn't have tried to close the string after
4436 :     I hit return. But I should have seen an error message
4437 :     so I would know not to do this. The error message
4438 :     came one line too late.
4439 :     Comment by Appel: The lexer always wants to see the first character of the
4440 :     next token before processing the current token; this could be fixed
4441 :     but it's not worth it.
4442 :     Status: fixed in 0.52 (new parser)
4443 :     --------------------------------------------------------------------------------
4444 :     191. Real operators permuted
4445 :     Submitter: Peter Canning <canning@hplabs.hp.com>
4446 :     Date: 2 January 1990
4447 :     Version: 0.44
4448 :     System: Sun 3 running SUNOS 4.0
4449 :     Severity: critical
4450 :     Problem: Several functions in structure Real are incorrect
4451 :     Comments: order of operations in Real structure was wrong
4452 :     Status: fixed in 0.47
4453 :     --------------------------------------------------------------------------------
4454 :     192. bad parsing
4455 :     Submitter: John Reppy
4456 :     Date: 1/6/90
4457 :     Version: 0.44
4458 :     Transcript:
4459 :     Standard ML of New Jersey, Version 0.44, 4 December 1989
4460 :     val it = () : unit
4461 :     - map fn c => (c, ord c);
4462 :     val it = fn : ('a -> 'b) -> 'a list -> 'b list
4463 :     val it = fn : string -> string * int
4464 :     Status: fixed by new parser
4465 :     --------------------------------------------------------------------------------
4466 :     193. import types
4467 :     Submitter: Nick Rothwell
4468 :     Date: 1/5/90
4469 :     Version: 0.44a (0.44 with import fix)
4470 :     Problem:
4471 :     I've enclosed a bug in NJ SML 0.44a, based on a bug report I received
4472 :     from people at HP. I've managed to narrow it down to a simple example.
4473 :     It seems to be a strange interaction between the type import code of the
4474 :     separate compilation mechanism, the functor typechecking, and the checking
4475 :     of record types (of all things!). Unfortunately, I don't know anything about
4476 :     how types are imported under separate compilation, so I can't take it much
4477 :     further.
4478 :     Transcript:
4479 :     I enclose two files, A.sml and B.sml. B.sml is a simple script that imports
4480 :     A. Try the following: use "B.sml" (so that A gets imported and compiled), and
4481 :     then >exit the system<. Start another session and use "B.sml" again. You
4482 :     should get the following error:
4483 :    
4484 :     B.sml, line 8: Error: operator and operand don't agree (tycon mismatch)
4485 :     operator domain: {X:'S}
4486 :     operand: {X:int}
4487 :     in expression:
4488 :     FOO {X=3}
4489 :     Code:
4490 :     *** A.sml ***
4491 :     signature A =
4492 :     sig
4493 :     datatype 'a Foo = FOO of {X: 'a}
4494 :     (* Must be a record type to reproduce the bug. *)
4495 :     end;
4496 :    
4497 :     functor A(): A = (* Must have sig constraint to reproduce the bug *)
4498 :     struct
4499 :     datatype 'a Foo = FOO of {X: 'a}
4500 :     end;
4501 :    
4502 :     *** B.sml ***
4503 :     import "A";
4504 :    
4505 :     structure ??? = A(); (*Needed to reproduce the bug*)
4506 :    
4507 :     functor F(structure A: A) =
4508 :     struct
4509 :     val _ = A.FOO{X=3}
4510 :     end;
4511 :    
4512 :     Status: fixed in 0.54, fixed better in 0.57
4513 :     --------------------------------------------------------------------------------
4514 :     194. weak type variable syntax
4515 :     Submitter: David Tarditi
4516 :     Date: 12/17/89
4517 :     Version: 0.44?
4518 :     Problem:
4519 :     There seems to be one slight problem in the documentation on support
4520 :     for imperative type variables as described in the Standard. I took
4521 :     the documentation to mean that '_a is an abbreviation for '1a. This
4522 :     isn't true. If you try the code at the bottom, you'll see this.
4523 :     Code:
4524 :     (* Sample code: The second declaration of y causes a type error *)
4525 :     val x = fn (a,b) => (ref a; ref (a b));
4526 :     val y = x : ('1a -> '1b) * '1a -> '1b ref;
4527 :     val y = x : ('1a -> '1b) * '_a -> '_b ref
4528 :     Status: fixed in 0.54
4529 :     --------------------------------------------------------------------------------
4530 :     195. Compiler bug: abstractType
4531 :     Submitter: John Reppy
4532 :     Date: 2/12/89
4533 :     Version: 0.28
4534 :     Problem:
4535 :     I got a compiler bug message when working on my code generator. Unfortunately
4536 :     I wasn't able to reproduce it in a small example. When I fixed the type error,
4537 :     the bug message went away. I don't know if this is useful to you, but here it is:
4538 :     Transcript:
4539 :     - use "sparc/sparccoder.sml";
4540 :     [opening sparc/sparccoder.sml]
4541 :     sparc/sparccoder.sml, line 195: Error: operator and operand don't agree (tyco
4542 :     n mismatch)
4543 :     operator domain: register * reg_or_immed * register
4544 :     operand: register * register * register
4545 :     in expression:
4546 :     emit_subcc (a,b,g0)
4547 :     sparc/sparccoder.sml, line 210: Error: Compiler bug: abstractType
4548 :     [closing sparc/sparccoder.sml]
4549 :     Status: probably fixed in 0.54 (can't reproduce)
4550 :     --------------------------------------------------------------------------------
4551 :     196. Compiler bug: generalizeTy -- bad arg
4552 :     Submitter: Andrew Appel
4553 :     Date: 12/6/89
4554 :     Version: 0.44
4555 :     Problem:
4556 :     The following program yields Compiler bug: generalizeTy -- bad arg
4557 :     in version 0.44.
4558 :     Code:
4559 :     signature COMPLEX =
4560 :     sig
4561 :     type elem
4562 :     val complex: real*real -> elem
4563 :     val + : elem * elem -> elem
4564 :     val - : elem * elem -> elem
4565 :     val * : elem * elem -> elem
4566 :     val / : elem * elem -> elem
4567 :     val ~ : elem -> elem
4568 :     val inv: elem -> elem
4569 :     val abs : elem -> real
4570 :     val conj : elem -> elem
4571 :     val cis: real -> elem
4572 :     end
4573 :    
4574 :     abstraction Complex : COMPLEX =
4575 :     struct
4576 :     open Real
4577 :     type elem = real * real
4578 :     fun complex ri = ri
4579 :     val op + = fn ((a,b),(c,d)) => (a+c,b+d)
4580 :     and op - = fn ((a,b),(c,d)) => (a-c,b-d)
4581 :     and op * = fn ((a,b),(c,d)) => (a*c-b*d, a*d+b*c)
4582 :     and op / = fn ((a,b),(c,d)) => let val z = c*c+d*d
4583 :     in ((a*c+b*d)/z, (b*c-a*d)/z)
4584 :     end
4585 :     and inv = fn (a,b) => let val z = a*a+b*b in (a/z,b/z) end
4586 :     and ~ = fn (a,b) => (~a,~b)
4587 :     and abs = fn (a,b) => a*a+b*b
4588 :     and conj = fn (a,b) => (a,~b)
4589 :     and cis = fn t => (cos t, sin t)
4590 :     end
4591 :    
4592 :     signature FIELD =
4593 :     sig
4594 :     type elem
4595 :     val zero: elem
4596 :     val one: elem
4597 :     val + : elem * elem -> elem
4598 :     val * : elem * elem -> elem
4599 :     val inv: elem -> elem
4600 :     end
4601 :    
4602 :     signature POLYNOMIAL =
4603 :     sig
4604 :     structure F : FIELD
4605 :     type poly
4606 :     val x : poly
4607 :     val const : F.elem -> poly
4608 :     val * : poly * poly -> poly
4609 :     val + : poly * poly -> poly
4610 :     val ~ : poly -> poly
4611 :     val eval: poly -> F.elem -> F.elem
4612 :     val deriv: poly -> poly
4613 :     end
4614 :    
4615 :     functor Polynomial(F : FIELD) : POLYNOMIAL =
4616 :     struct
4617 :     structure F=F
4618 :     type poly = F.elem list
4619 :     val x = [F.zero,F.one]
4620 :     fun const c = [c]
4621 :     fun []+a = a
4622 :     | a+[] = a
4623 :     | (a::b) + (c::d) = F.+(a,c)::(b+d)
4624 :     fun scalarmult(a,[]) = []
4625 :     | scalarmult(a,b::c) = a*b::scalarmult(a,c)
4626 :     fun []*a = []
4627 :     | a*[] =