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 /bugs/branches/smlnj/bugs.0001-0200
ViewVC logotype

Annotation of /bugs/branches/smlnj/bugs.0001-0200

Parent Directory Parent Directory | Revision Log Revision Log


Revision 945 - (view) (download)

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