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/trunk/bugs.0801-1000
ViewVC logotype

Annotation of /bugs/trunk/bugs.0801-1000

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1338 - (view) (download)

1 : macqueen 944 Number: 801
2 :     Title: pretty printing problems
3 :     Keywords: printing, pretty printer
4 :     Submitter: John Reppy
5 :     Date: 8/5/93
6 :     Version: 0.93
7 :     Severity: serious
8 :     Problem:
9 :     I've discovered several problems with the Pretty Printing in 0.93:
10 :    
11 :     1) flush_ppstream does not seem to interact well with add_newline.
12 :     Here is the code of a simple example:
13 :    
14 :     (* pp-bug.sml
15 :     *
16 :     * executing "doit" causes the PP_FAIL exception to be raised; removing either
17 :     * the call to "flush_ppstream" or the "add_newline" avoids the exception.
18 :     *
19 :     * Also, if one doesn't have an enclosing block then PP_FAIL is raised on the
20 :     * first break.
21 :     *)
22 :    
23 :     fun pp ppStrm = let
24 :     open System.PrettyPrint
25 :     in
26 :     add_string ppStrm "hello";
27 :     add_newline ppStrm;
28 :     flush_ppstream ppStrm
29 :     end;
30 :    
31 :     fun doit () = pp (System.PrettyPrint.mk_ppstream{
32 :     consumer = IO.outputc IO.std_out,
33 :     linewidth = 80,
34 :     flush = fn () => IO.flush_out IO.std_out
35 :     });
36 :    
37 :     2) An "add_break" that doesn't have an enclosing block causes a PP_FAIL too.
38 :     There ought to be an implicit block around the entire sequence of operations
39 :     on a ppstream.
40 :    
41 :     3) The exception PP_FAIL is not visible at top-level, so it isn't possible to
42 :     get its string argument to understand the bug. Either, it should be
43 :     replaced by the Fail exception, or it should be made visible, or, at least,
44 :     the top-level exception handler should handle it.
45 :    
46 :     4) The structure PrettyPrint should be split into a library module that implements
47 :     pretty-printing, and a module for binding pretty-printers. Many applications
48 :     will use the former, but not the latter.
49 :    
50 :     Owner: dbm
51 :     Status: open
52 :     ----------------------------------------------------------------------
53 :     Number: 802
54 :     Title: missing signature PRETTYPRINT
55 :     Keywords:
56 :     Submitter: John Reppy
57 :     Date: 8/9/93
58 :     Version: 0.93
59 :     Severity: minor
60 :     Problem:
61 :     the signature PRETTYPRINT is not in the environment as advertised
62 :     Owner: dbm
63 :     Status: fixed in 109.30 [dbm, 7/14/97]
64 :     ---------------------------------------------------------------------
65 :     Number: 803
66 :     Title: Subscript exception during elaboration
67 :     Keywords:
68 :     Submitter: Andrew Appel
69 :     Date: 8/12/93
70 :     Version: 0.93
71 :     Severity: major
72 :     Problem:
73 :     There's a bug in elaborate when compiling the following file.
74 :     The message is "uncaught exception Subscript".
75 :     I suspect it has to do with the higher-order functors.
76 :     Code:
77 :     (* viscomp.sml *)
78 :    
79 :     signature PRINTHOOKS =
80 :     sig
81 :     (* all output goes to Control.Print.out *)
82 :     val prAbsyn : StaticEnv.staticEnv -> Absyn.dec -> unit
83 :     val prLambda : Lambda.lexp -> unit
84 :     val prLamFun : Lambda.lexp -> int -> unit
85 :     end
86 :    
87 :     signature VISCOMP =
88 :     sig
89 :     structure Stats : STATS
90 :     structure Control : CONTROL
91 :     structure Source : SOURCE
92 :     structure ErrorMsg : ERRORMSG
93 :     structure Symbol : SYMBOL
94 :     structure Index : INDEX
95 :     structure StaticEnv : STATICENV
96 :     structure DynamicEnv : DYNENV
97 :     structure Environment : ENVIRONMENT
98 :     structure ModuleId : MODULE_ID
99 :     structure ModuleTable: MODULE_TABLE
100 :     structure Watcher : WATCHER
101 :     structure Recorder : RECORDER
102 :     structure PickleEnv : PICKLE_ENV
103 :     structure PersStamps : PERSSTAMPS
104 :     structure PrettyPrint : PRETTYPRINT
105 :     structure Ast : AST
106 :     structure Compile : COMPILE
107 :     functor RegSpec : REGSPECFUN
108 :     functor CPSopt : CPSOPTFUN
109 :     functor CPStrans : CPSTRANSFUN
110 :     functor Convert : CONVERTFUN
111 :     functor Contract : CONTRACTFUN
112 :     functor Eta : ETAFUN
113 :     functor Expand : EXPANDFUN
114 :     functor Closure : CLOSUREFUN
115 :     functor Spill : SPILLFUN
116 :     structure Limit : LIMIT
117 :     functor CPSgen : CPSGENFUN
118 :     structure Interact : INTERACT
119 :     structure Machm : CODEGENERATOR
120 :     structure AllocProf : sig val reset : unit -> unit
121 :     val print : outstream -> unit
122 :     end
123 :     structure PrintHooks : PRINTHOOKS
124 :     val version : string
125 :     val architecture: string
126 :     end
127 :    
128 :     functor VisComp(Machm : CODEGENERATOR) =
129 :     struct
130 :     local structure V : VISCOMP =
131 :     struct
132 :     structure Stats = Stats
133 :     structure Control = Control
134 :     structure Source = Source
135 :     structure ErrorMsg = ErrorMsg
136 :     structure Symbol = Symbol
137 :     structure Index = Index
138 :     structure StaticEnv = StaticEnv
139 :     structure DynamicEnv = DynamicEnv
140 :     structure Environment = Environment
141 :     structure ModuleId = ModuleId
142 :     structure ModuleTable = ModuleTable
143 :     structure Watcher = Watcher
144 :     structure Recorder = Recorder
145 :     structure PickleEnv = PickleEnv
146 :     structure PersStamps = PersStamps
147 :     structure PrettyPrint = PrettyPrint
148 :     structure Ast = Ast
149 :     structure Compile = CompileF(Machm)
150 :     functor RegSpec = RegSpec
151 :     functor CPSopt = CPSopt
152 :     functor CPStrans = CPStrans
153 :     functor Convert = Convert
154 :     functor Contract = Contract
155 :     functor Eta = Eta
156 :     functor Expand = Expand
157 :     functor Closure = Closure
158 :     functor Spill = Spill
159 :     structure Limit = Limit
160 :     functor CPSgen = CPSgen
161 :     structure Interact = Interact(EvalLoopF(Compile))
162 :     structure Machm = Machm
163 :     structure AllocProf =
164 :     struct
165 :     val reset = AllocProf.reset
166 :     val print = AllocProf.print_profile_info
167 :     end
168 :     structure PrintHooks : PRINTHOOKS =
169 :     struct fun prAbsyn env d =
170 :     PrettyPrint.with_pp (ErrorMsg.defaultConsumer())
171 :     (fn ppstrm => PPAbsyn.ppDec(env,NONE) ppstrm (d,200))
172 :     fun prLambda lexp = (MCprint.printLexp lexp; print "\n")
173 :     fun prLamFun lexp v = (MCprint.printFun lexp v; print "\n")
174 :     end
175 :     val version = "Standard ML of New Jersey, Version 0.99, 13 August 1993"
176 :     val architecture = Machm.architecture
177 :     end
178 :     in open V
179 :     structure Lambda = Lambda
180 :     structure LambdaType = LambdaType
181 :     structure CPS = CPS
182 :     structure Intmap = Intmap
183 :     end
184 :     end
185 :     Comment: [dbm, 8/13/94] Almost certainly the same as bug 860.
186 :    
187 :     Status: fixed in 107 (dbm)
188 :     ----------------------------------------------------------------------
189 :     Number: 804
190 :     Title: Substring exception caused by decimal fractions
191 :     Keywords:
192 :     Submitter: Roderick Moten rodmoten@cs.cornell.edu
193 :     Date: 8/13/93
194 :     Version: 0.97
195 :     Severity: major
196 :     Problem:
197 :     The following cause a Substring exception to be raised.
198 :     val j = 0.5;
199 :     makestring 0.5;
200 :    
201 :     However
202 :     let val j = 0.5 in j + j end;
203 :     and
204 :     val j = 1.0
205 :     work fine.
206 :     Status: fixed in 1.02
207 :     ----------------------------------------------------------------------
208 :     Number: 805
209 :     Title: incompatibility between profiling and IO.execute (under A/UX)
210 :     Keywords:
211 :     Submitter: Richard Bornat <richard@dcs.qmw.ac.uk>
212 :     Date: 8/17/93
213 :     Version: 0.93
214 :     Severity: major
215 :     Problem:
216 :     The profiling tool issued with version 0.93 seems to be incompatible with
217 :     IO.execute.
218 :    
219 :     Symptoms:
220 :    
221 :     IO.execute works normally following Profile.profileOff(); after
222 :     Profile.profileOn() then the execute doesn't actually launch a new process.
223 :     This is on a Mac IIfx running A/UX 3.0; I don't know if it is an A/UX
224 :     problem or not.
225 :    
226 :     (Also, I'm having trouble with profiling and sourcegroups: presumably I
227 :     have to build smlp *and then* smlp.sg. Certainly it doesn't work the other
228 :     way around).
229 :    
230 :     Owner: John
231 :     Status: obsolete
232 :     ----------------------------------------------------------------------
233 :     Number: 806
234 :     Title: profiling under sourcegroup (or SC)
235 :     Keywords:
236 :     Submitter: Richard Bornat <richard@dcs.qmw.ac.uk>
237 :     Date: 8/17/93
238 :     Version: 0.93
239 :     Severity: major
240 :     Problem:
241 :     There seems to be no way (?) to make sourcegroups sensitive to the Profile
242 :     tool, so that stuff compiled by a sourcegroups compiler can't be profiled.
243 :    
244 :     I've tried compiling profile-script in an sg compiler; I've tried compiling
245 :     sg in a profiling compiler; nothing seems to do any good.
246 :    
247 :     Owner:
248 :     Status: obsolete
249 :     ----------------------------------------------------------------------
250 :     Number: 807
251 :     Title: nongeneric weak type variable error when not at top-level
252 :     Keywords:
253 :     Submitter: Dave Berry, daveb@harlequin.co.uk
254 :     Date: 8/18/93
255 :     Version: 0.93
256 :     System: SPARC, SUNOS 4.1.3
257 :     Severity: Minor?
258 :     Problem: nongeneric weak type variable error when not at top-level
259 :     Code:
260 :    
261 :     structure Foo =
262 :     struct
263 :     local
264 :     val r = ref NONE
265 :     in
266 :     end
267 :     end;
268 :    
269 :     Transcript:
270 :    
271 :     - structure Foo =
272 :     = struct
273 :     = local
274 :     = val r = ref NONE
275 :     = in
276 :     = end
277 :     = end;
278 :     std_in:15.1-15.14 Error: nongeneric weak type variable
279 :     r : '0Z option ref
280 :     -
281 :    
282 :     Comments:
283 :    
284 :     In version 0.75 this happens outside structures as well. In 0.93 it only
285 :     happens inside structures.
286 :    
287 :     Status: fixed in 1.05 (dbm-105b)
288 :     ----------------------------------------------------------------------
289 :     Number: 808
290 :     Title: directory stripping behavior of IO.execute
291 :     Keywords:
292 :     Submitter: Bernard Sufrin (Bernard.Sufrin@prg.oxford.ac.uk)
293 :     Date: 8/20/93
294 :     Version: 0.93
295 :     Problem:
296 :     In boot/perv.sml you go to some trouble to eliminate the
297 :     directory prefix of the pathname of the command being executed from
298 :     the ``zeroth'' argument as it appears in the argument list.
299 :    
300 :     The C shell -- and as far as I can tell other program-calling program
301 :     -- don't do this; moreover several programs need to know the path
302 :     via which they were executed, and this ``feature'' causes them some
303 :     confusion. Why not leave the decision whether or not to ``directory
304 :     strip'' up to the caller?
305 :    
306 :     =======
307 :    
308 :     fun execute_in_env (cmd, args, env) = let
309 :     fun basename s = let
310 :     val len = slength s
311 :     fun f i = if ieql(i, len)
312 :     then s
313 :     else if ieql(ordof(s, i), 47 (* ordof "/" *))
314 :     then g (i+1, i+1)
315 :     else f (i+1)
316 :     and g (base, i) = if ieql(i, len)
317 :     then PreString.substring(s, base, len-base)
318 :     else if ieql(ordof(s, i), 47 (* ordof "/" *))
319 :     then g (i+1, i+1)
320 :     else g (base, i+1)
321 :     in
322 :     f 0
323 :     end
324 :     fun mapCString [] = []
325 :     | mapCString (s::r) = (c_string s)::(mapCString r)
326 :     val cArgs = mapCString ((basename cmd) :: args)
327 :     val cEnv = mapCString env
328 :     val (fdin, fdout) = exec (c_string cmd, cArgs, cEnv)
329 :    
330 :     Owner: John
331 :     Status: obsolete [new basis]
332 :     ----------------------------------------------------------------------
333 :     Number: 809
334 :     Title: transFctLty compiler bug
335 :     Keywords:
336 :     Submitter: Appel
337 :     Date: 9/16/93
338 :     System(s) and Version: MIPS (presumably all)
339 :     SML/NJ Version: 1.00
340 :     Machine: MIPS
341 :     Severity: minor
342 :     Problem: compiler bug
343 :     Code:
344 :    
345 :     funsig A() = sig end
346 :    
347 :     functor F(functor S : A) = struct end
348 :     funsig FS () = sig end
349 :    
350 :     signature U = sig functor FF : FS end
351 :    
352 :     structure T : U =
353 :     struct functor FF = F
354 :     end
355 :    
356 :     Transcript:
357 :    
358 :     bug.sml:8.11-10.3 Error: unmatched structure spec: S
359 :     Error: Compiler bug: transFctLty on wrong objects
360 :    
361 :     Fix: added "ERROR_FCT => BOGUSty" to two matches, in transFctLty,
362 :     and transFctLty0.
363 :    
364 :     Status: fixed in 1.05b --- dbm/105b
365 :     ----------------------------------------------------------------------
366 :     Number: 810
367 :     Title: signatureless abstractions
368 :     Keywords:
369 :     Submitter: Andrew Appel
370 :     Date: 9/21/93
371 :     Version: 1.01
372 :     Severity: major
373 :     Problem:
374 :     abstraction declaration without a signature constraint is accepted.
375 :     Code:
376 :     Transcript:
377 :     Standard ML of New Jersey, Version 1.01, 16 September 1993
378 :     - abstraction S = struct val x = 6 end;
379 :     structure S : sig val x : int end
380 :     -
381 :     Status: fixed in 1.02
382 :     ----------------------------------------------------------------------
383 :     Number: 811
384 :     Title: Unix.exit does not flush open streams
385 :     Keywords:
386 :     Submitter: Emden R. Gansner, erg@ulysses.att.com
387 :     Date: 9/22/93
388 :     Version: 1.01
389 :     System: all
390 :     Severity: minor
391 :     Problem: Unix.exit does not flush open streams
392 :     Code:
393 :     Transcript:
394 :     Standard ML of New Jersey, Version 1.01, 16 September 1993 [SC 56a]
395 :     val it = () : unit
396 :     - fun main(_,_) = (print "hello\n"; System.Unix.exit 0);
397 :     val main = fn : 'a * 'b -> 'c
398 :     - exportFn ("tst",main);
399 :    
400 :     [Major collection... 99% used (2253660/2271116), 730 msec]
401 :    
402 :     [Major collection... 0% used (5988/2259160), 0 msec]
403 :    
404 :     [Decreasing heap to 295k]
405 :     w) ./tst
406 :     hello
407 :     w) ./tst > out
408 :     w) cat out
409 :     w)
410 :    
411 :     Comments: Since exit was promoted out of Unsafe to Unix, it seems
412 :     reasonable to adopt Unix semantics and have it flush open streams.
413 :    
414 :     [Mikael Pettersson (mpe@ida.liu.se), 8/25/94]
415 :     If the final "System.Unix.exit 0" is replaced with
416 :     "System.CleanUp.cleanup System.CleanUp.CleanForQuit; System.Unix.exit_ 0"
417 :     then the buffer flushing works as it should.
418 :     BUT, unless I am very much mistaken, this is how System.Unix.exit was
419 :     defined in the first place...
420 :    
421 :     Owner: John
422 :     Status: obsolete [new basis]
423 :     ----------------------------------------------------------------------
424 :     Number: 812
425 :     Title: strange floating point error
426 :     Keywords:
427 :     Submitter: Mr. Jon S. Squire <squire@umbc.edu>
428 :     Date: 9/21/93
429 :     Version: 0.93
430 :     System: SGI IRIX 4.0.5c
431 :     Severity: minor
432 :     Problem:
433 :     code dies with "strange floating point error, 14." Then exits sml.
434 :     Code:
435 :     fun how_big(x:real):unit*unit*real = (print x, print "\n", #3(how_big(2.0*x)));
436 :    
437 :     how_big 2.0; (* should give largest value then "uncaught exception Overflow"*)
438 :     Comments:
439 :     generally seems to problem in C library when IEEE arithmetic returns infinity
440 :     Owner:
441 :     Status: fixed in 109.21
442 :     ----------------------------------------------------------------------
443 :     Number: 813
444 :     Title: limited length of directory name in cd
445 :     Keywords:
446 :     Submitter: Zhong Shao (zsh@cs.princeton.edu)
447 :     Date: 9/26/93
448 :     Version: 101
449 :     System: Decstation Ultrix
450 :     Severity: minor
451 :     Problem: limited length of directory name in cd
452 :     Code:
453 :     (* There is a sub-directory called "knuth-bendix" in the current directory *)
454 :    
455 :     System.Directory.cd "knuth-bendix";
456 :    
457 :     (* There is a sub-directory called "knuth-bendi" in the current directory *)
458 :    
459 :     System.Directory.cd "knuth-bendi";
460 :    
461 :     Transcript:
462 :    
463 :     - System.Directory.cd "knuth-bendix";
464 :    
465 :     uncaught exception NotDirectory
466 :     - System.Directory.cd "knuth-bendi";
467 :     val it = () : unit
468 :    
469 :     Comments: As long as the directory name is longer than 11 charaters,
470 :     the System.Directory.cd raises the NotDirectory exception.
471 :     [dbm] Works ok for OS.FileSys.chDir in 109.21.
472 :    
473 :     Owner:
474 :     Status: obsolete
475 :     ----------------------------------------------------------------------
476 :     Number: 814
477 :     Title: missing install_pp
478 :     Keywords:
479 :     Submitter: Elsa Gunter
480 :     Date: 9/29/93
481 :     Version: 101
482 :     Severity: major
483 :     Problem:
484 :     install_pp is now in PPTable: PPTABLE, which is not incorporated
485 :     in Compiler
486 :     Fix:
487 :     Add PPTable to VISCOMP and VisComp in build/viscomp.sml.
488 :     Status: fixed in 1.02 (access via PPTable)
489 :     ----------------------------------------------------------------------
490 :     Number: 815
491 :     Title: incorrect paths printed for types (missing structures)
492 :     Keywords:
493 :     Submitter: Dave MacQueen
494 :     Date: 10/13/93
495 :     Version: 102d
496 :     Severity: major
497 :     Problem: incorrect paths printed for types (missing structures)
498 :     Code:
499 :     functor F(X: sig functor G() : sig type t end end) =
500 :     struct
501 :     structure A = X.G()
502 :     end;
503 :    
504 :     structure Rint = F(struct functor G() = struct type t = int end end);
505 :    
506 :     structure Rbool = F(struct functor G() = struct type t = bool end end);
507 :    
508 :     Transcript:
509 :     Standard ML of New Jersey, Version 1.01, 16 September 1993
510 :     - use "hack.sml";
511 :     [opening hack.sml]
512 :     functor F : <sig>
513 :     structure Rint : sig structure A : ...
514 :     end
515 :     structure Rbool : sig structure A : ...
516 :     end
517 :     val it = () : unit
518 :     - 3: Rint.A.t;
519 :     val it = 3 : ?.Rint.t
520 :     - true : Rbool.A.t;
521 :     val it = true : ?.Rbool.t
522 :     - 3 : Rbool.A.t;
523 :     std_in:5.1-5.13 Error: expression and constraint don't agree (tycon mismatch)
524 :     expression: int
525 :     constraint: ?.Rbool.t
526 :     in expression:
527 :     3
528 :     Fix:
529 :     Add path field to APPLY variant of Functor type.
530 :     Status: fixed in 1.06 (dbm-106a)
531 :     ----------------------------------------------------------------------
532 :     Number: 816
533 :     Title: repeated component names in signatures
534 :     Keywords:
535 :     Submitter: Mark Lillibridge (mdl@cs.cmu.edu)
536 :     Date: 10/4/93
537 :     SML/NJ Version: 0.93, February 15, 1993
538 :     Machine: DECstation 5000/125, MACH OS
539 :     Severity: minor
540 :     Problem:
541 :    
542 :     The handling of field names in signatures is screwed up. A
543 :     perfectly legal program fragment is rejected simply because it repeats a
544 :     field name in two different structure specs. (See code & transcript
545 :     example) Note that renaming the outer structure results in the error
546 :     going away.
547 :    
548 :     Code:
549 :     signature s =
550 :     sig
551 :     structure a :
552 :     sig
553 :     structure a : sig type t end
554 :     val x : a.t
555 :     end
556 :     end;
557 :    
558 :     Transcript:
559 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
560 :     val it = () : unit
561 :     - use "sml-bug2.sml";
562 :     [opening sml-bug2.sml]
563 :     sml-bug2.sml:5.11-5.13 Error: unbound structure: a in path a.a.t
564 :     -
565 :    
566 :     Comments:
567 :    
568 :     There are undoubtly other bugs caused by the same underlying
569 :     problem. A similar problem may exist for structure definitions. I
570 :     regard this as a minor bug because it can always be programmed around by
571 :     never repeating structure names in a structure and its components.
572 :    
573 :     Owner:
574 :     Status: fixed in 109.21
575 :     ----------------------------------------------------------------------
576 :     Number: 817
577 :     Title: spec scope confusion
578 :     Keywords:
579 :     Submitter: Mark Lillibridge (mdl@cs.cmu.edu)
580 :     Date: 10/4/93
581 :     SML/NJ Version: 0.93, February 15, 1993
582 :     Machine: DECstation 5000/125, MACH OS
583 :     Severity: minor
584 :     Problem:
585 :    
586 :     This is probably related to the last bug report I sent in (bug
587 :     816). SML/NJ seems to think (incorrectly) that the scope of a
588 :     structure spec in a signature starts immediately instead of after the
589 :     spec is completed. It does this both on output and input of
590 :     signatures, resulting in illegal signatures being both accepted and
591 :     printed. The third example below demonstrates how this sometimes
592 :     results in signatures being read incorrectly.
593 :    
594 :     Code:
595 :    
596 :     Compiler.Control.Print.signatures := 20;
597 :    
598 :     signature prints_wrong = sig
599 :     structure y : sig
600 :     type b
601 :     val x : b
602 :     end
603 :     end;
604 :    
605 :     signature illegal_sig = sig
606 :     structure y : sig
607 :     type b
608 :     val x : y.b
609 :     end
610 :     end;
611 :    
612 :    
613 :     signature wrong_sig =
614 :     sig
615 :     structure y : sig type b end
616 :     structure z : sig
617 :     structure y : sig
618 :     type b
619 :     val x : y.b
620 :     end
621 :     end
622 :     end;
623 :    
624 :     Transcript:
625 :    
626 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
627 :     val it = () : unit
628 :     - use "sml-bug.sml";
629 :     [opening sml-bug.sml]
630 :     val it = () : unit
631 :     signature prints_wrong =
632 :     sig
633 :     structure y :
634 :     sig
635 :     type b
636 :     val x : y.b [Wrong! No y in scope here]
637 :     end
638 :     end
639 :     signature illegal_sig =
640 :     sig
641 :     structure y :
642 :     sig
643 :     type b
644 :     val x : y.b [Ditto!]
645 :     end
646 :     end
647 :     signature read_wrong_sig =
648 :     sig
649 :     structure y : sig type b end
650 :     structure z :
651 :     sig
652 :     structure y :
653 :     sig
654 :     type b
655 :     val x : z.y.b [Wrong! This should refer to the ]
656 :     end [first b, not the second. Also, z]
657 :     end [is not in scope here.]
658 :     end
659 :     val it = () : unit
660 :     -
661 :    
662 :     Comments:
663 :    
664 :     The type of x in prints_wrong show print as just "b". The
665 :     second signature is not legal and should be rejected. (Note that there
666 :     is no y structure floating around here at top level.) The type of x in
667 :     read_wrong_sig should be "y.b".
668 :    
669 :     Owner:
670 :     Status: fixed in 109.21
671 :     ----------------------------------------------------------------------
672 :     Number: 818
673 :     Title: Compiler bug: UsageMap on .... in cps/contract.sml
674 :     Keywords:
675 :     Submitter: Zhong Shao (zsh@cs.princeton.edu)
676 :     Date: 10/6/93
677 :     Version: 1.01*
678 :     System: Decstation Ultrix
679 :     Severity: minor
680 :     Problem: Compiler bug: UsageMap on .... in cps/contract.sml
681 :     Code:
682 :     (* for a compiler with representation analysis turned off and
683 :     argument flattening turned on *)
684 :    
685 :     Compiler.Control.CG.representations;
686 :     Compiler.Control.CG.flattenargs;
687 :     use "bmark.sig";
688 :     use "vliw.sml"; (* standard vliw benchmark *)
689 :    
690 :    
691 :     Transcript:
692 :    
693 :     (* Compiler.Control.CG.representations = ref false *)
694 :     (* Compiler.Control.CG.flattenargs = ref true *)
695 :    
696 :     [opening vliw.sml]
697 :     vliw.sml:3504.2-3504.22 Warning: match nonexhaustive
698 :     INT i => ...
699 :    
700 :     vliw.sml:3307.3-3401.30 Warning: match nonexhaustive
701 :     FETCH {dst=(d,_),immutable=_,offset=ofst,ptr=(p,_)} => ...
702 :     STORE {offset=ofst,ptr=(p,_),src=(s,_)} => ...
703 :     GETLAB {dst=(d,_),lab=(l,_)} => ...
704 :     GETREAL {dst=(d,_),value=v} => ...
705 :     MOVE {dst=(d,_),src=(s,_)} => ...
706 :     ARITH {dst=(d,_),oper=opn,src1=(s1,_),src2=(s2,_)} => ...
707 :     ARITHI {dst=(d,_),oper=opn,src1=(s1,_),src2=n1} => ...
708 :     JUMP {dst=(d,_),live=_} => ...
709 :     BRANCH {dst=(labnum,_),live=_,src1=(s1,_),src2=(s2,_),
710 :     test=comp} => ...
711 :     NOP => ...
712 :     LABEL {lab=_,live=_} => ...
713 :     LABWORD {lab=_} => ...
714 :     WORD {value=_} => ...
715 :    
716 :     Error: Compiler bug: UsageMap on 49077
717 :    
718 :     Comments: UsageMap is an exception defined in the new contract.sml.
719 :     This bug only occurs in compilers that does not do
720 :     representation analysis but does do argument flattening.
721 :    
722 :     Status: fixed in 1.03f
723 :     ----------------------------------------------------------------------
724 :     Number: 819
725 :     Title: changes for 386bsd
726 :     Keywords:
727 :     Submitter: Mark H. Linderman (linder@box.EE.CORNELL.EDU)
728 :     via Mark Leone (mleone@cs.cmu.edu)
729 :     Date: 10/5/93
730 :     System(s) and Version: 386bsd
731 :     SML/NJ Version: 0.93
732 :     Machine: 386/486 PCs running 386bsd (*not* bsd/386)
733 :     Severity: minor
734 :     Problem: Getting SML/NJ to run under 386bsd
735 :     Code:
736 :     Transcript:
737 :     Comments:
738 :     386bsd is a free bsd implementation for 386/486 machines. It is based
739 :     on the net2 release of bsd, and was ported by Bill and Lynne Jolitz.
740 :     It's available by anonymous ftp at agate.berkeley.edu. It's not the
741 :     same as bsd/386, which is a commercial product by BSDI.
742 :    
743 :     The current 386 Mach/BSD runtime works fine under 386bsd except for
744 :     export, because 386bsd uses a different executable file format. A
745 :     quick-and-dirty fix is to build the compiler with "-i386 bsd386" after
746 :     applying the patch below.
747 :    
748 :     A better approach would be to add a new flag to makeml, #define a new
749 :     symbol (say, NET386BSD), and add that symbol to the appropriate
750 :     #ifdefs. The documentation should also be updated to indicate that
751 :     we now support this OS.
752 :    
753 :    
754 :     *** export.c.dist Tue Nov 17 18:05:23 1992
755 :     --- export.c Mon Dec 21 11:15:47 1992
756 :     ***************
757 :     *** 108,121 ****
758 :     # define ZMAGIC 0413
759 :     #endif
760 :    
761 :     - #ifdef BSD386
762 :     - # ifdef ZMAGIC
763 :     - # undef ZMAGIC
764 :     - # endif ZMAGIC
765 :     - #define ZMAGIC QMAGIC
766 :     - #endif BSD386
767 :     -
768 :     -
769 :     /* Garbage collection is already done.
770 :     * Data to be saved is:
771 :     * 0 -> ceil(etext) text
772 :     --- 108,113 ----
773 :     ***************
774 :     *** 232,238 ****
775 :    
776 :     }
777 :     #endif
778 :     ! #if sony_news || MORE
779 :     {int i, nzeros = getpagesize()-bytcount;
780 :     char zeros[4096];
781 :     for(i=0;i<nzeros;i++) zeros[i]=0;
782 :     --- 224,230 ----
783 :    
784 :     }
785 :     #endif
786 :     ! #if sony_news || MORE || defined(BSD386)
787 :     {int i, nzeros = getpagesize()-bytcount;
788 :     char zeros[4096];
789 :     for(i=0;i<nzeros;i++) zeros[i]=0;
790 :     ***************
791 :     *** 245,251 ****
792 :     lseek(filid,N_DATADDR(E),0);
793 :     bulletproofWrite(filid,CEIL(ETEXT,getpagesize()),E.a_data);
794 :     #else
795 :     ! #if defined(SPARC) && defined(MACH) || defined(BSD386)
796 :     bulletproofWrite(filid,textstart+sizeof(E),E.a_text-sizeof(E));
797 :     #else
798 :     # if defined(DYNIX)
799 :     --- 237,243 ----
800 :     lseek(filid,N_DATADDR(E),0);
801 :     bulletproofWrite(filid,CEIL(ETEXT,getpagesize()),E.a_data);
802 :     #else
803 :     ! #if defined(SPARC) && defined(MACH)
804 :     bulletproofWrite(filid,textstart+sizeof(E),E.a_text-sizeof(E));
805 :     #else
806 :     # if defined(DYNIX)
807 :    
808 :     Comment:
809 :     I forgot to mention: the bsd/386 signal handling patches (e.g. #ifdef
810 :     BSD386 in signal.c) should also be used for 386bsd. Also, Ken Cline
811 :     (cline@cs.cmu.edu) independently discovered these fixes.
812 :    
813 :     Owner:
814 :     Status: obsolete
815 :     ----------------------------------------------------------------------
816 :     Number: 820
817 :     Title: execute binding in debugger
818 :     Keywords:
819 :     Submitter: Elsa L. Gunter, elsa@research.att.com
820 :     Date: 10/18/93
821 :     Version: 93-debugger (and probably any other version of the debugger)
822 :     System: all
823 :     Problem: execute is bound differently in the top-level than in sml
824 :     Code:
825 :     val (I,O) = execute("/bin/date",[]);
826 :    
827 :     Transcript:
828 :    
829 :     tiree% /usr/local/sml/bin/sparc/smld
830 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
831 :     val it = () : unit
832 :     - execute;
833 :     val it = fn : string -> unit
834 :     - val (I,O) = execute("/bin/date",[]);
835 :     std_in:3.1-3.35 Error: operator and operand don't agree (tycon mismatch)
836 :     operator domain: string
837 :     operand: string * 'Z list
838 :     in expression:
839 :     execute ("/bin/date",nil)
840 :    
841 :    
842 :     tiree% /usr/local/sml/bin/sparc/sml
843 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
844 :     val it = () : unit
845 :     - execute;
846 :     val it = fn : string * string list -> instream * outstream
847 :     - val (I,O) = execute("/bin/date",[]);
848 :     val I = - : instream
849 :     val O = - : outstream
850 :    
851 :    
852 :     Comments:
853 :     The version of execute that is in the top-level loop of sml can be
854 :     found as IO.execute in smld.
855 :    
856 :     Fix:
857 :     Rename UserDebugCommands.execute in dbguser/commands.sml to something
858 :     else. Perhaps this is too extreme, but it is awkward having the same
859 :     identifier bound to different functions in the top level of sml and
860 :     smld.
861 :    
862 :     Owner:
863 :     Status: obsolete
864 :     ----------------------------------------------------------------------
865 :     Number: 821
866 :     Title: Compiler bug: Instantiate:explore_tclass.5
867 :     Keywords:
868 :     Submitter: Zhong Shao (zsh@cs.princeton.edu)
869 :     Date: 10/21/93
870 :     Version: 1.01
871 :     System: Decstation Ultrix
872 :     Severity: major
873 :     Problem: Compiler bug: Instantiate:explore_tclass.5
874 :     Code:
875 :     (* the standard ML-YACC benchmark *)
876 :    
877 :     use "yacc.sml";
878 :    
879 :     Transcript:
880 :    
881 :     Standard ML of New Jersey, Version 1.01, 16 September 1993
882 :     - use "yacc.sml";
883 :     [opening yacc.sml]
884 :    
885 :     [Major collection... 63% used (2661924/4210724), 1816 msec]
886 :    
887 :     [Increasing heap to 8192k]
888 :    
889 :     [Major collection... 89% used (3775408/4229428), 2656 msec]
890 :    
891 :     [Increasing heap to 11388k]
892 :    
893 :     [Major collection... 84% used (4944692/5860300), 3437 msec]
894 :    
895 :     [Increasing heap to 14764k]
896 :    
897 :     [Major collection... 39% used (3011648/7591656), 2129 msec]
898 :    
899 :     [Decreasing heap to 9008k]
900 :     yacc.sml:1488.1-1586.3 Error: The constructor PARSER_NAME of datatype control
901 :     has different representations in the signature and the structure.
902 :     Change the definition of the types carried by the constructors in the
903 :     functor formal parameter and the functor actual parameter so that
904 :     they are both abstract, or so that neither is abstract.
905 :    
906 :     Error: Compiler bug: Instantiate:explore_tclass.5
907 :     -
908 :    
909 :     Comments: No problem for complaining about the different datatype
910 :     representations. But the warning about "Instantiate:
911 :     explore_tclass.5" is obviously a bug. This bug doesnot
912 :     occur if I turn the Compiler.Control.CG.newconreps flag off.
913 :     However, the bug does not show up on the following simple
914 :     program either,
915 :    
916 :     signature HEADER =
917 :     sig
918 :     type symbol
919 :     datatype control = NODEFAULT | VERBOSE | PARSER_NAME of symbol
920 :     end
921 :    
922 :     functor HeaderFun () : HEADER =
923 :     struct
924 :     type symbol = string * int
925 :     datatype control = NODEFAULT | VERBOSE | PARSER_NAME of symbol
926 :     end
927 :     structure A : HEADER = HeaderFun()
928 :     Owner:
929 :     Status: obsolete
930 :     ----------------------------------------------------------------------
931 :     Number: 822
932 :     Title: Compiler bug: compType/checkweak (as secondary error)
933 :     Keywords:
934 :     Submitter: Emden R. Gansner, erg@research.att.com
935 :     Date: 10/25/93
936 :     Version: 1.01
937 :     System: all
938 :     Severity: minor
939 :     Problem: Compiler bug reported on bad code
940 :     Code:
941 :    
942 :     (* file: bug.sml *)
943 :     signature STATIC_ARRAY =
944 :     sig
945 :     type elem
946 :     type array
947 :     val array : int * elem -> array
948 :     end
949 :    
950 :     functor DynamicArray (A : STATIC_ARRAY) = struct end
951 :    
952 :     structure ModGraph =
953 :     struct
954 :     structure NodesArray = DynamicArray (struct
955 :     type elem = G.node list
956 :     type array = elem Array.array
957 :     val array = Array.array
958 :     end)
959 :     end
960 :    
961 :     Transcript:
962 :    
963 :     - use "bug.sml";
964 :     [opening bug.sml]
965 :     bug.sml:15.21-15.26 Error: unbound structure: G in path G.node
966 :     Error: Compiler bug: compType/checkweak
967 :     -
968 :    
969 :     Owner:
970 :     Status: obsolete
971 :     ----------------------------------------------------------------------
972 :     Number: 823
973 :     Title: quot and div are identical
974 :     Keywords:
975 :     Submitter: Emden R. Gansner, erg@research.att.com
976 :     Date: 11/2/93
977 :     Version: 1.01
978 :     System: all
979 :     Severity: minor
980 :     Problem: quot and div are identical
981 :     Code:
982 :     Transcript:
983 :    
984 :     - ~3 div 2;
985 :     val it = ~2 : int
986 :     - ~3 quot 2;
987 :     val it = ~2 : int (* should be ~1 *)
988 :    
989 :     Comments:
990 :     Both quot and div are bound to InLine.inldiv in perv.sml
991 :     Status: fixed in 1.02
992 :     ----------------------------------------------------------------------
993 :     Number: 824
994 :     Title: Incorrect documentation Integer.rem
995 :     Keywords:
996 :     Submitter: Emden R. Gansner, erg@research.att.com
997 :     Date: 11/2/93
998 :     Version: 1.01
999 :     System: all
1000 :     Severity: minor
1001 :     Problem: Incorrect documentation Integer.rem
1002 :     Code:
1003 :     Transcript:
1004 :     Comments: i rem j is described as a non-negative number,
1005 :     which is incorrect. Also, the inequalities given
1006 :     for i mod j are unnecessary. Given the definitions
1007 :     of div and quot, mod and rem can be defined as
1008 :     i rem j = i - j(i quot j) and
1009 :     i mod j = i - j(i div j).
1010 :    
1011 :     Owner:
1012 :     Status: obsolete
1013 :     ----------------------------------------------------------------------
1014 :     Number: 825
1015 :     Title: sml-mode.el incompatible with emacs 19
1016 :     Keywords:
1017 :     Submitter: Jeffrey Hsu <hsu@soda.berkeley.edu>
1018 :     Date: 10/2/93
1019 :     Version: 0.93
1020 :     Severity: major
1021 :     Problem:
1022 :     The sml-mode.el calls make-shell, which is no longer defined in shell.el
1023 :     in emacs 19.
1024 :     Fix: [dbm:] use sml-mode 3.1, which works with Emacs 19.xx.
1025 :     Status: fixed
1026 :     ----------------------------------------------------------------------
1027 :     Number: 826
1028 :     Title: zombie sml processes
1029 :     Keywords:
1030 :     Submitter: Elsa Gunter
1031 :     Date: 10/27/93
1032 :     Version: 1.01 + SC
1033 :     System: SPARC 2
1034 :     Severity: minor
1035 :     Problem:
1036 :     I have been witnessing some very strange behaviour with sml-sc
1037 :     version 1.01 when running inside a shell in emacs over the internet.
1038 :     Three times now, I have lost my connection. I have then logged back
1039 :     into the same machine (tiree), restarted emacs, (done a few things
1040 :     like read my mail), started a shell and found myself suddenly in the
1041 :     middle of the sml process that was running in the old shell in the old
1042 :     emacs. I report this to you because whatever all the problem is, it
1043 :     seems like a potential source of arrant sml processes living forever
1044 :     (well until someone explicitly kills them) and possibly consuming lots
1045 :     of resources in the meantime.
1046 :     Owner: John
1047 :     Status: obsolete [new runtime]
1048 :     ----------------------------------------------------------------------
1049 :     Number: 827
1050 :     Title: exportML including future evaluations
1051 :     Keywords:
1052 :     Submitter: Jeff Ullman
1053 :     Date: 6/11/93
1054 :     Version: 0.93 (?)
1055 :     Severity: minor
1056 :     Problem:
1057 :     Both of you took me to task for believing (see p. 51, ch. 23)
1058 :     that exportML can export things from its own future.
1059 :     Seemed weird to me, and I had trouble believing it.
1060 :     However, here is the ML program I executed to create a file "foo":
1061 :     **********************************************************
1062 :     exportML("foo");
1063 :    
1064 :     fun comb1(n,m) =
1065 :     let
1066 :     exception BadN;
1067 :     exception BadM;
1068 :     in
1069 :     if n <= 0 then raise BadN
1070 :     else if m < 0 orelse m > n then raise BadM
1071 :     else if m=0 orelse m=n then 1
1072 :     else comb1(n-1,m) + comb1(n-1,m-1)
1073 :     end;
1074 :    
1075 :     comb1(10,5);
1076 :     ***********************************************************
1077 :    
1078 :     and here is the result of running foo:
1079 :     **************************************************
1080 :     val it = true : bool
1081 :     val comb1 = fn : int * int -> int
1082 :     val it = 252 : int
1083 :     -
1084 :     **************************************************
1085 :     This seems to justify my bullet at the end of Ch. 23.
1086 :     it also substantiates the claim that when foo is run
1087 :     (even with the code of Fig. 23.2 rather than the code above)
1088 :     it will echo the value of comb.
1089 :     Owner:
1090 :     Status: open
1091 :     ----------------------------------------------------------------------
1092 :     Number: 828
1093 :     Title: PPDec.getVal bug when "opening" structures
1094 :     Keywords:
1095 :     Submitter: Zhong Shao (zsh@cs.princeton.edu)
1096 :     Date: 11/17/93
1097 :     Version: 1.01
1098 :     System: Decstation Ultrix
1099 :     Severity: major
1100 :     Problem: PPDec.getStamp bug when "opening" structures
1101 :     Code:
1102 :     (* anytime in the compiler *)
1103 :     open String List IO Bool Real;
1104 :    
1105 :     Transcript:
1106 :     Standard ML of New Jersey, Version 109.21, October 28, 1996 [CM; autoload enabled]
1107 :     - open String List IO Bool Real;
1108 :     GC #0.0.0.1.2.38: (45 ms)
1109 :     open String List IO Bool Real
1110 :     val translate = fn : (char -> string) -> string -> string
1111 :     val tokens = fn : (char -> bool) -> string -> string list
1112 :     val toString = fn : string -> string
1113 :     val substring = fn : string * int * int -> string
1114 :     val sub = <primop> : string * int -> char
1115 :     val str = fn : char -> string
1116 :     val size = <primop> : string -> int
1117 :     val maxLen = 33554431 : int
1118 :     val isPrefix = fn : string -> string -> bool
1119 :     val implode = fn : char list -> string
1120 :     val fromString = fn : string -> string option
1121 :     val fields = fn : (char -> bool) -> string -> string list
1122 :     val explode = fn : string -> char list
1123 :     val concat = fn : string list -> string
1124 :     val compare = fn : string * string -> order
1125 :     val collate = fn : (char * char -> order) -> string * string -> order
1126 :     val ^ = fn : string * string -> string
1127 :     Error: Compiler bug: PPDec.getVal
1128 :     -
1129 :    
1130 :     Comments:
1131 :     This is an interesting bug, because "open String List IO Bool" still
1132 :     works, or even "open String List" and "open IO Bool Real". The error
1133 :     message is printed out from print/ppdec.sml complaining about the non-LVAR
1134 :     and non-INLINE access of some program identifiers. [dbm - check this]
1135 :    
1136 :     Owner: dbm, Zhong
1137 :     Test: bug828.sml
1138 :     Status: fixed in 109.26 (or earlier)
1139 :     ----------------------------------------------------------------------
1140 :     Number: 829
1141 :     Title: Division does not work right on negative integers
1142 :     Keywords:
1143 :     Submitter: Andrzej Filinski <andrzej@cs.cmu.edu>
1144 :     Date: 11/9/93
1145 :     System(s) and Version: Compiler
1146 :     SML/NJ Version: 1.01 (16 September 1993)
1147 :     Machine: all
1148 :     Severity: major
1149 :     Problem: Division does not work right on negative integers
1150 :     Transcript: - ~10 div 10;
1151 :     val it = ~2 : int -- should be ~1
1152 :     - ~10 mod 10;
1153 :     val it = 10 : int -- should be 0
1154 :     Comments: Possibly confusion div/quot in inlining
1155 :     Status: fixed in 1.02
1156 :     ----------------------------------------------------------------------
1157 :     Number: 830
1158 :     Title: error in makeml -- Solaris option
1159 :     Keywords:
1160 :     Submitter: Lal George
1161 :     Date: 11/5/93
1162 :     Version: 1.01
1163 :     System: Solaris 2.x
1164 :     Severity: major
1165 :     Problem:
1166 :     The runtime system files have SOLARIS changes, however, the makeml
1167 :     script is in error. In 101/src/makeml, the SOLARIS operating system is
1168 :     an option of -m68, instead of -sun4.
1169 :     Fix:
1170 :     The following lines:
1171 :    
1172 :     solaris|sunos5)
1173 :     MAKE=/usr/ccs/bin/make
1174 :     AS=/usr/ccs/bin/as
1175 :     CPP=/usr/ccs/lib/cpp
1176 :     DEFS="$DEFS -DSUNOS"
1177 :     OPSYS=SOLARIS
1178 :     ;;
1179 :    
1180 :     should be deleted as an operationg system option for the m68 and added
1181 :     to -sun4. See the file /usr/local/sml/SOLARIS/src98/makeml.
1182 :    
1183 :     Owner:
1184 :     Status: obsolete
1185 :     ----------------------------------------------------------------------
1186 :     Number: 831
1187 :     Title: document Solaris option
1188 :     Keywords:
1189 :     Submitter: John R. Durand (jrd@galileo.ebt.com)
1190 :     Date: 11/9/93
1191 :     Version: 1.01
1192 :     System: Solaris
1193 :     Severity: major
1194 :     Problem:
1195 :     you might want to update the README file and the Release Notes to reflect this
1196 :     fact. the README file does not mention that Solaris is supported. also, the
1197 :     Release Notes don't mention the Solrais 2.x support or the tar file and the
1198 :     man page for makeml does not mention "-sun4 solairs" as a valid option. an
1199 :     interesting fact is that the manual that is included in the doc subdirectory
1200 :     does have a correct man page for makeml that lists "solaris" as a valid option.
1201 :     Owner:
1202 :     Status: obsolete
1203 :     ----------------------------------------------------------------------
1204 :     Number: 832
1205 :     Title: parse phase stats always 0
1206 :     Keywords:
1207 :     Submitter: Lal George
1208 :     Date: 12/6/93
1209 :     Version: 1.01
1210 :     System: all
1211 :     Severity: minor
1212 :     Problem:
1213 :     I have tried compiling small and big files, and the "010 Parse"
1214 :     time always seems to be 0.0. Is this correct? As far as I can tell the
1215 :     meaning of parse has not changed, and the parse phase in 0.93 takes
1216 :     about 2s for simple. Below is the summary for simple.
1217 :    
1218 :     -------------
1219 :     Code Size 174076
1220 :     Source Lines 925
1221 :     Compiler 004 UnPickle 0.0u 0.0s 0.0g
1222 :     Compiler 010 Parse 0.0u 0.0s 0.0g
1223 :     Compiler 030 Elaborate 4.010000u 0.0s 0.740000g
1224 :     ...
1225 :     Fix: (Andrew Appel)
1226 :     In build/compile.sml, insert after line 41:
1227 :     val parser = Stats.doPhase parsePhase parser
1228 :    
1229 :     Then delete this line:
1230 :    
1231 :     val parseOne = Stats.doPhase parsePhase parseOne
1232 :     Status: fixed in 1.02
1233 :     ----------------------------------------------------------------------
1234 :     Number: 833
1235 :     Title: Compiler bug: getSymbols
1236 :     Keywords:
1237 :     Submitter: Bernd Fischer (fisch@ips.cs.tu-bs.de)
1238 :     Date: 11/25/93
1239 :     SML/NJ Version: <0.93>
1240 :     Machine: SUN Sparcstation ELC, SunOS 4.1.1
1241 :     Severity: major
1242 :     Problem: Well, ..., a functor which is passed as a parameter to another
1243 :     functor cannot find the appropriate names when applied to some other
1244 :     parameters.
1245 :    
1246 :     Transcript:
1247 :     - use "SIGMA.sml";
1248 :     ...
1249 :     val it = () : unit
1250 :     - use "BR_SIGMA.sml";
1251 :     ...
1252 :     val it = () : unit
1253 :     - use "BR_Sigma.sml";
1254 :     [opening BR_Sigma.sml]
1255 :     structure BR_Sigma : BR_SIGMA
1256 :     val it = () : unit
1257 :     - use "NAME_GEN.sml";
1258 :     ...
1259 :     val it = () : unit
1260 :     - use "Name_Gen.sml";
1261 :     [opening Name_Gen.sml]
1262 :     structure Name_Gen : NAME_GEN
1263 :     val it = () : unit
1264 :     - use "TERM_FUNCTOR.sml";
1265 :     [opening TERM_FUNCTOR.sml]
1266 :     ...
1267 :     val it = () : unit
1268 :     - use "Term.sml";
1269 :     [opening Term.sml]
1270 :     functor Term : <sig>
1271 :     val it = () : unit
1272 :     - structure br_term = Term( structure s = BR_Sigma and n = Name_Gen);
1273 :     ...
1274 :     - use "Scanner.sml";
1275 :     [opening Scanner.sml]
1276 :     ...
1277 :     - structure br_scan = Scanner( structure s = BR_Sigma );
1278 :     ...
1279 :     - use "SCANNER_FUNCTOR.sml";
1280 :     [opening SCANNER_FUNCTOR.sml]
1281 :     ...
1282 :     use "Term.sml";
1283 :     functor Term : <sig>
1284 :     val it = () : unit
1285 :     - functor br_curry_parser = Parser( functor t = Term );
1286 :     functor br_curry_parser : <sig>
1287 :     - functor br_lex_curry_parser = br_curry_parser( functor lex = Scanner );
1288 :     functor br_lex_curry_parser : <sig>
1289 :     - structure br_parser = br_lex_curry_parser( structure s = BR_Sigma and n = Name_Gen );
1290 :     structure br_parser : sig structure s_term : ...
1291 :     end
1292 :     - open br_parser;
1293 :     open br_parser
1294 :     structure s_term : ...
1295 :     - open s_term;
1296 :     Error: Compiler bug: getSymbols
1297 :     Code: /usr/local/sml/bugs/833
1298 :     Comments:
1299 :     Perhaps the compiler gets lost between the same names in different
1300 :     scopes:
1301 :    
1302 :     > functor Parser ( functor t : TERM_FUNCTOR )
1303 :     > ( functor lex : SCANNER_FUNCTOR )
1304 :     > ( structure s : SIGMA
1305 :     > structure n : NAME_GEN ) =
1306 :     > struct
1307 :     > structure s_term = t(structure s = s and n = n)
1308 :     > end
1309 :    
1310 :     > funsig TERM_FUNCTOR ( structure s : SIGMA
1311 :     > structure n : NAME_GEN ) =
1312 :     > sig
1313 :     > ...
1314 :     > end
1315 :    
1316 :     Fix: (Pierre Cregut)
1317 :     Here is a reduced version of the program producing the bug:
1318 :    
1319 :     signature s = sig
1320 :     datatype dt = foo
1321 :     end
1322 :    
1323 :     functor i(X:s) = X;
1324 :     structure a = struct
1325 :     datatype dt = foo
1326 :     end
1327 :    
1328 :     functor r(functor f(x:s):s) (y:s)= struct structure c = f(y) end;
1329 :     functor p = r(functor f =i);
1330 :     structure b = p(a);
1331 :     open b;
1332 :     open c;
1333 :    
1334 :     The fix is changing getSymbols in elaborate/elabstr.sml. The case where
1335 :     the opened structure came from a functor application with an APP constructor
1336 :     wasn't treated:
1337 :    
1338 :     fun getSymbols(SIMPLE{env,...}) =
1339 :     let val r = ref([]: Symbol.symbol list)
1340 :     in Env.app (fn (s,_) => r := s::(!r)) env;
1341 :     !r
1342 :     end
1343 :     | getSymbols(INSTANCE{sign=SIG{symbols,...},...}) = !symbo
1344 :     ls
1345 :     | getSymbols ERROR_STR = []
1346 :     (* forgotten -> *) | getSymbols (APPLY{res,...}) = getSymbols res
1347 :     | getSymbols _ = ErrorMsg.impossible "getSymbols"
1348 :    
1349 :     Status: fixed in 106
1350 :     ----------------------------------------------------------------------
1351 :     Number: 834
1352 :     Title: accepts duplicate names in funsig parameters
1353 :     Keywords:
1354 :     Submitter: Philip Santas (santas@inf.ethz.ch)
1355 :     Date: 1/5/94
1356 :     Version: Standard ML of New Jersey, Version 0.93, February 15, 1993
1357 :     Machine: Sparc (all?)
1358 :     Severity: major
1359 :     Problem: duplicate use of parameter name in funsig definition is accepted.
1360 :     It prefers the second occurence of the name.
1361 :     Comments: The same happens for functors.
1362 :    
1363 :     Code:
1364 :     funsig S1 (T:sig end) (T:sig type t end) = sig val x:T.t end
1365 :     functor F1(T:sig end) (T:sig type t end) = struct type t = T.t end
1366 :    
1367 :     Transcript:
1368 :     - funsig S1 (structure T:sig end structure T:sig end) = sig end;
1369 :     std_in:0.0 Error: duplicate specifications for structure T in signature
1370 :    
1371 :     - funsig S1 (T:sig end) (T:sig end) = sig end;
1372 :     funsig S1(T:<sig>) = sig functor <functor> : <sig> end
1373 :     - funsig S1 (T:sig end) (T:sig type t end) = sig val x:T.t end;
1374 :     funsig S1(T:<sig>) = sig functor <functor> : <sig> end
1375 :     - funsig S1 (T:sig type t end) (T:sig end) = sig val x:T.t end;
1376 :     std_in:0.0-0.0 Error: unbound type constructor: t in path <Argument>.<Parameter>.t
1377 :    
1378 :     - functor F1(structure T:sig end structure T:sig end) = struct end;
1379 :     std_in:39.48 Error: duplicate specifications for structure T in signature
1380 :    
1381 :     - functor F1(T:sig end) (T:sig end) = struct end;
1382 :     functor F1 : <sig>
1383 :     - functor F1(T:sig end) (T:sig type t end) = struct type t = T.t end;
1384 :     functor F1 : <sig>
1385 :     - functor F1(T:sig type t end) (T:sig end) = struct type t = T.t end;
1386 :     std_in:38.61-38.63 Error: unbound type constructor: t in path T.t
1387 :    
1388 :     Comment [dbm, 11/7/96]
1389 :     This is not a bug, just normal shadowing of bindings. Works just
1390 :     like "fn x: int => fn x: string => x ^ "a""
1391 :    
1392 :     Test: bug834.sml
1393 :     Owner: dbm
1394 :     Status: not a bug
1395 :     ----------------------------------------------------------------------
1396 :     Number: 835
1397 :     Title: large comments parse slowly
1398 :     Keywords:
1399 :     Submitter: Morten Welinder <terra@diku.dk>
1400 :     (Referencing Kristian Nielsen <bombadil@diku.dk>)
1401 :     Date: 1/10/94
1402 :     System(s) and Version: ? (Field not understood.)
1403 :     SML/NJ Version: 0.93
1404 :     Machine: hp9000s700 under hpux; sun4 under sunos
1405 :     Severity: major
1406 :     Problem: Large comments make sml use enormous amounts of
1407 :     memory, and take forever to parse.
1408 :     Code: A file containing "(*\n" and the 10000 lines each
1409 :     consisting of 70 "x"s.
1410 :     Comments: The parsing cannot be interrupted by C-c since
1411 :     sml will almost immediately go into garbage
1412 :     collecting.
1413 :    
1414 :     Transscript (sml killed by kill -9 xxxx):
1415 :     Yes, Sally? sml
1416 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1417 :     val it = () : unit
1418 :     - use "ttt.sml";
1419 :     [opening ttt.sml]
1420 :    
1421 :     [Major collection...
1422 :     [Increasing heap to 2986k]
1423 :    
1424 :     [Increasing heap to 4246k]
1425 :    
1426 :     [Increasing heap to 10546k]
1427 :     96% used (2174736/2255004), 1970 msec]
1428 :    
1429 :     [Increasing heap to 10962k]
1430 :    
1431 :     [Major collection...
1432 :     [Increasing heap to 14782k]
1433 :     91% used (6173796/6731560), 6120 msec]
1434 :    
1435 :     [Increasing heap to 19714k]
1436 :    
1437 :     [Major collection... 89% used (9495912/10664996), 9609 msec]
1438 :    
1439 :     [Increasing heap to 31246k]
1440 :    
1441 :     [Major collection...Killed
1442 :    
1443 :     Status: fixed in 1.02
1444 :     ----------------------------------------------------------------------
1445 :     Number: 836
1446 :     Title: no integer overflow, change in exception behavior
1447 :     Keywords:
1448 :     Submitter: Markus Bleicher, bleicher@informatik.uni-muenchen.de
1449 :     Date: 1/19/94
1450 :     System(s) and Version: Compiler
1451 :     SML/NJ Version: 0.93
1452 :     Machine: HPPA/HP-UX 9.01
1453 :     Severity: minor
1454 :     Problem: No Integer Overflow
1455 :     Code: - val a=1111111111;
1456 :     Transcript: val a = ~1036372537 : int
1457 :     - val b=1.0/0.0;
1458 :     uncaught exception Div
1459 :     - val a=1111111111;
1460 :     uncaught exception Div
1461 :     Comments: There are some more exceptions changing the behavior.
1462 :     Owner:
1463 :     Test: bug836.1.sml, bug836.2.sml
1464 :     Status: fixed in 109.21
1465 :     ----------------------------------------------------------------------
1466 :     Number: 837
1467 :     Title: exception handlers and / don't work together
1468 :     Keywords:
1469 :     Submitter: Markus Bleicher, bleicher@informatik.uni-muenchen.de
1470 :     Date: 1/19/94
1471 :     System(s) and Version: Compiler
1472 :     SML/NJ Version: 0.93
1473 :     Machine: HPPA/HP-UX 9.01
1474 :     Severity: minor
1475 :     Problem: exception handlers and / work not together
1476 :     Code: exception NoInverse;
1477 :     fun finv (x,y) = x/y;
1478 :     val vinv = op /;
1479 :     fun h f x = f(x) handle _ => raise NoInverse;
1480 :    
1481 :     Transcript: - [opening /tmp/sml.tmp.g01926]
1482 :     exception NoInverse
1483 :     val finv = fn : real * real -> real
1484 :     val vinv = <primop> : real * real -> real
1485 :     val h = fn : ('a -> 'b) -> 'a -> 'b
1486 :     val it = () : unit
1487 :     - h vinv (1.0,0.0);
1488 :    
1489 :     uncaught exception NoInverse
1490 :     - h finv (1.0,0.0);
1491 :    
1492 :     uncaught exception NoInverse
1493 :     - h op / (1.0,0.0);
1494 :    
1495 :     uncaught exception NoInverse
1496 :     No problem until here...- vinv(1.0,0.0) handle _ => raise NoInverse;
1497 :    
1498 :     bug => uncaught exception Div
1499 :     - finv(1.0,0.0) handle _ => raise NoInverse;
1500 :    
1501 :     uncaught exception NoInverse
1502 :     - 1.0/0.0 handle _ => raise NoInverse;
1503 :    
1504 :     bug => uncaught exception Div
1505 :    
1506 :     Comments: No problems with other functions.
1507 :     Owner:
1508 :     Test: bug837.sml
1509 :     Status: fixed in 109.21
1510 :     ----------------------------------------------------------------------
1511 :     Number: 838
1512 :     Title: Compiler bug: inststr, pos = 15
1513 :     Keywords:
1514 :     Submitter: Rod Moten
1515 :     Date: 1/19/94
1516 :     Version: 1.02
1517 :     System: sparc-SunOS
1518 :     Severity: major
1519 :    
1520 :     Problem:
1521 :     When trying to compile a functor which takes three arguments, one
1522 :     functor and two structures, the following message is reported "Error:
1523 :     Compiler bug: inststr, pos = 15".
1524 :    
1525 :     Code:
1526 :     The error occurs when trying the functor with the heading below.
1527 :    
1528 :     functor ProofManager
1529 :     (functor TTree :TTREE
1530 :     structure ThmProverEng :THM_PROVER_ENG
1531 :     structure CompUnitLib :COMP_UNIT_LIB
1532 :     ): PROOF_MANAGER
1533 :    
1534 :     Is has the functor signature
1535 :     funsig PROOF_MANAGER
1536 :     (structure ThmProverEng :THM_PROVER_ENG
1537 :     functor TTree : TTREE
1538 :     structure CompUnitLib :COMP_UNIT_LIB) = PROOF_MANAGER
1539 :    
1540 :    
1541 :     The functor signature TTREE is given below.
1542 :     funsig TTREE (structure ThmProver :THM_PROVER) = TTREE
1543 :    
1544 :     Transcript:
1545 :     Comments: If need I could send more code upon request.
1546 :     Owner: dbm
1547 :     Status: not reproducible, probably obsolete
1548 :     ----------------------------------------------------------------------
1549 :     Number: 839
1550 :     Title: wrong type for install_pp
1551 :     Keywords:
1552 :     Submitter: John Reppy (jhr@research.att.com)
1553 :     Date: 1/23/94
1554 :     System(s) and Version: Compiler
1555 :     SML/NJ Version: 1.01, pre 1.02
1556 :     Machine: any
1557 :     Severity: major
1558 :     Problem:
1559 :     The interface for installing pretty-printers (Compiler.PPTable) is
1560 :    
1561 :     val install_pp : string list -> (ppstream -> object -> unit) -> unit
1562 :    
1563 :     instead of
1564 :    
1565 :     val install_pp : string list -> (ppstream -> 'a -> unit) -> unit
1566 :    
1567 :     which makes it hard to use.
1568 :     Code:
1569 :     Transcript:
1570 :     [compiling install-pp.sml]
1571 :     install-pp.sml:9.1-9.51 Error: operator and operand don't agree (tycon mismatch)
1572 :     operator domain: ?.PrettyPrint.ppstream -> System.Unsafe.object -> unit
1573 :     operand: ?.PrettyPrint.ppstream -> ?.Absyn.program -> unit
1574 :     in expression:
1575 :     install "Absyn" :: "program" :: nil ppPrgm
1576 :    
1577 :     Comments:
1578 :     Fix:
1579 :     The fix, which I'm putting into 1.02, is to make the PPTable signature in
1580 :     build/viscomp.sml be the polymorphic one, and to cast the binding.
1581 :     Status: fixed in 1.02
1582 :     ----------------------------------------------------------------------
1583 :     Number: 840
1584 :     Title: nonprintable characters allowed in string literals
1585 :     Keywords:
1586 :     Submitter: John Reppy (jhr@research.att.com)
1587 :     Date: 1/26/94
1588 :     System(s) and Version: Compiler
1589 :     SML/NJ Version: 1.03 and earlier
1590 :     Machine: all
1591 :     Severity: minor
1592 :     Problem:
1593 :     The Definition requires that the characters of a string literal be printable,
1594 :     but SML/NJ doesn't enforce this.
1595 :     Code:
1596 :     Transcript:
1597 :     Standard ML of New Jersey, Version 1.02, December 23, 1993
1598 :     - " ";
1599 :     val it = "\t" : string
1600 :    
1601 :     Comments:
1602 :     Note that tabs should be allowed between \ ... \.
1603 :     Fix:
1604 :     change ml.lex
1605 :     Status: fixed in 1.03f
1606 :     ----------------------------------------------------------------------
1607 :     Number: 841
1608 :     Title: System.PrettyPrint.mk_ppstream in stand-alone programs
1609 :     Keywords:
1610 :     Submitter: Klaus Elmquist Nielsen (klaus@tdr.dk)
1611 :     Date: 1/28/93
1612 :     System(s) and Version: Compiler
1613 :     SML/NJ Version: 0.93
1614 :     Machine: sparc/SunOS 4.1.3, mipsl/Ultrix 4.2A
1615 :     Severity: critical (for me!)
1616 :     Problem:
1617 :     If System.PrettyPrint.mk_ppstream is called from a standalone program,
1618 :     it will raise an exception named UNDEFINED.
1619 :     Code:
1620 :     fun olsen _ = (System.PrettyPrint.mk_ppstream
1621 :     {consumer = fn s => output (std_out, s),
1622 :     flush = fn () => flush_out std_out,
1623 :     linewidth = 79};
1624 :     ())
1625 :    
1626 :     val _ = exportFn ("abc",olsen)
1627 :     Transcript:
1628 :     % sml < ppbug.sml
1629 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1630 :     val it = () : unit
1631 :     - =
1632 :     [Major collection... 3% used (17508/579348), 10 msec]
1633 :    
1634 :     [Decreasing heap to 98k]
1635 :    
1636 :     [Major collection... 94% used (18492/19648), 10 msec]
1637 :     % ./abc
1638 :    
1639 :     [Increasing heap to 162k]
1640 :     uncaught exception UNDEFINED
1641 :    
1642 :     % sml-noshare < ppbug.sml
1643 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1644 :     val it = () : unit
1645 :     - =
1646 :     [Major collection... 15% used (595524/3906292), 80 msec]
1647 :    
1648 :     [Decreasing heap to 2934k]
1649 :    
1650 :     [Major collection... 40% used (243924/600300), 40 msec]
1651 :    
1652 :     [Decreasing heap to 1194k]
1653 :     % ./abc
1654 :     uncaught exception UNDEFINED
1655 :     Comments:
1656 :     I guess the UNDEFINED exception is the one from System.Hooks
1657 :     (src/boot/perv.sml).
1658 :    
1659 :     The consequence of this bug is that it is not possible to use the
1660 :     prettyprinter in a stand-alone program. An example of such a program
1661 :     is the compiler I am working on for the moment, as it writes its output
1662 :     using the prettyprinter.
1663 :    
1664 :     The prettyprinter works fine in an interactive system.
1665 :     Status: fixed in 1.02
1666 :     ----------------------------------------------------------------------
1667 :     Number: 842
1668 :     Title: sharing constraints in functor sig
1669 :     Keywords:
1670 :     Submitter: Philip Santas <santas@inf.ethz.ch>
1671 :     Date: 1/31/94
1672 :     Version: 0.93
1673 :     System: SPARC
1674 :     Severity: major
1675 :     Problem:
1676 :     Bogus type sharing constraints accepted in result sig of functor sig.
1677 :     Code:
1678 :     - funsig S1 (type t sharing type t=string)= sig sharing type t = int type t end;
1679 :     funsig S1(<Parameter>:<sig>) =
1680 :     sig
1681 :     type t
1682 :     sharing type <Argument>.<Parameter>.t = int
1683 :     end
1684 :     Comments:
1685 :     It seems to me that the body of S1 should report an error at
1686 :     sharing type t = int
1687 :     for two reasons:
1688 :     (a) type t in the argument equals to string
1689 :     (b) even if (a) was not true, we add constraints on the parameter
1690 :     in the result signature.
1691 :    
1692 :     Comment [dbm]: This code will be illegal (nonflexible sharing) in SML96.
1693 :     Must check that proper error message is generated.
1694 :     Owner: dbm
1695 :     Test: bug842.sml
1696 :     Status: obsolete
1697 :     ----------------------------------------------------------------------
1698 :     Number: 843
1699 :     Title: "ppDec raised exception" during bootstrapping
1700 :     Keywords:
1701 :     Submitter: John Reppy
1702 :     Date: 2/3/94
1703 :     Version: 1.03
1704 :     System: ?
1705 :     Severity: minor
1706 :     Problem:
1707 :     I noticed that when I use the -elab option to boot 1.03, I occasionally get
1708 :     the message "ppDec raised exception". Is this a bug? Here is a
1709 :     partial transcript:
1710 :     Transcript:
1711 :     ...
1712 :     [Elaborating boot/openio.sml]
1713 :     open IO
1714 :     exception Io = Io
1715 :     ppDec raised exception
1716 :     [Elaborating boot/makestring.sml]
1717 :     structure Makestring : MAKESTRING
1718 :     [Elaborating boot/print.sml]
1719 :     structure Print : PRINT
1720 :     [Elaborating boot/printol.sml]
1721 :     overload
1722 :     overload
1723 :     [Elaborating boot/weak.sml]
1724 :     structure Weak : WEAK
1725 :     structure Susp : SUSP
1726 :     [Elaborating boot/export.sml]
1727 :     structure Export : EXPORT
1728 :     [Elaborating boot/openexport.sml]
1729 :     ppDec raised exception
1730 :    
1731 :     Status: not a bug
1732 :     ----------------------------------------------------------------------
1733 :     Number: 844
1734 :     Title: callgc.c problems
1735 :     Keywords:
1736 :     Submitter: Soren Christensen (schristensen@daimi.aau.dk)
1737 :     Date: 2/3/94
1738 :     Version: 0.93
1739 :     System: ?
1740 :     Severity:
1741 :     Problem:
1742 :     schristensen@daimi.aau.dk (Soren Christensen)
1743 :     Subject: Two problems in callgc for 0.93
1744 :     Cc: andreas@metasoft.com
1745 :    
1746 :    
1747 :     Hi,
1748 :    
1749 :     We have discovered two problems callgc.c for 0.93.
1750 :    
1751 :     1) lastbreak should allways be alligned - this is vital for the
1752 :     increase_heapsize function, i.e., add the following line in restart_gc:
1753 :    
1754 :    
1755 :     lastbreak = (lastbreak + pagesize-1 ) & ~(pagesize-1);
1756 :    
1757 :     just below:
1758 :    
1759 :     resettimers();
1760 :     lastbreak = EDATA;
1761 :    
1762 :     2) there can be a overflow in increase_heapsize when calculating:
1763 :    
1764 :     p = (lastbreak+(p-pagesize))/2;
1765 :    
1766 :     this can be fixed by defining p to be unsigned:
1767 :    
1768 :     unsigned int p = arenabase+new_size;
1769 :    
1770 :    
1771 :     Both of these errors were discovered when running on a HPPA, the NJsml
1772 :     process would loop during startup if to little memory was available.
1773 :    
1774 :     Status: not important --- obsolete
1775 :     ----------------------------------------------------------------------
1776 :     Number: 845
1777 :     Title: local in signatures not reported as error
1778 :     Keywords:
1779 :     Submitter: Philip Santas <santas@inf.ethz.ch>
1780 :     Date: 2/3/94
1781 :     Version: 0.93
1782 :     System: SPARC
1783 :     Severity: minor
1784 :     Problem:
1785 :     Some functions defined in structures with a type which
1786 :     involves signatures with local specs cause Bus error.
1787 :     Code:
1788 :     Transcript:
1789 :     vinci.inf.ethz.ch46 Philip > sml
1790 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1791 :     val it = () : unit
1792 :     - signature S = sig
1793 :     local structure A: sig type t end
1794 :     in
1795 :     val make: int -> A.t
1796 :     val destr: A.t -> int
1797 :     val add: A.t -> A.t -> A.t
1798 :     end
1799 :     end;
1800 :     std_in:3.3-8.6 Warning: LOCAL specs are only partially implemented
1801 :     signature S =
1802 :     sig
1803 :     val make : int -> A.t
1804 :     val destr : A.t -> int
1805 :     val add : A.t -> A.t -> A.t
1806 :     end
1807 :     - structure M1: S =
1808 :     struct
1809 :     local structure A = struct type t=int end
1810 :     in
1811 :     fun make(x:int) = x
1812 :     fun destr x = x
1813 :     fun add (x:int) y = x+y
1814 :     end
1815 :     end;
1816 :     structure M1 : S
1817 :     - open M1;
1818 :     open M1
1819 :     val make = fn : int -> _
1820 :     val destr = fn : _ -> int
1821 :     val add = fn : _ -> _ -> _
1822 :     - val x1=make 3;
1823 :     val x1 = - : 'a
1824 :     - add x1 x1;
1825 :     Bus error
1826 :    
1827 :     Comment: [dbm]
1828 :     This should be detected and reported as a syntax error.
1829 :    
1830 :     Fix: eliminated rules for local and open forms of spec from grammar and
1831 :     eliminated LocalSpec and OpenSpec constructors from Ast.
1832 :     Owner: dbm
1833 :     Test: bug845.sml
1834 :     Status: fixed in 109.19m [by eliminating local from spec syntax]
1835 :     ----------------------------------------------------------------------
1836 :     Number: 846
1837 :     Title: endless compilation
1838 :     Keywords:
1839 :     Submitter: Kristian Nielsen (bombadil@diku.dk)
1840 :     Date: 2/8/94
1841 :     System(s) and Version: SML/NJ with Eddingburg library
1842 :     SML/NJ Version: 0.93 (February 15, 1993)
1843 :     Machine: HP-PA/HPUX and sun4/SunOS.
1844 :     Severity: major
1845 :     Problem:
1846 :    
1847 :     Attempting to compile a machine-generated ML program of about 40 Kb does
1848 :     not terminate (or takes unreasonably long; several hours or more).
1849 :     Apparently the compiler either enters an infinite loop, or it attempts
1850 :     an optimization that is too expensive. The compiler does not increase
1851 :     its heap usage in any significant way, though it does perform major
1852 :     collections from time to time.
1853 :    
1854 :     After setting the flag
1855 :    
1856 :     - SML_NJ.Control.interp := true;
1857 :    
1858 :     the program is interpreted fine by SML/NJ.
1859 :    
1860 :     Code: Unfortunately, it appears very hard to extract a short example
1861 :     that reproduces the bug (being large and machine-generated, the program
1862 :     is very hard to read). The program is the output of the partial
1863 :     evaluator ML-MIX and is a specialized quicksort program. A smaller
1864 :     version of the same program does not exhibit any problem.
1865 :    
1866 :     Since the program is 40Kb (70Kb for a pretty-printed version), it is not
1867 :     included here (I am not going to flood your bugreport list unless you
1868 :     ask me to!). I will be happy to send it along if desired, of course.
1869 :     Would it be helpful to have the example (to reproduce the behaviour)
1870 :     even though it is not readable by humans?
1871 :    
1872 :     Transcript:
1873 :    
1874 :     - use "../../exp/quicksort/3specex2.sml";
1875 :     [opening ../../exp/quicksort/3specex2.sml]
1876 :    
1877 :     [Major collection... 60% used (13621052/22644044), 3800 msec]
1878 :    
1879 :     [Major collection... 61% used (13958948/22550444), 3367 msec]
1880 :    
1881 :     (* This can go on for hours ... *)
1882 :     Interrupt
1883 :    
1884 :     Comment: [Appel]
1885 :     I put in a simple adjustment to the minimum-feedback-vertex-set algorithm
1886 :     that still guarantees optimality (so programs will have few heap
1887 :     limit checks) and yet runs very fast on this kind of input.
1888 :    
1889 :     There still could be functions on which the m-f-v-s algorithm runs
1890 :     exponentially slowly, however; but the kind shown in bug 846
1891 :     (with lots of cycles of length 1) will not be a problem.
1892 :     [later...]
1893 :     On any real program (including the one in bug 846) the algorithm
1894 :     runs fast and produces optimal results.
1895 :    
1896 :     On artificial examples (20-node flow-graph, each node points to all the
1897 :     others but not to itself) program runs in N^k time and produces
1898 :     possibly sub-optimal results. I have chosen k=3.
1899 :    
1900 :     Previously, on artificial examples it could take N^N time.
1901 :    
1902 :     Status: fixed in 1.03f
1903 :     ----------------------------------------------------------------------
1904 :     Number: 847
1905 :     Title: opening structures with variables conflicting with constructors
1906 :     Keywords:
1907 :     Submitter: Philip Santas <santas@inf.ethz.ch>
1908 :     Date: 2/21/94
1909 :     Version: 0.93
1910 :     System: SPARC
1911 :     Severity: major
1912 :     Problem: Opening a structure returns errors if it exports constants
1913 :     with the same name as some already defined constructors.
1914 :     Transcript:
1915 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1916 :     val it = () : unit
1917 :    
1918 :     - structure M: sig type t val D:t end = struct type t = int val D = 4 end;
1919 :     structure M :
1920 :     sig
1921 :     eqtype t
1922 :     val D : t
1923 :     end
1924 :    
1925 :     - datatype t = D;
1926 :     datatype t
1927 :     con D : t
1928 :    
1929 :     - open M;
1930 :     std_in:4.1-4.6 Error: pattern and expression in val dec don't agree (tycon mismatch)
1931 :     pattern: t
1932 :     expression: M.t
1933 :     in declaration:
1934 :     D = D
1935 :     Comment: same as 788
1936 :     Status: fixed in 109.27 [dbm, 4/4/97]
1937 :     ----------------------------------------------------------------------
1938 :     Number: 848
1939 :     Title: realarray on HP
1940 :     Keywords:
1941 :     Submitter: Michael Lauer (mlauer@mechmail.cv.com)
1942 :     Date: 2/23/94
1943 :     SML/NJ Version: 0.93
1944 :     Machine: HP 715, HPUX 9.03
1945 :     Problem: realarray crashes after lots of disk-hitting
1946 :     Code: see transcript
1947 :     Transcript:
1948 :    
1949 :     mrtoad 74: sml
1950 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1951 :     Beta release version
1952 :     val it = () : unit
1953 :     - open RealArray;
1954 :     open RealArray
1955 :     exception RealSubscript = RealSubscript
1956 :     val array = fn : int * real -> realarray
1957 :     val length = <primop> : realarray -> int
1958 :     exception Size = Size
1959 :     val sub = <primop> : realarray * int -> real
1960 :     val update = <primop> : realarray * int * real -> unit
1961 :     - val foo = array (10, 1.0);
1962 :     Bus error (core dumped)
1963 :    
1964 :     Owner:
1965 :     Status: fixed in 109.21
1966 :     ----------------------------------------------------------------------
1967 :     Number: 849
1968 :     Title: sml-sg dumps core on RS/6000
1969 :     Keywords:
1970 :     Submitter: Roland Olsson
1971 :     Date: 2/28/94
1972 :     System(s) and Version: sml-sg
1973 :     SML/NJ Version: 0.93
1974 :     Machine: IBM RS6000 model 980. AIX 3.2.
1975 :     Severity: critical
1976 :     Problem:
1977 :     The message "Illegal instruction (core dumped)" appears at "random".
1978 :     The most easily reproducible situation that gives a core dump is
1979 :     when .bin files are read. When the .bin files are removed and produced
1980 :     on the fly, things work fine for a little while longer, but the core
1981 :     dump comes eventually.
1982 :     The same application runs just fine on SparcStations and DECStations.
1983 :    
1984 :     Transcript:
1985 :    
1986 :     Script command is started on Mon Feb 28 12:04:21 GMT 1994.bluemaster>sml-sg
1987 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
1988 :     with SourceGroup 3.0 built on Mon Feb 28 11:41:14 GMT 1994
1989 :     val it = () : unit
1990 :     - use "Makefile";
1991 :     [opening Makefile]
1992 :     /use/rs1a/u1/olsson/lib/lib-base-sig.sml
1993 :     /use/rs1a/u1/olsson/lib/lib-base.sml
1994 :     /use/rs1a/u1/olsson/lib/random-sig.sml
1995 :     /use/rs1a/u1/olsson/lib/random.sml
1996 :     /use/rs1a/u1/olsson/lib/string-cvt-sig.sml
1997 :     /use/rs1a/u1/olsson/lib/string-cvt.sml
1998 :     /use/rs1a/u1/olsson/lib/hash-string.sml
1999 :     /use/rs1a/u1/olsson/lib/hash-key-sig.sml
2000 :     /use/rs1a/u1/olsson/lib/hash-table-sig.sml
2001 :     /use/rs1a/u1/olsson/lib/hash-table.sml
2002 :     /use/rs1a/u1/olsson/lib/static-array-sig.sml
2003 :     /use/rs1a/u1/olsson/lib/dynamic-array-sig.sml
2004 :     /use/rs1a/u1/olsson/lib/dynamic-array.sml
2005 :     /use/rs1a/u1/olsson/lib/time-limit.sml
2006 :     /use/rs1a/u1/olsson/my-lib/lib.sml
2007 :     base.sml
2008 :     ML.grm.sig
2009 :     ML.grm.sml
2010 :     ML.lex.sml
2011 :     predefined.sml
2012 :     ast.sml
2013 :     ast_lib.sml
2014 :     io.sml
2015 :     type.sml
2016 :     execute.sml
2017 :    
2018 :     [Major collection...
2019 :     [Increasing heap to 9688k]
2020 :     28% used (2072432/7222288), 400 msec]
2021 :    
2022 :     [Increasing heap to 11332k]
2023 :     sort_spec.sml
2024 :     evaluate.sml
2025 :     exp_synt.sml
2026 :     bst_ins_spec.sml
2027 :     rev_spec.sml
2028 :     synt_lib.sml
2029 :     test_programs.sml
2030 :     atomic_trf_synt.sml
2031 :     case_dist.sml
2032 :     emb.sml
2033 :     compound_trf_synt.sml
2034 :     genealogical_search.sml
2035 :     ML.lex
2036 :     ML.grm
2037 :     val Home = "/use/rs1a/u1/olsson" : string
2038 :     val Lib = "/use/rs1a/u1/olsson/lib" : string
2039 :     val My_lib = "/use/rs1a/u1/olsson/my-lib" : string
2040 :     val Lib_files =
2041 :     ["lib-base-sig.sml","lib-base.sml","random-sig.sml","random.sml",
2042 :     "string-cvt-sig.sml","string-cvt.sml","hash-string.sml","hash-key-sig.sml",
2043 :     "hash-table-sig.sml","hash-table.sml","static-array-sig.sml",
2044 :     "dynamic-array-sig.sml",...] : string list
2045 :     val Lib_files =
2046 :     ["/use/rs1a/u1/olsson/lib/lib-base-sig.sml",
2047 :     "/use/rs1a/u1/olsson/lib/lib-base.sml",
2048 :     "/use/rs1a/u1/olsson/lib/random-sig.sml",
2049 :     "/use/rs1a/u1/olsson/lib/random.sml",
2050 :     "/use/rs1a/u1/olsson/lib/string-cvt-sig.sml",
2051 :     "/use/rs1a/u1/olsson/lib/string-cvt.sml",
2052 :     "/use/rs1a/u1/olsson/lib/hash-string.sml",
2053 :     "/use/rs1a/u1/olsson/lib/hash-key-sig.sml",
2054 :     "/use/rs1a/u1/olsson/lib/hash-table-sig.sml",
2055 :     "/use/rs1a/u1/olsson/lib/hash-table.sml",
2056 :     "/use/rs1a/u1/olsson/lib/static-array-sig.sml",
2057 :     "/use/rs1a/u1/olsson/lib/dynamic-array-sig.sml",...] : string list
2058 :     val group = 1 : ?.group
2059 :     val it = () : unit
2060 :     - use "make.sml";
2061 :     [opening make.sml]
2062 :     val it = () : unit
2063 :     val it = () : unit
2064 :     [reading base.sml.bin]
2065 :     [reading /use/rs1a/u1/olsson/lib/hash-key-sig.sml.bin]
2066 :     Illegal instruction (core dumped)
2067 :     bluemaster>exit
2068 :     exit
2069 :    
2070 :     Script command is complete on Mon Feb 28 12:05:06 GMT 1994.
2071 :     Script command is complete on Mon Feb 28 12:05:06 GMT 1994.
2072 :    
2073 :     Comments:
2074 :    
2075 :     I transferred fresh copies of the entire sml-nj system from research.att.com,
2076 :     but this didn't change the problem. The system was built with the command
2077 :     "makeml -g -rs6000 aix".
2078 :    
2079 :     Owner: lal
2080 :     Status: obsolete
2081 :     ----------------------------------------------------------------------
2082 :     Number: 850
2083 :     Title: redefining nil breaks []
2084 :     Keywords:
2085 :     Submitter: Pierre Cregut (cregut@LANNION.cnet.fr)
2086 :     Date: 3/3/94
2087 :     Version: 0.93
2088 :     Severity: minor
2089 :     Problem:
2090 :     At the level of Ast, identifiers stand for either variables or constructors.
2091 :     In particular, the identifier "nil" could be either a variable or constructor.
2092 :     [] is just an abbreviation for nil. Thus if I redefine nil, then I have
2093 :     changed the meaning of [] as well.
2094 :     Code:
2095 :     Transcript:
2096 :     - datatype t = nil;
2097 :     datatype t
2098 :     con nil : t
2099 :     - 1::[];
2100 :     std_in:4.1-4.5 Error: operator and operand don't agree (tycon mismatch)
2101 :     operator domain: int * int list
2102 :     operand: int * t
2103 :     in expression:
2104 :     :: (1,nil)
2105 :     Fix: [Pierre Cregut, 3/3/94]
2106 :     In prim.sml:
2107 :     ("nil", nilDcon),
2108 :     ("cons::", consDcon),
2109 :     ("nil[]", nilDcon),
2110 :     In astutil.sml:
2111 :     val nilDcon = [varSymbol "nil[]"]
2112 :     val consDcon = [varSymbol "cons::"]
2113 :    
2114 :     This is invisible to the user and is much more resistant (you can still
2115 :     break it by giving a parse tree to the compiler but this is a very weird
2116 :     kind of use, I don't feel necessary to find a defense against it).
2117 :    
2118 :     Comment: According to The Definition of Standard ML, this is the right
2119 :     behavior. However, the Definition is silly.
2120 :    
2121 :     Status: fixed in 1.03f
2122 :     ----------------------------------------------------------------------
2123 :     Number: 851
2124 :     Title: bogus "op" warnings
2125 :     Keywords:
2126 :     Submitter: Morten Welinder (terra@diku.dk)
2127 :     Date: 2/2/94
2128 :     System(s) and Version: sml-nj
2129 :     SML/NJ Version: 0.93
2130 :     Machine: irrelevant (sun4)
2131 :     Severity: minor
2132 :     Problem: bogus warnings about `op'
2133 :     Code:
2134 :    
2135 :     structure S = struct
2136 :     datatype tree =
2137 :     ADDI of tree*tree
2138 :     | ADDRLP
2139 :     | ASGNI of tree*tree
2140 :     | CNSTI
2141 :     | CVCI of tree
2142 :     | I0I
2143 :     | INDIRC of tree;
2144 :    
2145 :     datatype foo * rule =
2146 :     stmt_ASGNI_disp_reg of (foo * rule * tree) * (foo * rule * tree)
2147 :     | stmt_reg of (foo * rule * tree)
2148 :     | reg_ADDI_reg_rc of (foo * rule * tree) * (foo * rule * tree)
2149 :     | reg_CVCI_INDIRC_disp of (foo * rule * tree)
2150 :     | reg_IOI
2151 :     | reg_disp of (foo * rule * tree)
2152 :     | disp_ADDI_reg_con of (foo * rule * tree) * (foo * rule * tree)
2153 :     | disp_ADDRLP
2154 :     | rc_con of (foo * rule * tree)
2155 :     | rec_reg of (foo * rule * tree)
2156 :     | con_CNSTI
2157 :     | con_IOI
2158 :     withtype foo = int Array.array
2159 :     end;
2160 :    
2161 :     Transcript:
2162 :    
2163 :     - use "bug.sml";
2164 :     [opening bug.sml]
2165 :     bug.sml:11.16 Warning: unnecessary `op'
2166 :     bug.sml:11.16 Warning: unnecessary `op'
2167 :     bug.sml:11.16 Warning: unnecessary `op'
2168 :     bug.sml:11.16 Warning: unnecessary `op'
2169 :     bug.sml:11.16 Error: syntax error found at ASTERISK
2170 :     -
2171 :     Comments: I grog the error message, but the warnings...
2172 :     This strange behaviour goes away if `structure'
2173 :     is removed or if the correct datatype is removed.
2174 :    
2175 :     FYI, the above came as a result of a search-and-
2176 :     replace command.
2177 :     Status: fixed in 1.03f
2178 :     ----------------------------------------------------------------------
2179 :     Number: 852
2180 :     Title: include merging types
2181 :     Keywords:
2182 :     Submitter: Philip Santas <santas@inf.ethz.ch>
2183 :     Date: 2/25/94
2184 :     Version: 0.93
2185 :     Severity: major
2186 :     Problem:
2187 :     The following is allowed:
2188 :    
2189 :     signature AM =
2190 :     sig type R val plus:R->R->R and zero:R end
2191 :     signature MM =
2192 :     sig type R val times:R->R->R and one:R end
2193 :     signature S1 = sig include AM MM end;
2194 :     structure M:S1 = struct type R=int fun
2195 :     plus(x:int)y=x+y val zero=0
2196 :     val one=1 fun times(x:int)y=x*y end;
2197 :    
2198 :     but this is not allowed:
2199 :    
2200 :     signature S1 = sig include AM type R end;
2201 :    
2202 :     Owner: dbm
2203 :     Status: open
2204 :     ----------------------------------------------------------------------
2205 :     Number: 853
2206 :     Title: exportML under Ultrix 4.3
2207 :     Keywords:
2208 :     Submitter: Josh Pritikin <joshp@cmu.edu>
2209 :     Date: 2/12/94
2210 :     SML/NJ Version: 0.93
2211 :     Machine: Decstation, ULTRIX 4.3
2212 :     Severity: critical
2213 :     Problem: can't exportML SML
2214 :     Code: src/makeml -decstation ultrix
2215 :     Transcript: see following
2216 :    
2217 :     ---
2218 :     [Loading boot/overloads.sml]
2219 :     structure Overloads : ...
2220 :     Go for it
2221 :     -
2222 :     [Major collection... 10% used (556732/5342920), 535 msec]
2223 :    
2224 :     [Decreasing heap to 2743k]
2225 :    
2226 :     [Major collection... 99% used (560944/561408), 511 msec]
2227 :     ==> Inconsistent object for export: !(sh->s_scnptr == headersize)
2228 :    
2229 :     uncaught exception Io "exportML "sml": Not a typewriter"
2230 :     ---
2231 :     Also, the /lib/cpp on my machine thinks that $'s are part of
2232 :     identifiers. This breaks prim.s. The work around I used was to use
2233 :     gcc's cpp with the -$ switch.
2234 :    
2235 :     Owner:
2236 :     Status: obsolete
2237 :     ----------------------------------------------------------------------
2238 :     Number: 854
2239 :     Title: excessive spilling with large let expressions
2240 :     Keywords:
2241 :     Submitter: Kristian Nielsen (bombadil@diku.dk)
2242 :     Date: 2/14/94
2243 :     System(s) and Version: SML/NJ with eddingburgh library
2244 :     SML/NJ Version: 0.93
2245 :     Machine: sun4 /SunOS
2246 :     Severity: minor
2247 :     Problem:
2248 :    
2249 :     The SML/NJ compiler appears to handle (very) large let expressions (ie.
2250 :     let expressions containing many bindings) inefficiently.
2251 :    
2252 :     Comment: Lal is working on an improved spiller.
2253 :     Owner: lal
2254 :     Status: open
2255 :     ----------------------------------------------------------------------
2256 :     Number: 855
2257 :     Title: sharing in signatures
2258 :     Keywords: modules, signatures, sharing
2259 :     Submitter: Philip Santas <santas@inf.ethz.ch>
2260 :     Date: 2/19/94
2261 :     Version: 0.93
2262 :     Severity: major
2263 :     Problem:
2264 :    
2265 :     Some time ago, we were discussing if sharing constraints that
2266 :     identify the parameter structures T1 and T2 should be in the result
2267 :     signature or in the parameter signature.
2268 :    
2269 :     Now, the following behaviour puzzles me (once again):
2270 :    
2271 :     - signature C1 = sig type R val foo : R -> R end;
2272 :     - funsig Soo(structure T1:C1 structure T2:sig include C1 end)=
2273 :     = sig include C1 sharing T1 = T2 end;
2274 :     funsig Soo(<Parameter>:<sig>) =
2275 :     sig
2276 :     type R
2277 :     val foo : R -> R
2278 :     sharing <Argument>.<Parameter>.T2 = <Argument>.<Parameter>.T1
2279 :     end
2280 :    
2281 :     Here the result signature includes sharings. And here comes again the
2282 :     example which started this query in the past:
2283 :    
2284 :     - functor Foo(structure T1:C1 structure T2:sig include C1 end):
2285 :     = sig include C1 sharing T1 = T2 end =
2286 :     = struct type R = T2.R val foo = T1.foo end;
2287 :     std_in:6.33-6.39 Error: definitional sharing constraint T1 = T2 can never be satisfied
2288 :    
2289 :     where the result signature should not include constraints on the arguments.
2290 :     Now, the interesting comes here:
2291 :    
2292 :     - functor Foo(structure T1:C1
2293 :     structure T2:sig include C1 end
2294 :     sharing T1=T2):
2295 :     sig include C1 sharing T1 = T2 end =
2296 :     struct type R = T2.R val foo = T1.foo end;
2297 :     functor Foo : <sig>
2298 :    
2299 :     This is fine, since the sharing is propagated.
2300 :     (in a similar case we would have:
2301 :     - functor Goo(structure T1:C1): sig include C1 sharing T1 = T1 end =
2302 :     = struct type R = T1.R val foo = T1.foo end;
2303 :     functor Goo : <sig>
2304 :    
2305 :     The problem is that the type sharings are not propagated:
2306 :    
2307 :     - functor Foo(structure T1:C1
2308 :     structure T2:sig include C1 sharing type R=T1.R end):
2309 :     sig include C1 sharing T1 = T2 end =
2310 :     struct type R = T2.R val foo = T1.foo end;
2311 :     = = = std_in:15.36-15.42 Error: definitional sharing constraint T1 = T2 can never be satisfied
2312 :    
2313 :     although this is accepted:
2314 :    
2315 :     - functor Foo(structure T1:C1
2316 :     = structure T2:sig include C1 end
2317 :     = sharing T1=T2)
2318 :     = : sig sharing type T1.R = T2.R end =
2319 :     = struct type R = T2.R val foo = T1.foo end;
2320 :     functor Foo : <sig>
2321 :    
2322 :     Owner: dbm
2323 :     Status: obsolete
2324 :     ----------------------------------------------------------------------
2325 :     Number: 856
2326 :     Title: unique constructors not representationally transparent
2327 :     Keywords:
2328 :     Submitter: John Reppy
2329 :     Date: 2/22/94
2330 :     Version: 1.02
2331 :     Severity: major
2332 :     Problem:
2333 :     I was looking at the CPS produced by 1.02 for my 4x4 matrix code, and it seems
2334 :     that the datatype declaration
2335 :    
2336 :     datatype matrix = M of RealArray.realarray
2337 :    
2338 :     involves an extra level of indirection. This is supported by the fact that
2339 :     changing the representation to
2340 :    
2341 :     type matrix = RealArray.realarray
2342 :    
2343 :     saves 4uS per matrix multiplication (about 5%). I thought that declarations
2344 :     like this don't impose overhead!
2345 :     Comments: [Zhong Shao, 2/22/94]
2346 :     You can view this as a bug. When I was implementing the representation
2347 :     analysis, I put back an extra level of indirection even for transparent
2348 :     constructor to avoid extra boxing and unboxing operations (this is only
2349 :     true if you define datatype s = M of t where t is big record type).
2350 :    
2351 :     I'll fix this bug in my newer version of representation analysis code.
2352 :    
2353 :     [Lal, 10/28/99]
2354 :     Here is another instance of the bug:
2355 :    
2356 :     - datatype t = FOO of int;
2357 :     v86(v87[PV],v71[PV],v82[C],v83[PV],v84[PV],v85[PV],v73[PR1]) =
2358 :     v82(v82,v83,v84,v85,(I)0)
2359 :     datatype t = FOO of int
2360 :     - fun f(FOO 0) = 0
2361 :     = | f(FOO i) = i+1;
2362 :     v53(v54[PV],v14[PV],v42[C],v43[PV],v44[PV],v45[PV],v21[PR2]) =
2363 :     {RK_ESCAPE 1,(L)v46} -> v63
2364 :     {v63} -> v64
2365 :     v42(v42,v43,v44,v45,v64)
2366 :     v46(v61[PV],v60[PV],v59[C],v58[PV],v57[PV],v56[PV],v55[PV]) =
2367 :     v55.0 -> v62[I]
2368 :     if i31<>((I)0,v62) [v33] then
2369 :     +i31(v62,(I)1) -> v15[I]
2370 :     v59(v59,v58,v57,v56,v15)
2371 :     else
2372 :     v59(v59,v58,v57,v56,(I)0)
2373 :     val f = fn : t -> int
2374 :    
2375 :     [Zhong, 10/29/99]
2376 :     Actually, anything other than int31 is supported correctly,
2377 :     for example,
2378 :    
2379 :     datatype t = FOO of int * int
2380 :    
2381 :     is represented as a pair without indirection.
2382 :    
2383 :     -Zhong
2384 :    
2385 :     PS. For those who know about the conreps, the single-constructor
2386 :     datatype is now represented as UNTAGGED; that is,
2387 :    
2388 :     datatype t = FOO of int
2389 :    
2390 :     is represented same as FOO in the following datatype:
2391 :    
2392 :     datatype t = FOO of int
2393 :     | BAR
2394 :    
2395 :     which has to box the FOO because BAR is represented using int31.
2396 :    
2397 :    
2398 :     Owner: Zhong
2399 :     Status: open
2400 :     ----------------------------------------------------------------------
2401 :     Number: 857
2402 :     Title: type error message points to wrong place
2403 :     Keywords:
2404 :     Submitter: John Reppy (jhr@research.att.com)
2405 :     Date: 3/6/94
2406 :     System(s) and Version: Compiler
2407 :     SML/NJ Version: 1.02
2408 :     Machine: any
2409 :     Severity: minor
2410 :     Problem: type errors in mutually recursive function bindings do
2411 :     not expose the source of the error, even when a type
2412 :     constraint is used.
2413 :     Code:
2414 :     fun f x = (h x)+0.1 (* this is the bug *)
2415 :     and g x = (h x)+1
2416 :     and h (x) : int = 0;
2417 :    
2418 :     Transcript:
2419 :     Standard ML of New Jersey, Version 1.02, January 23, 1994 [SC 69a1]
2420 :     val it = () : unit
2421 :     - fun f x = (h x)+0.1 (* this is the bug *)
2422 :     = and g x = (h x)+1
2423 :     = and h (x) : int = 0;
2424 :     std_in:5.13-5.19 Error: operator and operand don't agree (tycon mismatch)
2425 :     operator domain: real * real
2426 :     operand: real * int
2427 :     in expression:
2428 :     + : overloaded ((h x),1)
2429 :     std_in:4.3-6.21 Error: pattern and expression in val rec dec don't agree (tycon mismatch)
2430 :     pattern: 'Z -> real
2431 :     expression: 'Z -> int
2432 :     in declaration:
2433 :     h = (fn x => (0: int))
2434 :    
2435 :     Comments: Note that errors were reported for the definition of both g
2436 :     and h, but not for f, which was the actual bug. Since h is
2437 :     constrained to have the return type of int, the use of h in f should
2438 :     be reported as an error.
2439 :     Test: bug857.sml
2440 :     Owner: dbm
2441 :     Status: open
2442 :     ----------------------------------------------------------------------
2443 :     Number: 858
2444 :     Title: Compiler bug: DebugError:Static.locOfEvent bad APPev marking
2445 :     Keywords:
2446 :     Submitter: Fred C Yankowski (+1 708 979 5472, intgp1!fcy)
2447 :     Date: 3/9/94
2448 :     Version: 0.93
2449 :     System: sparc?
2450 :     Severity: major
2451 :     Problem:
2452 :     Compiler bug: DebugError:Static.locOfEvent bad APPev marking
2453 :     occurs during call of usedbg on iterative fibonacci.
2454 :     Code: [file itfib.ml, from "ML for the Working Programmer"]
2455 :     fun itfib (n, prev, curr) : int =
2456 :     if n=1 then curr
2457 :     else itfib(n-1, curr, prev+curr);
2458 :    
2459 :     fun fib2 (n) =
2460 :     itfib(n, 0, 1);
2461 :    
2462 :     Transcript:
2463 :     hrdcpy< ~gregg/bin/smld
2464 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
2465 :     val it = () : unit
2466 :     - usedbg "itfib.ml";
2467 :     Error: Compiler bug: DebugError:Static.locOfEvent bad APPev marking
2468 :    
2469 :     - use "itfib.ml";
2470 :     [opening itfib.ml]
2471 :     val itfib = fn : int * int * int -> int
2472 :     val fib2 = fn : int -> int
2473 :     val it = () : unit
2474 :     - fib2 5;
2475 :     val it = 5 : int
2476 :    
2477 :     Status: fixed in 1.03f
2478 :     ----------------------------------------------------------------------
2479 :     Number: 859
2480 :     Title: bug 223 still open for HPPA
2481 :     Keywords:
2482 :     Submitter: Kristian Nielsen (bombadil@diku.dk)
2483 :     Date: 3/10/94
2484 :     System(s) and Version: SML/NJ
2485 :     SML/NJ Version: 0.93
2486 :     Machine: HPPA running HP-UX
2487 :     Severity: major
2488 :     Problem: Masterbug entry 223 ("nontty standard input and
2489 :     uncaught exceptions"), reported fixed for
2490 :     version 0.65, has not been fixed for the HPPA
2491 :     version of SML/NJ.
2492 :    
2493 :     Transcript:
2494 :    
2495 :     [128]narfe:~/smlmix/exp>rsh embla arch
2496 :     hp9000s700
2497 :     [129]narfe:~/smlmix/exp>rsh embla sml
2498 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
2499 :     Beta release version
2500 :     val it = () : unit
2501 :     - foo;
2502 :     std_in:2.1-2.3 Error: unbound variable or constructor: foo
2503 :     uncaught exception (Loader): SystemCall
2504 :     [130]narfe:~/smlmix/exp>rsh embla sml
2505 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
2506 :     Beta release version
2507 :     val it = () : unit
2508 :     - set_term_in(std_in, true);
2509 :     val it = () : unit
2510 :     - foo;
2511 :     std_in:3.1-3.3 Error: unbound variable or constructor: foo
2512 :     uncaught exception (Loader): SystemCall
2513 :     [131]narfe:~/smlmix/exp>rsh garm arch
2514 :     sun4
2515 :     [132]narfe:~/smlmix/exp>rsh garm sml
2516 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
2517 :     val it = () : unit
2518 :     - foo;
2519 :     std_in:2.1-2.3 Error: unbound variable or constructor: foo
2520 :     -
2521 :    
2522 :     Comments:
2523 :    
2524 :     The first two sml sessions are run on a HPPA machine (hp9000s700). They
2525 :     exhibit the same problem as the one reported in masterbugs entry 223.
2526 :     The second session shows that the fix given in masterbugs does not work.
2527 :    
2528 :     The third session is run on a sun4 machine. Here, the problem does not
2529 :     appear.
2530 :    
2531 :     [Lorenz, 4/4/97]
2532 :     bug 859 (aka 223) no longer manifests itself in 109.26:
2533 :    
2534 :     $ rsh islay "uname -a"
2535 :     HP-UX islay B.10.20 A 9000/778 2004213872 two-user license
2536 :     $ rsh islay /usr/local/sml/109.26/bin/sml
2537 :     Standard ML of New Jersey, Version 109.26, March 25, 1997 [new runtime]
2538 :     - foo;
2539 :     stdIn:7.1-7.4 Error: unbound variable or constructor: foo
2540 :     - ^D
2541 :     $
2542 :    
2543 :    
2544 :     Owner: Lal
2545 :     Status: open
2546 :     ----------------------------------------------------------------------
2547 :     Number: 860
2548 :     Title: exception Subscript raised while compiling curried functors (same as 803?)
2549 :     Keywords:
2550 :     Submitter: Chris Okasaki <cokasaki@cs.cmu.edu>
2551 :     Date: 3/16/94
2552 :     System(s) and Version: Compiler
2553 :     SML/NJ Version: 1.02
2554 :     Machine: DECstation 5000 running Mach
2555 :     Severity: minor/major
2556 :     Problem:
2557 :     exception Subscript raised while compiling curried functors
2558 :     Code:
2559 :     signature NUM =
2560 :     sig
2561 :     val n : int
2562 :     end
2563 :    
2564 :     functor LeftSection (structure A : NUM
2565 :     functor BinOp (structure A : NUM)
2566 :     (structure B : NUM) : NUM)
2567 :     (structure B : NUM) : NUM =
2568 :     struct
2569 :     structure Result = BinOp (structure A = A)
2570 :     (structure B = B)
2571 :     open Result
2572 :     end
2573 :    
2574 :     Transcript:
2575 :    
2576 :     cokasaki% sml
2577 :     Standard ML of New Jersey, Version 1.02z, 17 December 1993 [0.93 compatible]
2578 :     val it = () : unit
2579 :     - use "bug.sml"; (* contains the above code *)
2580 :     [opening simple.sml]
2581 :    
2582 :     uncaught exception Subscript
2583 :     -
2584 :    
2585 :     Comments:
2586 :     Problem goes away if the argument functor BinOp is uncurried, i.e.
2587 :    
2588 :     functor BinOp (structure A : NUM
2589 :     structure B : NUM) : NUM
2590 :    
2591 :     Status: fixed in 107
2592 :     ----------------------------------------------------------------------
2593 :     Number: 861
2594 :     Title: won't build on NeXTSTEP/486
2595 :     Keywords:
2596 :     Submitter: <Andreas
2597 :     Hallmann<hallmann@ls5.informatik.uni-dortmund.de>>
2598 :     Date: 3/15/94
2599 :     System(s) and Version: gcc
2600 :     SML/NJ Version: 0.93
2601 :     Machine: i486 & NeXTSTEP
2602 :     Severity: major
2603 :     Problem: It's imposible to compile sml for NeXTSTep on
2604 :     Intel
2605 :     Comments: I would realy like sml to run on our Intel-based
2606 :     NEXTSTEP machines.
2607 :     Fix:
2608 :     None yet. I have tried to adapt the sources. But aspecially export.c
2609 :     needs changes of internal sml-structures. ( Due to differences between
2610 :     mach/i386/thread_status.h and mach/m68k/thread_status.h its not posible to to
2611 :     make the following change)
2612 :    
2613 :     # ifdef NeXT_3_0
2614 :     # ifdef I386
2615 :     # include <mach/i386/thread_status.h>
2616 :     # define NeXT_THREAD_STATE_REGS i386_THREAD_STATE_REGS
2617 :     # define NeXT_THREAD_STATE_REGS_COUNT i386_THREAD_STATE_REGS_COUNT
2618 :     # define NeXT_thread_state_regs i386_thread_state_regs
2619 :     # else I386
2620 :     # include <mach/m68k/thread_status.h>
2621 :     # define NeXT_THREAD_STATE_REGS M68K_THREAD_STATE_REGS
2622 :     # define NeXT_THREAD_STATE_REGS_COUNT M68K_THREAD_STATE_REGS_COUNT
2623 :     # define NeXT_thread_state_regs m68k_thread_state_regs
2624 :     # endif
2625 :     # endif
2626 :    
2627 :     o i386_THREAD_STATE_REGS
2628 :     o i386_THREAD_STATE_REGS_COUNT
2629 :     o i386_thread_state_regs
2630 :    
2631 :     are not defined anymore.
2632 :    
2633 :     Owner:
2634 :     Status: obsolete [NextStep not currently supported.]
2635 :     ----------------------------------------------------------------------
2636 :     Number: 862
2637 :     Title: fun decl can create holes in contructor scope
2638 :     Keywords:
2639 :     Submitter: Jeff Lewis (jlewis@cse.ogi.edu)
2640 :     Date: 3/17/94
2641 :     System(s) and Version: Compiler
2642 :     SML/NJ Version: 0.93
2643 :     Machine: N/A
2644 :     Severity: minor
2645 :     Problem:
2646 :    
2647 :     Use of a `val rec' declaration can cause a `hole' in the scope of a value
2648 :     or exception constructor - i.e. you are correctly unable to redefine `nil'
2649 :     with a `val' decl, but you can with a `val rec'. See rule 4 in the middle
2650 :     of page 5 of the definition, and the subsequent elaboration in the following
2651 :     paragraph. The `fun' derived form also allows you to incorrectly redefine nil
2652 :     (although the phrase `ignoring derived forms' in the paragraph before the
2653 :     indicated set of rules makes interpretation of the standard harder, there
2654 :     is otherwise no indication of how to differently interpret the derived forms
2655 :     in this regard).
2656 :    
2657 :     Code:
2658 :    
2659 :     Neither of these should work, but do:
2660 :     val rec nil = fn x => x
2661 :     -- or --
2662 :     fun nil x = x
2663 :    
2664 :     Status: fixed in 1.03f
2665 :     ----------------------------------------------------------------------
2666 :     Number: 863
2667 :     Title: Compiler bug: PPObj.switch: none of the datacons matched
2668 :     Keywords: open, top level
2669 :     Submitter: Andrew Appel
2670 :     Date: 3/24/94
2671 :     Version: 1.03f
2672 :     Severity: major
2673 :     Problem:
2674 :     Conflict of variables and constructors in top-level opens causes
2675 :     a compiler bug in PPVal.
2676 :     Code:
2677 :     Transcript:
2678 :     structure A = struct val p = 6 end
2679 :     structure B = struct val p = true end
2680 :     open B A
2681 :    
2682 :     Error: Compiler bug: PPObj.switch: none of the datacons matched
2683 :     Comment: same as bug 1000
2684 :     Test: bug863.sml
2685 :     Owner: dbm, Zhong
2686 :     Status: fixed in 109.26 [Zhong]
2687 :     ----------------------------------------------------------------------
2688 :     Number: 864
2689 :     Title: Overflow is handled inconsisently (see also bug 786)
2690 :     Keywords:
2691 :     Submitter: Morten Welinder (terra@diku.dk)
2692 :     Date: 3/25/94
2693 :     System(s) and Version: Compiler/Interpreter
2694 :     SML/NJ Version: 0.93
2695 :     Machine: HP9000 model 735 running hpux
2696 :     (probably others, but with minor variations)
2697 :     Severity: minor
2698 :     Problem: Overflow is handled inconsisently
2699 :     Code: See transscript:
2700 :     Transcript:
2701 :    
2702 :     # sml
2703 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
2704 :     Beta release version
2705 :     val it = () : unit
2706 :     - 2147483648;
2707 :    
2708 :     val it = 0 : int
2709 :     (* That was 2^31 *)
2710 :    
2711 :     - 1073741824;
2712 :     std_in:9.1-9.10 Error: integer too large
2713 :     (* That was 2^30 *)
2714 :    
2715 :     - ~ (~1073741824);
2716 :    
2717 :     uncaught exception Overflow
2718 :     (* This is as expected, although the Definition has its own ideas
2719 :     about the exception to raise. *)
2720 :    
2721 :     - 32768 * 32768;
2722 :     val it = ~1073741824 : int
2723 :     (* No exception raised ??? *)
2724 :    
2725 :     val it = 1073741823 : int
2726 :     - 32768 * 32767 + 32768;
2727 :    
2728 :     uncaught exception Overflow
2729 :     (* Yet here one is! *)
2730 :    
2731 :     - ~1073741824 div ~1;
2732 :    
2733 :     uncaught exception Overflow
2734 :     (* And here. Appel suggested in earlier smlnj-docs that "div" should be able
2735 :     to raise Overflow and Div (for 1 div 0). FYI, it would be extremely difficult
2736 :     to differentiate those two situations on certain CPUs (like Intel 386).
2737 :     It would require disassembly of the offending instruction and actually
2738 :     checking the divisor. *)
2739 :    
2740 :    
2741 :     - ~1073741824 - 1;
2742 :    
2743 :     uncaught exception Overflow
2744 :     (* And here *)
2745 :    
2746 :    
2747 :     Comments: "*" doesn't seem to check for overflow.
2748 :     [DBM: may have been fixed, since bug 786 is listed as fixed in 1.02.
2749 :     But 786 is for mipsel/ultrix.]
2750 :    
2751 :     Owner: Lal
2752 :     Status: fixed in 109.25.x [Lal]
2753 :     ----------------------------------------------------------------------
2754 :     Number: 865
2755 :     Title: inference for flex record patterns
2756 :     Keywords:
2757 :     Submitter: John Reppy (jhr@research.att.com)
2758 :     Date: 3/28/94
2759 :     System(s) and Version: Compiler
2760 :     SML/NJ Version: 1.04
2761 :     Machine: any
2762 :     Severity: minor
2763 :     Problem: inference for flex record patterns is not
2764 :     aggressive enough
2765 :     Code:
2766 :     Transcript:
2767 :     - fun f (x : {a : int}) = let fun g x = #a x in g x end;
2768 :     stdIn:27.24-27.38 Error: unresolved flex record
2769 :     (can't tell what fields there are besides #a)
2770 :    
2771 :     -
2772 :    
2773 :     Comments:
2774 :     When a polymorphic function is used monomorphically, as in the above
2775 :     example, it would be nice if the type checker would figure it out.
2776 :     I suspect that this applies to overloading, as well.
2777 :    
2778 :     Owner: dbm
2779 :     Test: bug865.sml
2780 :     Status: not a bug
2781 :     ----------------------------------------------------------------------
2782 :     Number: 866
2783 :     Title: illegal withtypes accepted
2784 :     Keywords:
2785 :     Submitter: Appel
2786 :     Date: 4/7/94
2787 :     Version: 0.93
2788 :     System: any
2789 :     Severity: minor
2790 :     Problem: types within a withtype are erroneously allowed to refer to
2791 :     each other
2792 :     Code:
2793 :     datatype x=T withtype a=int and b=a;
2794 :    
2795 :     Transcript:
2796 :     datatype x
2797 :     con T : x
2798 :     type a = int
2799 :     type b = a
2800 :     Comments:
2801 :    
2802 :     This is not legal, according to the Definition; the definition
2803 :     of a should not be visible when b is defined.
2804 :     The "and" combinator should not sequence the environments, but
2805 :     should allow independent simultaneous definitions.
2806 :    
2807 :     Fix:
2808 :    
2809 :     Status: not a bug, a feature
2810 :     ----------------------------------------------------------------------
2811 :     Number: 867
2812 :     Title: compilation hangs in the pickler
2813 :     Keywords:
2814 :     Submitter: Gene Rollins
2815 :     Date: 3/28/94
2816 :     Version: 1.02, also 107.7 with CM
2817 :     System: DECstation
2818 :     Severity: major
2819 :     Problem:
2820 :     SML/NJ 1.02 gets hung in the pickler for the following code:
2821 :     Code:
2822 :     signature SIG = sig type t end
2823 :    
2824 :     functor F (functor ID (S : SIG) : sig
2825 :     include SIG
2826 :     sharing type t = S.t
2827 :     end
2828 :     structure S : SIG) : SIG =
2829 :     struct
2830 :     structure S' = ID (S)
2831 :     open S'
2832 :     end
2833 :    
2834 :     or this simpler version (Andrew, 3/7/95)
2835 :    
2836 :     functor F (functor ID () : sig end) = struct end
2837 :    
2838 :     Transcript:
2839 :     To illustrate the problem place the above code in a file called
2840 :     "pickle-bug.sml". Then put the CompileFile structure, given below, into a file
2841 :     called "compile-file.sml". Then in an SML/NJ 1.02 image with SC, do this:
2842 :    
2843 :     use "compile-file.sml";
2844 :     c.c();
2845 :    
2846 :     Compilation should get hung after "compiler 5" is printed in the call to
2847 :     Pickle.pickleEnv. We only tried this on DecStations.
2848 :    
2849 :     A more complicated example appears in the SML distribution in
2850 :     "doc/examples/powerset.sml". The call c.compile "doc/examples/powerset.sml"
2851 :     should exhibit the same behavior as the call to c.c().
2852 :    
2853 :     structure CompileFile :sig
2854 :     val compile :string -> unit
2855 :     val c :unit -> unit
2856 :     end = struct
2857 :     open SC
2858 :     structure CompiledUnit = Compiling.CompiledUnit
2859 :     structure StaticTable = CompiledUnit.StaticTable
2860 :     structure Env = Compiler.Environment
2861 :     structure Compile = Compiler.Compile
2862 :     structure Pid = Compiler.PersStamps
2863 :     structure ErrorMsg = Compiler.ErrorMsg
2864 :     structure Source = Compiler.Source
2865 :     structure Pickle = Compiler.PickleEnv
2866 :     structure Recorder = Compiler.Recorder
2867 :     structure Watcher = Compiler.Watcher
2868 :     structure Interrupt = Utilities.Interrupt
2869 :     structure IO_Stream = Utilities.IO_Stream
2870 :     structure Print = Compiler.Control.Print
2871 :    
2872 :     type environment = Env.environment
2873 :     type staticEnv = Env.staticEnv
2874 :     type dynenv = Env.dynenv
2875 :     type pid = Pid.persstamp
2876 :     type source = Source.inputSource
2877 :     type time = System.Timer.time
2878 :     type compiledUnit = CompiledUnit.compiledUnit
2879 :     type staticTable = StaticTable.staticTable
2880 :    
2881 :     val C = CompiledUnit.C
2882 :     val ST = StaticTable.ST
2883 :     val mkPid = Pid.stringToStamp
2884 :     val pid2string = Pid.stampToString
2885 :     exception Compile = Compile.Compile
2886 :     val staticPart = Env.staticPart
2887 :     val dynamicPart = Env.dynamicPart
2888 :    
2889 :     fun reading file = print ("[reading " ^ file ^ "]\n")
2890 :     fun writing file = print ("[writing " ^ file ^ "]\n")
2891 :     fun closing file = print ("[closing " ^ file ^ "]\n")
2892 :     fun check errs phase =
2893 :     if ErrorMsg.anyErrors errs then raise Compile (phase^ " failed") else ()
2894 :    
2895 :     fun withSource (sourceName:string)
2896 :     (action :source -> 'a -> 'b) (argument:'a) : 'b =
2897 :     let val sourceStream = open_in sourceName
2898 :     val source = Source.newSource (sourceName, 1, sourceStream, false,
2899 :     {consumer = Print.say,
2900 :     flush = Print.flush,
2901 :     linewidth = !Print.linewidth}, NONE)
2902 :     val errors = ErrorMsg.errors source
2903 :     fun cleanup () = (Source.closeSource source; closing sourceName)
2904 :     val result = action source argument
2905 :     handle exn => (cleanup(); raise exn)
2906 :     in Source.closeSource source;
2907 :     cleanup(); result
2908 :     end
2909 :    
2910 :     val coreEnvRef = ref(!Env.coreEnvRef)
2911 :    
2912 :     fun compiler (source, StaticTable.ST{senv,ids}) :compiledUnit =
2913 :     let val _ = print "enter compiler\n"
2914 :     val errors = ErrorMsg.errors source
2915 :     val {ast,...} = Compile.parse {source=source,compenv=senv}
2916 :     val _ = print " compiler 1\n"
2917 :     val (recorder, tableRef) = Recorder.makeRecorder()
2918 :     val env' = Watcher.watch(senv,[],recorder)
2919 :     val _ = print " compiler 2\n"
2920 :     val {absyn,newenv,exports,exportLvars,staticPid} =
2921 :     Compile.elaborate{errors=errors, compenv=env',
2922 :     corenv= !coreEnvRef,
2923 :     transform = (fn x=>x), ast=ast}
2924 :     before check errors "elaboration"
2925 :     val _ = print " compiler 3\n"
2926 :     val {lambda,imports} = Compile.translate
2927 :     {errors=errors, absyn=absyn,
2928 :     corenv= !coreEnvRef,
2929 :     exportLvars = exportLvars,
2930 :     statenv = Env.layerStatic(newenv,env')}
2931 :     before check errors "translation"
2932 :     val _ = print " compiler 4\n"
2933 :     val code = Compile.codegen{errors=errors,lambda=lambda}
2934 :     before check errors "codegen"
2935 :     val _ = print " compiler 5\n"
2936 :     val pickledEnv = Pickle.pickleEnv{env=newenv,extern_table= !tableRef}
2937 :     val _ = print " compiler 6\n"
2938 :     in C {imports=imports, exports=exports, code=code, staticEnv=newenv,
2939 :     staticPid=staticPid, references=ids, pickled_env=pickledEnv}
2940 :     end
2941 :    
2942 :     val initialSE = Env.staticPart (!Env.pervasiveEnvRef)
2943 :     val initialST = ST {senv=initialSE, ids=[]}
2944 :    
2945 :     fun compile (sourceName:string) :unit =
2946 :     let val _ = reading sourceName
2947 :     fun comp source st = compiler (source, st)
2948 :     val compUnit = withSource sourceName comp initialST
2949 :     in
2950 :     print "compile Done\n"
2951 :     end
2952 :    
2953 :     fun c () = compile "pickle-bug.sml"
2954 :     end
2955 :    
2956 :     structure c = CompileFile
2957 :    
2958 :     Owner:
2959 :     Status: obsolete
2960 :     ----------------------------------------------------------------------
2961 :     Number: 868
2962 :     Title: "Compiler bug: distributeT: dist_abv" caused by type abbrev in sign
2963 :     Keywords:
2964 :     Submitter: Matthias Blume <blume@cs.Princeton.EDU>
2965 :     Date: 3/29/94
2966 :     Version: 1.03f?
2967 :     System: ?
2968 :     Severity: major
2969 :     Problem:
2970 :     Compiler bug: distributeT: dist_abv
2971 :     Code:
2972 :     signature COMPILER = sig
2973 :     structure PersStamps : sig
2974 :     type persstamp = Compiler.PersStamps.persstamp
2975 :     end
2976 :     end;
2977 :    
2978 :     Code: (from Zhong Shao)
2979 :     functor F(S : sig type t = int end) = struct end;
2980 :     Transcript:
2981 :     - functor F(S : sig type t = int end) = struct end;
2982 :     Error: Compiler bug: distributeT: dist_abv
2983 :    
2984 :     Comments: The above code works fine if the signature definition is
2985 :     pulled out from the functor declaration, that is, if
2986 :     we define
2987 :     signature SIG = sig type t = int end
2988 :     then say
2989 :     functor F(S : SIG) = struct end
2990 :     everything works fine.
2991 :    
2992 :     Transcript: (from Kwang Yi, 10/18/94)
2993 :     - signature foo =
2994 :     = sig
2995 :     = structure A: sig type elmt = int end
2996 :     = end;
2997 :     Error: Compiler bug: distributeT: dist_abv
2998 :    
2999 :     Status: fixed in 107 (dbm, 11/30/94)
3000 :     ----------------------------------------------------------------------
3001 :     Number: 869
3002 :     Title: uncaught exception: Subscript -- compiling signature with type def
3003 :     Keywords:
3004 :     Submitter: Matthias Blume <blume@cs.Princeton.EDU>
3005 :     Date: 3/31/94
3006 :     Version: 1.03f?
3007 :     System: ?
3008 :     Severity: major
3009 :     Problem:
3010 :     Code:
3011 :     signature S1 =
3012 :     sig
3013 :     structure A: sig type s end (* necessary, & must come before B *)
3014 :     structure B: sig type t end
3015 :     end;
3016 :    
3017 :     signature S2 =
3018 :     sig
3019 :     structure C: S1
3020 :     type v = C.B.t
3021 :     end;
3022 :    
3023 :     Comments:
3024 :     It's a bit odd, because when I delete structure A from signature S1
3025 :     or even when I just exchange it with structure B then I don't get
3026 :     this error. I wasn't able to locate the module where the exception is
3027 :     raised.
3028 :    
3029 :     Same as bug 906 [dbm].
3030 :    
3031 :     Status: fixed in 107 (dbm)
3032 :     ----------------------------------------------------------------------
3033 :     Number: 870
3034 :     Title: error in documentation of revfold
3035 :     Keywords:
3036 :     Submitter: G. Ramalingam (rama@watson.ibm.com)
3037 :     Date: 4/20/94
3038 :     System(s) and Version: Documentation
3039 :     SML/NJ Version: 0.93
3040 :     Problem:
3041 :     The order of arguments in the example of revfold in page BASE-19 is wrong.
3042 :     The parameters for the innermost use of "f" appear in the correct order,
3043 :     but the parameters appear in the wrong order for all other uses of "f".
3044 :     Fix:
3045 :     Should read:
3046 :     f( l subscript |l|-1, f ( l subscript |l|-2, ... f( l subscript 0, z)...))
3047 :     Owner:
3048 :     Status: obsolete
3049 :     ----------------------------------------------------------------------
3050 :     Number: 871
3051 :     Title: inaccurate error message
3052 :     Keywords:
3053 :     Submitter: John Reppy
3054 :     Date: 4/24/94
3055 :     Version: 1.03f
3056 :     System: ?
3057 :     Severity: minor
3058 :     Problem:
3059 :     The following error message gets generated even when no functors are being used,
3060 :     so it shouldn't talk about the "functor formal parameter".
3061 :    
3062 :     interp.sml:6.11-431.5 Error: The constructor CONT of datatype next_state
3063 :     has different representations in the signature and the structure.
3064 :     Change the definition of the types carried by the constructors in the
3065 :     functor formal parameter and the functor actual parameter so that
3066 :     they are both abstract, or so that neither is abstract.
3067 :    
3068 :     Owner:
3069 :     Status: obsolete
3070 :     ----------------------------------------------------------------------
3071 :     Number: 872
3072 :     Title: need more info in error message
3073 :     Keywords: error message
3074 :     Submitter: John Reppy
3075 :     Date: 5/2/94
3076 :     Version: 1.03f
3077 :     Severity: minor
3078 :     Problem:
3079 :     The error message below should include the name of the constructor being
3080 :     rebound!
3081 :     Transcript:
3082 :     % sml
3083 :     Standard ML of New Jersey, Version 1.03f, April 11, 1994
3084 :     - val rec nil = fn x => x;
3085 :     std_in:2.9-2.23 Error: rebinding data constructor as variable
3086 :     - fun nil(x) = x;
3087 :     std_in:0.0-0.0 Error: rebinding data constructor as variable
3088 :     -
3089 :    
3090 :     (Please ignore the bogus line numbers! That bug need not concern us here.)
3091 :     Comment:
3092 :     This is in response to Andrew's message about fixing bug 862.
3093 :     Status: fixed in 107.4 (plus)
3094 :     ----------------------------------------------------------------------
3095 :     Number: 873
3096 :     Title: faster nthtail suggested
3097 :     Keywords:
3098 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
3099 :     Date: 4/26/94
3100 :     System(s) and Version: SML/NJ 0.93 compiler
3101 :     SML/NJ Version: 0.93
3102 :     Machine: SparcStation, SunOS 4.1.3
3103 :     Severity: minor
3104 :     Problem: List.nthtail could be faster
3105 :     Code:
3106 :    
3107 :     val biglist = Iterate.iterate (fn l => 1::l) 10000 [1];
3108 :     fun wrap cnt f arg = Iterate.iterate (fn n => (f arg;n)) cnt ();
3109 :     (* See below for faster nthtail. *)
3110 :    
3111 :     Transcript:
3112 :    
3113 :     - use "foo.sml";
3114 :     [opening foo.sml]
3115 :     structure MyNth : sig val nthtail : 'a list * int -> 'a list end
3116 :     val it = () : unit
3117 :     - (timeit (wrap 100000 MyNth.nthtail) (biglist, 100),timeit (wrap 100000 List.nthtail) (biglist, 100));
3118 :     val it =
3119 :     (" user: 1.660000 sys: 0.0 gc: 0.010000 wall: 2.002815 ",
3120 :     " user: 2.330000 sys: 0.0 gc: 0.0 wall: 4.323915 ") : string * string
3121 :     -
3122 :    
3123 :     Comments:
3124 :    
3125 :     I noticed that in the environment I run in pattern matching is much
3126 :     faster than recursion for dismantling lists. I assume that this is
3127 :     true in general for SML/NJ.
3128 :    
3129 :     This code is 20-30% faster than List.nthtail on getting a distant tail
3130 :     (e.g. 100) of a long list. There appears to be no degredation in
3131 :     performance for short lists.
3132 :    
3133 :     It may be even better than that. When I separately compile the code
3134 :     for nthtail it is about 80% slower than List.nthtail. I don't fully
3135 :     understand where this speed difference comes from, but it does not
3136 :     surprise me.
3137 :    
3138 :     I added levels of lookahead until the pattern matching appeared to
3139 :     cost more than it bought. This seems to happen at about n=13.
3140 :     However, above n=8 I noticed a bimodal behaviour in which sequential
3141 :     tests of nthtail could be 3-4 times slower. This appears particularly
3142 :     likely to happen if I recompile the same code again. This is really
3143 :     hard to reproduce, so I'm not making a formal bug report for it.
3144 :    
3145 :     I've been using user times as reported by timeit from TIMER(SYS).
3146 :    
3147 :     Fix:
3148 :     fun nthtail (e,0) = e
3149 :     | nthtail(_::r,1) = r
3150 :     | nthtail(_::_::r,2) = r
3151 :     | nthtail(_::_::_::r,3) = r
3152 :     | nthtail(_::_::_::_::r,4) = r
3153 :     | nthtail(_::_::_::_::_::r,5) = r
3154 :     | nthtail(_::_::_::_::_::_::r,6) = r
3155 :     | nthtail(_::_::_::_::_::_::_::r,7) = r
3156 :     | nthtail(_::_::_::_::_::_::_::_::r,8) = r
3157 :     | nthtail(_::_::_::_::_::_::_::_::r,n) = nthtail(r,n-8)
3158 :     | nthtail(_::_::_::_::_::_::_::r,n) = nthtail(r,n-7)
3159 :     | nthtail(_::_::_::_::_::_::r,n) = nthtail(r,n-6)
3160 :     | nthtail(_::_::_::_::_::r,n) = nthtail(r,n-5)
3161 :     | nthtail(_::_::_::_::r,n) = nthtail(r,n-4)
3162 :     | nthtail(_::_::_::r,n) = nthtail(r,n-3)
3163 :     | nthtail(_::_::r,n) = nthtail(r,n-2)
3164 :     | nthtail(e::r,n) = nthtail(r,n-1)
3165 :     | nthtail _ = raise List.NthTail
3166 :    
3167 :     Owner: John
3168 :     Status: not a bug (a suggestion)
3169 :     ----------------------------------------------------------------------
3170 :     Number: 874
3171 :     Title: scheduler improperly reording instructions
3172 :     Keywords:
3173 :     Submitter: John Reppy (jhr@research.att.com)
3174 :     Date: 4/26/94
3175 :     System(s) and Version: Compiler
3176 :     SML/NJ Version: 0.93 - 1.04
3177 :     Machine: SPARC
3178 :     Severity: major
3179 :     Problem: The scheduler seems to be reordering instructions on
3180 :     the SPARC in a way that violates sml exception
3181 :     semantics (which can cause an infinite loop).
3182 :     Code:
3183 :     (* this is an example of memoizing *)
3184 :     val f = let
3185 :     exception notFound
3186 :     fun lookup(a,[]) = raise notFound
3187 :     | lookup (a, (b,ans)::rest) = if a=b then ans else lookup(a,rest)
3188 :     val prev = ref []
3189 :     fun g 0 = 1
3190 :     | g ~1 = 0
3191 :     | g ~2 = 0
3192 :     | g n = (lookup(n,!prev)
3193 :     handle notFound =>
3194 :     let val soln = g(n-3)+g(n-2)+g(n-1)
3195 :     in prev := (n,soln) :: !prev;
3196 :     soln
3197 :     end)
3198 :     in
3199 :     (g, prev)
3200 :     end
3201 :     Transcript:
3202 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
3203 :     val it = () : unit
3204 :     - use "bug.sml";
3205 :     [opening bug.sml]
3206 :     val f = fn : int -> int
3207 :     val prev = ref [] : (int * int) list ref
3208 :     val it = () : unit
3209 :     - (f 35);
3210 :    
3211 :     uncaught exception Overflow
3212 :     - length (!prev);
3213 :     Here it is in an infinite loop !!
3214 :    
3215 :     If you turn scheduling off, however, things work okay:
3216 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
3217 :     val it = () : unit
3218 :     - System.Control.CG.scheduling := false;
3219 :     val it = () : unit
3220 :     - use "bug.sml";
3221 :     [opening bug.sml]
3222 :     val f = fn : int -> int
3223 :     val prev = ref [] : (int * int) list ref
3224 :     val it = () : unit
3225 :     - (f 35);
3226 :    
3227 :     uncaught exception Overflow
3228 :     - length (!prev);
3229 :     val it = 34 : int
3230 :     -
3231 :    
3232 :     Comments:
3233 :     This bug was reported by Charlie Fischer. I'd guess that the problem
3234 :     is a missing dependency in the SPARC instruction description. I also
3235 :     tried it on a MIPS machine, and there was no problem, so I think that
3236 :     it is SPARC specific.
3237 :    
3238 :     Owner: Lal ?
3239 :     Test: bug874.sml
3240 :     Status: fixed in 109.31 [Lal, 8/18/97]
3241 :     ----------------------------------------------------------------------
3242 :     Number: 875
3243 :     Title: exception Nth while calling List.nth in interpreter
3244 :     Keywords:
3245 :     Submitter: Lorenz Huelsbergen (lorenz@research.att.com)
3246 :     Date: 5/6/94
3247 :     Version: 1.03 (above 0.93)
3248 :     System: SGI Challenge, mipsb, irix 5.2
3249 :     Severity: major
3250 :     Problem: calling supplied List.nth function with valid args
3251 :     while interpreting raises exception Nth.
3252 :     Code: Compiler.Control.interp := true;
3253 :     nth ([1,2,3],1);
3254 :     Transcript:
3255 :     Standard ML of New Jersey, Version 1.03, February 14, 1994 [new runtime]
3256 :     - Compiler.Control.interp := true;
3257 :     val it = () : unit
3258 :     - nth ([1,2,3],1);
3259 :    
3260 :     uncaught exception Nth
3261 :     -
3262 :    
3263 :     Comments:
3264 :     Works correctly on sparc, i386. Others untested.
3265 :     This is also a problem under 1.02, but it works under 0.93.
3266 :    
3267 :     This bug does not appear in a compiler built with representation
3268 :     analysis turned off (Compiler.Control.CG.representations := false).
3269 :    
3270 :     Owner:
3271 :     Status: obsolete [interpreter not currently supported]
3272 :     ----------------------------------------------------------------------
3273 :     Number: 876
3274 :     Title: uninformative type error message
3275 :     Keywords: error message
3276 :     Submitter: Charles Fischer <fischer@cs.wisc.edu>
3277 :     Date: 5/12/94
3278 :     Version: 1.03f?
3279 :     Severity: major
3280 :     Problem:
3281 :     The [type] error messages are often useless.
3282 :     Transcript:
3283 :     mr:4.1-7.8 Error: pattern and expression in val rec dec don't agree (tycon mismatch)
3284 :     pattern: ('Z * 'Z * 'Z -> 'Y) -> 'Z list -> 'Z
3285 :     expression: ('Z * 'Z * 'Z -> 'Y) * 'Z list -> 'Y
3286 :     in declaration:
3287 :     mR =
3288 :     (fn (f,<pat> :: <pat>) => f (<exp>,<exp>,<exp>)
3289 :     | (f,<pat> :: <pat>) => let val <binding> in (<exp>) end)
3290 :    
3291 :     Comment: [jhr]
3292 :     I think that "mysterious" is more accurate; after all, this does tell you that
3293 :     you have a type mismatch. But I agree that we need to improve the messages.
3294 :     I'd also like to provide a summary of the error messages with examples of how
3295 :     they arise.
3296 :    
3297 :     Owner: dbm
3298 :     Status: open
3299 :     ----------------------------------------------------------------------
3300 :     Number: 877
3301 :     Title: System.Unsafe.blast_read raises the exception uncaught exception Ord
3302 :     Keywords:
3303 :     Submitter: Franz.Korf@arbi.informatik.uni-oldenburg.de
3304 :     Date: 5/17/94
3305 :     System(s) and Version:
3306 :     SML/NJ Version: 0.93
3307 :     Machine: SPARC 10 SunOS 4.1.3
3308 :     Severity: major
3309 :     Problem:
3310 :     System.Unsafe.blast_read raises the exception uncaught exception Ord
3311 :     Code: The following example will show the problem to you:
3312 :    
3313 :     Step 1: Start sml (version 0.93) and execute the following code:
3314 :     =======
3315 :     fun write2stream(filename, l : int list) =
3316 :     let val outstream = open_out(filename);
3317 :     in System.Unsafe.blast_write(outstream,l);
3318 :     close_out(outstream)
3319 :     end;
3320 :    
3321 :     val l = ref [1];
3322 :    
3323 :     fun gen_list(i) =
3324 :     let val ri = ref i;
3325 :     in while (!ri > 0) do
3326 :     (l := !ri :: !l; ri := !ri -1)
3327 :     end;
3328 :    
3329 :     val _ = gen_list(3000000);
3330 :    
3331 :     write2stream("weg", !l);
3332 :    
3333 :     Step 2: Start sml (version 0.93) again and execute the following code:
3334 :     =======
3335 :     fun read_from_stream(filename) =
3336 :     let val size = System.Unsafe.SysIO.fsize(
3337 :     System.Unsafe.SysIO.PATH(filename));
3338 :     val instream = open_in(filename);
3339 :     val file_contents = System.Unsafe.blast_read(instream,size) : int list
3340 :     in close_in(instream); file_contents
3341 :     end;
3342 :    
3343 :     read_from_stream("weg");
3344 :    
3345 :     The system will raise the exception : uncaught exception Ord
3346 :    
3347 :     Owner: John
3348 :     Status: obsolete [new runtime]
3349 :     ----------------------------------------------------------------------
3350 :     Number: 878
3351 :     Title: "Error: Compiler bug: getSymbols" compiling h.o. functor
3352 :     Keywords:
3353 :     Submitter: Alan Smaill, smaill@lfcs.ed.ac.uk
3354 :     Date: 5/21/94
3355 :     System(s) and Version: Compiler
3356 :     SML/NJ Version: 0.93
3357 :     Machine: Sparc, Solaris
3358 :     Severity: minor
3359 :     Problem: Use of functor argument to functors
3360 :     needs more signature info than expected.
3361 :     Code:
3362 :    
3363 :     Extending the example from the documentation:
3364 :    
3365 :     signature MONOID =
3366 :     sig
3367 :     type t
3368 :     val plus: t * t -> t
3369 :     val e:t
3370 :     end;
3371 :    
3372 :    
3373 :     funsig PROD (structure M:MONOID and N:MONOID) = MONOID;
3374 :    
3375 :     functor Square (structure X:MONOID functor Prod:PROD) =
3376 :     Prod(structure M=X and N=X);
3377 :    
3378 :    
3379 :     structure IntMonoid : MONOID =
3380 :     struct
3381 :     type t = int
3382 :     fun plus (x,y) = x+y : int
3383 :     val e = 0
3384 :     end;
3385 :    
3386 :    
3387 :     functor Prod (structure M:MONOID and N:MONOID) : MONOID =
3388 :     struct
3389 :     type t = M.t * N.t
3390 :     fun plus ((m1,n1), (m2,n2) ) = (M.plus (m1,m2), N.plus(n1,n2))
3391 :     val e = (M.e,N.e)
3392 :     end;
3393 :    
3394 :     structure IntPairMonoid = Square (structure X = IntMonoid
3395 :     functor Prod = Prod);
3396 :    
3397 :     (*
3398 :     No problem if signature added to the above:
3399 :     structure IntPairMonoid: MONOID = Square (structure X = IntMonoid
3400 :     functor Prod = Prod);
3401 :     *)
3402 :    
3403 :     Transcript:
3404 :     - open IntPairMonoid;
3405 :     Error: Compiler bug: getSymbols
3406 :    
3407 :     Comments:
3408 :     It works if the output structure sig is given, as in the comments.
3409 :    
3410 :     Status: fixed in 106
3411 :     ----------------------------------------------------------------------
3412 :     Number: 879
3413 :     Title: error code for uncaught exceptions of exportFn images
3414 :     Keywords: exportFn, exceptions
3415 :     Submitter: Andrew Appel
3416 :     Date: 5/25/94
3417 :     Version: 1.03f
3418 :     Severity: minor
3419 :     Problem:
3420 :     exportFn handles an uncaught exception by printing a message
3421 :     and then calling exit(0). It should exit with an error code of 1,
3422 :     so that exceptional exits will give the right error code to Unix.
3423 :     Non-exceptional exits should do exit(0), of course.
3424 :     Comments:
3425 :     I could hack this in quite easily, but I imagine things will
3426 :     change with the new runtime system.
3427 :     Owner: John
3428 :     Status: fixed in 109.21
3429 :     ----------------------------------------------------------------------
3430 :     Number: 880
3431 :     Title: #n is not understood for n >= 10
3432 :     Keywords:
3433 :     Submitter: jont@uk.co.harlqn (Jon Thackray)
3434 :     Date: 5/31/94
3435 :     Version: SML/NJ 0.75, 0.93
3436 :     System: Sun 4/330 SunOS 4.1
3437 :     Severity: minor
3438 :     Problem: #n is not understood for n >= 10
3439 :     Code:
3440 :    
3441 :     val y = (0,0,0,0,0,0,0,0,0,0)
3442 :     val x = #10 y
3443 :    
3444 :     Transcript:
3445 :    
3446 :     - use"script2.sml";
3447 :     [opening /usr/users/jont/ml/ml_test/MLW/src/images/script2.sml]
3448 :     /usr/users/jont/ml/ml_test/MLW/src/images/script2.sml:2.1-2.13 Error: operator and operand don't agree (record labels)
3449 :     operator domain: {10:'Z,...}
3450 :     operand: int * int * int * int * int * int * int * int * int * int
3451 :     in expression:
3452 :     (fn {10=10,...} => 10) y
3453 :     [closing /usr/users/jont/ml/ml_test/MLW/src/images/script2.sml]
3454 :    
3455 :     Owner: dbm
3456 :     Status: fixed in 109.21
3457 :     ----------------------------------------------------------------------
3458 :     Number: 881
3459 :     Title: Higher order functors without origin's don't work.
3460 :     Keywords:
3461 :     Submitter: Pierre Cregut <cregut@LANNION.cnet.fr>
3462 :     Date: 6/2/94
3463 :     Version: 1.02
3464 :     Severity: major
3465 :     Problem:
3466 :     Higher order functors without origin's don't work.
3467 :     Code:
3468 :     Transcript:
3469 :     - functor f(functor g():sig type t end) : sig type t end =
3470 :     = struct
3471 :     = structure a = g()
3472 :     = type t = a.t
3473 :     = end;
3474 :     functor f : <sig>
3475 :     - structure A = f(functor g()=struct type t = int end);
3476 :     structure A : sig eqtype t end
3477 :     - 3:A.t;;
3478 :     (* on .93 *)
3479 :     val it = 3 : A.t
3480 :     (* on 1.02 *)
3481 :     - 3:A.t;;
3482 :     std_in:8.1-8.5 Error: expression and constraint don't agree (tycon mismatch)
3483 :     expression: int
3484 :     constraint: A.t
3485 :     in expression:
3486 :     3
3487 :     Fix:
3488 :     Yesterday I show you the problem with origin. In fact I found it while
3489 :     thinking at my own implementation where I would like to have no origin too.
3490 :    
3491 :     I think I have a solution, you will be pleased because it is just an adaptation
3492 :     from the formal semantics and it is easy (just a guess !) to implement.
3493 :    
3494 :     While you build the body as a regular structure, store all the application in
3495 :     a list that you will be able to retrieve when you will do the abstraction.
3496 :     First abstract those applications:
3497 :     - stamps from the arg => operation to get the component from the arg
3498 :     - external stamp => just a constant component
3499 :     - stamp from the body =>
3500 :     - already seen in a previous application => refer to this item
3501 :     - not seen => just a regular generative stamp: recreate the component
3502 :     As the functor applications are all stored and in the right order you don't
3503 :     have to worry in the last case, naturally you have to rewalk the result of
3504 :     functor applications to record all the new stamps they have created, in fact
3505 :     at that point you need a way to know that a stamp has been done by the appli
3506 :     cation and not before, this is easy: store the stamp level just before the
3507 :     application is performed with the application.
3508 :    
3509 :     Other gain: you can get rid of the APPLY constructor in structures, well
3510 :     almost because you will probably still use it in recipes. But the point is
3511 :     that you don't have to worry about it any more in regular representations.
3512 :     Owner: dbm
3513 :     Status: fixed in 109.21
3514 :     ----------------------------------------------------------------------
3515 :     Number: 882
3516 :     Title: "`" and "^" can not appear inside a quotation
3517 :     Keywords:
3518 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
3519 :     Date: 6/6/94
3520 :     System(s) and Version: Compiler
3521 :     SML/NJ Version: 0.93
3522 :     Machine: SparcStation, SunOS 4.1.3
3523 :     Severity: minor
3524 :     Problem: "`" and "^" can not appear inside a quotation.
3525 :     Transcript:
3526 :    
3527 :     - `There should be a backquote here: \` in this quotation.`;
3528 :     std_in:100.39 Error: syntax error found at IN
3529 :     -
3530 :    
3531 :     Comments:
3532 :     There is no character escape mechanism in ml.lex for quotations.
3533 :     It is trivial to add one.
3534 :    
3535 :     Fix: Here is the corrected code for state <Q> in ml.lex.
3536 :    
3537 :     <Q>"\\\\" => (addString(charlist, "\\"); continue());
3538 :     <Q>"\\`" => (addString(charlist, "`"); continue());
3539 :     <Q>"\\^" => (addString(charlist, "^"); continue());
3540 :     <Q>"^" => (YYBEGIN AQ;
3541 :     let val x = makeString charlist
3542 :     in
3543 :     Tokens.OBJL(x,yypos,yypos+(size x))
3544 :     end);
3545 :     <Q>"`" => ((* a closing quote *)
3546 :     YYBEGIN INITIAL;
3547 :     let val x = makeString charlist
3548 :     in
3549 :     Tokens.ENDQ(x,yypos,yypos+(size x))
3550 :     end);
3551 :     <Q>\n => (inc lineNum; addString(charlist,"\n"); continue());
3552 :     <Q>. => (addString(charlist,yytext); continue());
3553 :    
3554 :     Conclusion [Appel]:
3555 :     The character escape should not be backslash because HOL and other
3556 :     users of quotation use backslash as an important syntax character.
3557 :     However, using ^^ to mean a literal ^ , and ^` to mean a literal `
3558 :     seems reasonable.
3559 :    
3560 :     History: 107.8 through 108 have Yarroll's version, 108.1 has ^^ meaning
3561 :     ^ and ^` meaning `.
3562 :    
3563 :     Status: fixed in 108.1
3564 :     ----------------------------------------------------------------------
3565 :     Number: 883
3566 :     Title: ML-Yacc can lose on multiline comments
3567 :     Keywords:
3568 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
3569 :     Date: 3/15/93
3570 :     System(s) and Version: ML-Yacc Version 2.1
3571 :     SML/NJ Version: 0.93
3572 :     Machine: SparcStation, SunOS 4.1.3
3573 :     Severity: minor
3574 :     Problem: ML-Yacc can lose on multiline comments
3575 :     Code:
3576 :     bug.grm:
3577 :     ---cut------cut------cut---
3578 :     (*
3579 :     Multi-line comments break ml-yacc!
3580 :     See?
3581 :     *)
3582 :     %%
3583 :     %name comment_bug
3584 :     %term FULL_STOP
3585 :     %pos int
3586 :     %nonterm anfang
3587 :     %%
3588 :     anfang: FULL_STOP ()
3589 :     ---cut------cut------cut---
3590 :     nobug.grm:
3591 :     ---cut------cut------cut---
3592 :     (* Multi-line comments break ml-yacc! *)
3593 :     %%
3594 :     %name comment_bug
3595 :     %term FULL_STOP
3596 :     %pos int
3597 :     %nonterm anfang
3598 :     %%
3599 :     anfang: FULL_STOP ()
3600 :     ---cut------cut------cut---
3601 :     Transcript:
3602 :    
3603 :     Script started on Mon Mar 15 16:30:57 1993
3604 :     $ sml-yacc nobug.grm
3605 :     1 rule not reduced
3606 :     $ sml-yacc bug.grm
3607 :     bug.grm, line 4: Error: syntax error: deleting BOGUS_VALUE
3608 :     ? smlyacc: uncaught exception Semantic
3609 :     $ exit
3610 :    
3611 :     script done on Mon Mar 15 16:32:12 1993
3612 :    
3613 :     Comments:
3614 :     There are several points besides the first section in an ML-Yacc
3615 :     specification where multi-line comments produce this form of error.
3616 :    
3617 :     Fix:
3618 :     Current workaround is:
3619 :     (* Make all comments *)
3620 :     (* single lines. blech! :-( *)
3621 :    
3622 :     Owner: Andrew ?
3623 :     Status: open
3624 :     ----------------------------------------------------------------------
3625 :     Number: 884
3626 :     Title: (LIB) HashTable.filter does not update the table.
3627 :     Keywords:
3628 :     Submitter: La Monte H. Yarroll <piggy@baqaqi.chi.il.us>
3629 :     Date: 5/18/93
3630 :     System(s) and Version: Library (0.1)
3631 :     SML/NJ Version: 0.93
3632 :     Machine: SparcStation, SunOS 4.1.3
3633 :     Severity: major
3634 :     Problem: HashTable.filter does not update the table.
3635 :     Transcript:
3636 :    
3637 :     (* filter_bug.sml *)
3638 :     (* Demonstrate that filter does not work as advertised. *)
3639 :     val Tbl : int Name.name_tbl = Name.mkNameTbl (10, myexn);
3640 :     Name.insert Tbl (Name.mkName "foo", 1);
3641 :     Name.insert Tbl (Name.mkName "bar", 2);
3642 :     (print "originial table: "; map #2 (Name.listItems Tbl));
3643 :     (print "filtering through false...\n"; Name.filter (fn _ => false) Tbl);
3644 :     (print "final table: "; map #2 (Name.listItems Tbl));
3645 :    
3646 :     - use "filter_bug.sml";
3647 :     [opening filter_bug.sml]
3648 :     val Tbl =
3649 :     HT
3650 :     {n_items=ref 0,not_found=myexn(-),
3651 :     table=ref [|NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL,...|]}
3652 :     : int Name.name_tbl
3653 :     val it = () : unit
3654 :     val it = () : unit
3655 :     originial table: val it = [2,1] : int list
3656 :     filtering through false...
3657 :     val it = () : unit
3658 :     final table: val it = [2,1] : int list
3659 :     val it = () : unit
3660 :    
3661 :     Comments:
3662 :     Notice that the elements of Table are completely unaltered even for the
3663 :     false filter.
3664 :    
3665 :     Fix: The fix is very simple; I just added the update. Note that I
3666 :     tightened the handle statement too. The original form could have
3667 :     masked bugs elsewhere in the system, e.g. in the predicate.
3668 :    
3669 :     (* remove any hash table items that do not satisfy the given
3670 :     * predicate.
3671 :     *)
3672 :     fun filter pred (HT{table, n_items, not_found}) = let
3673 :     fun filterP NIL = NIL
3674 :     | filterP (B(hash, key, item, rest)) = if (pred(key, item))
3675 :     then B(hash, key, item, filterP rest)
3676 :     else filterP rest
3677 :     val arr = !table
3678 :     fun filterTbl i =
3679 :     (Array.update (arr, i,
3680 :     filterP (Array.sub (arr, i)));
3681 :     filterTbl(i+1))
3682 :     in
3683 :     (filterTbl 0) handle Array.Subscript => ()
3684 :     end (* filter *)
3685 :    
3686 :     Status: not a bug --- fixed in smlnj-lib-0.2
3687 :     ----------------------------------------------------------------------
3688 :     Number: 885
3689 :     Title: exportML problem
3690 :     Keywords: exportML
3691 :     Submitter: Satish R. Thatte, satish@sun.mcs.clarkson.edu
3692 :     Date: 6/12/94
3693 :     System(s) and Version: NJ/SML library 0.2, CML 0.9.8, eXene 0.4 loaded
3694 :     SML/NJ Version: 0.93
3695 :     Machine: RS/6000 AIX
3696 :     Severity: minor (?)
3697 :     Problem: cannot use exportML to save executable after
3698 :     loading the full Edinburgh ML library that came with
3699 :     the distribution.
3700 :     Transcript:
3701 :     - exportML "sml";
3702 :    
3703 :     [Major collection... 99% used (4514924/4544644), 760 msec]
3704 :    
3705 :     [Major collection... 99% used (4531684/4531684), 770 msec]
3706 :     ./sml: Invalid argument
3707 :     export: Unexec failed
3708 :    
3709 :     uncaught exception Io "exportML "sml": Invalid argument"
3710 :    
3711 :     Comment: [dbm]
3712 :     Probably caused by trying to overwrite the currently executing image?
3713 :    
3714 :     Owner: John
3715 :     Status: obsolete
3716 :     ----------------------------------------------------------------------
3717 :     Number: 886
3718 :     Title: unclear error msg regarding flex records
3719 :     Keywords: type error message
3720 :     Submitter: Lorenz Huelsbergen (lorenz@research.att.com)
3721 :     Date: 6/15/94
3722 :     Version: 1.04f
3723 :     System: all
3724 :     Severity: very minor
3725 :     Problem: unclear error msg regarding flex records
3726 :     Code:
3727 :     fun f x = #1 x;
3728 :    
3729 :     Transcript:
3730 :     - fun f x = #1 x;
3731 :     std_in:0.0-0.0 Error: unresolved flex record
3732 :     (can't tell what fields there are besides #1)
3733 :     -
3734 :    
3735 :     Comments:
3736 :     Error msg states there's an error but implies that it has enough
3737 :     information for there not to be an error.
3738 :    
3739 :     Comment: [dbm] Seems clear enough to me.
3740 :     Owner: dbm
3741 :     Status: not a bug [dbm]
3742 :     ----------------------------------------------------------------------
3743 :     Number: 887
3744 :     Title: System.Directory.cd malfunctions; hands non-C string to runtime
3745 :     Keywords:
3746 :     Submitter: Lorenz Huelsbergen (lorenz@research.att.com)
3747 :     Date: 6/15/94
3748 :     Version: >= 1.00
3749 :     System: all
3750 :     Severity: major
3751 :     Problem: System.Directory.cd malfunctions; hands non-C string to runtime
3752 :     Code: System.Directory.cd "."; (* or, in general *)
3753 :     System.Directory.cd s; (* where (|s|=1) or (|s| mod 4 = 0) *)
3754 :    
3755 :     Transcript:
3756 :     : radish 121; /usr/local/sml/103/bin/sml
3757 :     loading /usr/local/sml/103/bin/.heap/sml.mipseb ......................... done
3758 :     Standard ML of New Jersey, Version 1.03, February 14, 1994 [new runtime]
3759 :     - System.Directory.cd ".";
3760 :    
3761 :     uncaught exception NotDirectory
3762 :     -
3763 :    
3764 :     Comments:
3765 :     'cd' does not wrap 'c_string' around its arg. Strings of length
3766 :     one fault as do strings with multiple-of-four lengths.
3767 :    
3768 :     Fix:
3769 :     In boot/directory.sml, change
3770 :    
3771 :     fun cd s = (chdir s) handle (SysError _) => raise NotDirectory
3772 :    
3773 :     to:
3774 :    
3775 :     fun cd s = (chdir (c_string s)) handle (SysError _) => raise NotDirectory
3776 :    
3777 :     Status: fixed in 1.04g
3778 :     ----------------------------------------------------------------------
3779 :     Number: 888
3780 :     Title: unix command line arguments
3781 :     Keywords:
3782 :     Submitter: Elsa Gunter, Dave MacQueen
3783 :     Date: 6/17/94
3784 :     Version: 1.04f, lexgen
3785 :     System: SGI Challenge, IRIX 5.2
3786 :     Severity: major
3787 :     Problem:
3788 :     The sml-lex executable does not work because the Unix command
3789 :     line arguments are shifted, i.e. the heap image becomes the second
3790 :     argument and the lex file name becomes the third argument.
3791 :     Fix:
3792 :     The function ExportLexGen.lexGen does the command-line argument
3793 :     analysis. It expects argv to have length two. Either this has
3794 :     to be changed to account for the heap image argument, or, preferably,
3795 :     we should make it possible to make simple stand-alone executables
3796 :     again.
3797 :     Comment: [jhr]
3798 :     This has already been taken care of. When I start hacking the pervasives,
3799 :     there will be two ways to get command line arguments: the standard way will
3800 :     not include any runtime args (those beginning with @SML), but there will
3801 :     also be a way to get the "raw" arguments. The 1.04g version of the runtime
3802 :     already supports both argument lists, but only the stripped version is available.
3803 :    
3804 :     As far as applications go, we plan to provide support for command-line argument
3805 :     processing in the SML/NJ Library. Even "simple" applications should use that.
3806 :    
3807 :     Owner: John
3808 :     Status: fixed in 109.21
3809 :     ----------------------------------------------------------------------
3810 :     Number: 889
3811 :     Title: very slow elaboration and translation of functor applications
3812 :     Keywords: performance, elaboration, modules, instantiation
3813 :     Submitter: Tim Griffin
3814 :     Date: 7/8/94
3815 :     Version: 1.04f, May 1, 1994 [new runtime]
3816 :     System: /usr/local/sml/104f/bin/.heap/sml.mipseb
3817 :     Severity:
3818 :     Problem: Functor application, which used to be almost
3819 :     intantaneous, is now very slow. Here is a typical example:
3820 :    
3821 :     - structure Tools = Prl5ToolsFUN(structure PrlSys = PrlSys);
3822 :     End Compiler 010 Parse 0.0 sec
3823 :     GC #13.249.340.504.2475.129019: (180 ms.)
3824 :     GC #13.250.341.505.2476.129026: (147 ms.)
3825 :     GC #13.250.341.505.2477.129038: (39 ms.)
3826 :     GC #13.251.342.506.2478.129061: (163 ms.)
3827 :     GC #13.251.342.506.2479.129087: (102 ms.)
3828 :     GC #13.252.343.507.2480.129110: (207 ms.)
3829 :     GC #13.252.343.507.2481.129116: (61 ms.)
3830 :     GC #13.253.344.508.2482.129138: (243 ms.)
3831 :     GC #13.253.344.508.2483.129159: (87 ms.)
3832 :     End Compiler 030 Elaborate 0.0 sec
3833 :     GC #13.253.344.508.2484.129161: (47 ms.)
3834 :     GC #13.254.345.509.2485.129325: (341 ms.)
3835 :     GC #13.254.345.509.2486.129330: (31 ms.)
3836 :     GC #13.254.345.509.2487.129353: (59 ms.)
3837 :     GC #13.254.345.509.2488.129376: (95 ms.)
3838 :     GC #13.254.345.509.2489.129403: (103 ms.)
3839 :     GC #13.254.345.509.2490.129426: (102 ms.)
3840 :     GC #13.254.345.509.2491.129453: (103 ms.)
3841 :     End Compiler 040 Translate 0.0 sec
3842 :     End Compiler 050 CodeOpt 0.0 sec
3843 :     GC #13.255.346.510.2492.129458: (554 ms.)
3844 :     End Compiler 060 Convert 0.0 sec
3845 :     End Compiler 065 CPStrans 0.0 sec
3846 :     End Compiler 070 cpsopt 0.0 sec
3847 :     End Compiler 079 freemapClose 0.0 sec
3848 :     End Compiler 080 closure 0.0 sec
3849 :     End Compiler 090 globalfix 0.0 sec
3850 :     End Compiler 100 spill 0.0 sec
3851 :     End Compiler 110 limit 0.0 sec
3852 :     End Compiler 120 cpsgen 0.0 sec
3853 :     End Compiler 130 Schedule 0.0 sec
3854 :     End Compiler 140 CodeGen 0.0 sec
3855 :     End Execute 0.0 sec
3856 :     structure Tools : PRL5TOOLS
3857 :     -
3858 :     Comment: [dbm]
3859 :     As you can see from the stats printout, almost all the time was
3860 :     spent in the elaborate and translate phases.
3861 :    
3862 :     Owner: Zhong, Dave
3863 :     Status: fixed in 109.26 (actually 109.25.?)
3864 :     ----------------------------------------------------------------------
3865 :     Number: 890
3866 :     Title: Erroneous answer for function involving logical operations.
3867 :     Keywords:
3868 :     Submitter: Lal George
3869 :     Date: 7/10/94
3870 :     Version: 0.93 and onwards.
3871 :     System: MIPS
3872 :     Severity: major/critical
3873 :     Problem: Erroneous answer for function involving logical operations.
3874 :     Code:
3875 :    
3876 :     fun f n = Bits.andb(n+7,Bits.notb 7)
3877 :    
3878 :     Transcript:
3879 :    
3880 :     - f 32761;
3881 :     val it = 0 : int
3882 :    
3883 :     Comments:
3884 :    
3885 :     The function yields correct answers for 0 <= n < 32760
3886 :    
3887 :     Fix:
3888 :    
3889 :     In 1.05.
3890 :    
3891 :     Status: fixed in 1.05
3892 :     ----------------------------------------------------------------------
3893 :     Number: 891
3894 :     Title: mllex state names not as general as advertized
3895 :     Keywords:
3896 :     Submitter: Richard.Boulton@cl.cam.ac.uk
3897 :     Date: 7/20/94
3898 :     Version: 0.93
3899 :     Severity: minor
3900 :     Problem:
3901 :     In the version of ML-Lex distributed with SML/NJ 0.93, state names have to be
3902 :     made up of letters only, whereas the documentation indicates that they may
3903 :     also contain digits, underscores, or primes (except that the first character
3904 :     must be a letter).
3905 :     Fix:
3906 :     Here is the output from diff for a corrected version of lexgen.sml:
3907 :    
3908 :     501c501,503
3909 :     < | x => if isletter(x) then get_state(prev,matched^x)
3910 :     ---
3911 :     > | x => if isletter(x) orelse
3912 :     > (isidentchr(x) andalso matched <> "")
3913 :     > then get_state(prev,matched^x)
3914 :    
3915 :     Owner: Andrew
3916 :     Status: fixed in 110 (probably in 109.2x)
3917 :     ----------------------------------------------------------------------
3918 :     Number: 892
3919 :     Title: RealArrays not garbage collected
3920 :     Keywords:
3921 :     Submitter: Lorenz Huelsbergen (lorenz@research.att.com)
3922 :     Date: 7/24/94
3923 :     Version: new-runtime versions (>= 1.03)
3924 :     System: all
3925 :     Severity: major
3926 :     Problem:
3927 :     RealArrays are allocated in the gen-1 (alloc. arena),
3928 :     but not collected from there.
3929 :    
3930 :     Code:
3931 :     val a = RealArray.array(1,3.14);
3932 :     System.Runtime.gc 1;
3933 :    
3934 :     Transcript:
3935 :    
3936 :     : radish 295; /usr/local/sml/104f/bin/sml
3937 :     started .kshrc
3938 :     finished .kshrc
3939 :     loading /usr/local/sml/104f/bin/.heap/sml.mipseb ......................... done
3940 :     Standard ML of New Jersey, Version 1.04f, May 1, 1994 [new runtime]
3941 :     - val a = RealArray.array(1,3.14);
3942 :     val a = - : Assembly.A.realarray
3943 :     - System.Runtime.gc 1;
3944 :     /usr/local/sml/104f/bin/.run/run.mipseb-irix5: Fatal error -- bad object tag 13, obj_start = 0x4dd804, obj = 0x4dd804, desc = 0x76
3945 :    
3946 :     Fix:
3947 :     minor-gc.c: In 'MinorGC_ForwardObj', replace
3948 :    
3949 :     case DTAG_realdarray: /* only allocated in gen-1 */
3950 :     default:
3951 :    
3952 :     with:
3953 :    
3954 :     case DTAG_realdarray:
3955 :     len = GET_REALDARR_LEN(desc);
3956 :     arena = gen1->arena[STRING_INDX];
3957 :     #ifdef ALIGN_REALDS
3958 :     arena->nextw = (ml_val_t *)(((Addr_t)arena->nextw) | WORD_SZB);
3959 :     #endif
3960 :     break;
3961 :     default:
3962 :    
3963 :     Status: fixed in 106
3964 :     ----------------------------------------------------------------------
3965 :     Number: 893
3966 :     Title: Bind exception while recompiling compiler with representation off
3967 :     Keywords:
3968 :     Submitter: Lal George
3969 :     Date: 7/27/94
3970 :     Version: 1.04m, and 1.05a
3971 :     System: all
3972 :     Severity: major/critical
3973 :     Problem: Turning representation off causes a Bind exception to be raised
3974 :     when recompiling the compiler.
3975 :     Transcript:
3976 :     - lutece:$ ../bin/sml-scb
3977 :     loading /usr/local/sml/104m/bin/.heap/sml-scb.sparc ......................... done
3978 :     Standard ML of New Jersey, Version 1.04m, June 21, 1994 [Batch SC 69a3]
3979 :     val it = () : unit
3980 :     - Compiler.Control.CG.representations:=false;
3981 :     val it = () : unit
3982 :     - Batch.make();
3983 :     Making directory bin.sparc
3984 :     Recompiling boot directory.
3985 :     assembly.sig: WARNING: no Core access
3986 :     WARNING: no Core access
3987 :     GC #0.0.0.0.1.5: (30 ms.)
3988 :     Repairing blast GC (maxGen = 5 of 5)
3989 :     dummy.sml: WARNING: no Core access
3990 :     WARNING: no Core access
3991 :     Repairing blast GC (maxGen = 5 of 5)
3992 :     core.sml: WARNING: no Core access
3993 :     WARNING: no Core access
3994 :     Repairing blast GC (maxGen = 5 of 5)
3995 :     perv.sig: GC #0.0.0.1.2.28: (50 ms.)
3996 :     Repairing blast GC (maxGen = 5 of 5)
3997 :     perv.sml:
3998 :     uncaught Bind exception translate/translate.sml:362.12-362.36
3999 :     -
4000 :    
4001 :     Comments:
4002 :     This flags needs to be turned off when creating bin files for the x86.
4003 :    
4004 :     Fix: [Lorenz]
4005 :     Here's an inefficient fix for bug #893 (can't compile compiler
4006 :     with Compiler.Control.CG.representations = false in 104m, 105a).
4007 :    
4008 :     In translate/transtypes.sml, change the line
4009 :    
4010 :     val transTyLty = fn x => if (!rep_flag) then transTyLty x else BOGUSty
4011 :    
4012 :     to:
4013 :    
4014 :     (* val transTyLty = fn x => if (!rep_flag) then transTyLty x else BOGUSty *)
4015 :     val transTyLty = fn x => (if (!rep_flag) then
4016 :     fn x => x
4017 :     else
4018 :     fn (ARROWty _) => ARROWty(BOGUSty,BOGUSty)
4019 :     | _ => BOGUSty)
4020 :     (transTyLty x)
4021 :     [Zhong, do you have a more efficient way to do this?]
4022 :     Comment: [dbm,Lal, 3/23/97] representation analysis code has changed and
4023 :     representation analysis is permanently on.
4024 :     Owner: Zhong
4025 :     Status: obsolete
4026 :     ----------------------------------------------------------------------
4027 :     Number: 894
4028 :     Title: obscure error message using infix symbol as variable
4029 :     Keywords:
4030 :     Submitter: Simon Hooker, S.Hooker@teesside.ac.uk
4031 :     Date: 8/1/94
4032 :     Version: 0.93
4033 :     Severity: minor
4034 :     Problem:
4035 :     Inadvertent use of an infix identifier like "o" from the Basis in a pattern
4036 :     give rise to the error message "nonfix identifier required". The message
4037 :     should at least name the offending identifier.
4038 :     Transcript:
4039 :     - fun f(o::l) = 3;
4040 :     std_in:5.7 Error: nonfix identifier required
4041 :     -
4042 :    
4043 :     Status: fixed in 107.4 (plus)
4044 :     ----------------------------------------------------------------------
4045 :     Number: 895
4046 :     Title: printing type unit when hidden
4047 :     Keywords: printing, types
4048 :     Submitter: Tomasz Wierzbicki <twx@dcs.ed.ac.uk>
4049 :     Date: 8/1/94
4050 :     System(s) and Version: any
4051 :     SML/NJ Version: 0.93, 1.03f, etc.
4052 :     Machine: any
4053 :     Severity: minor
4054 :     Problem: Unit type never displayed as hidden.
4055 :     Code: datatype unit = C
4056 :     Transcript:
4057 :     - datatype unit = C;
4058 :     datatype unit
4059 :     con C : unit
4060 :     - ();
4061 :     val it = () : unit
4062 :     - C=();
4063 :     std_in:4.1-4.4 Error: operator and operand don't agree (tycon mismatch)
4064 :     operator domain: unit * unit
4065 :     operand: unit * unit
4066 :     in expression:
4067 :     = (C,())
4068 :     -
4069 :     Comments:
4070 :     The response to the second line of input should be
4071 :    
4072 :     val it = () : ?.unit
4073 :     Owner: Dave
4074 :     Test: bug895.sml
4075 : macqueen 1338 Status: fixed in 110.43 (6/17/03)
4076 : macqueen 944 ----------------------------------------------------------------------
4077 :     Number: 896
4078 :     Title: Compiler bug: Unexpected RELtyc in transtypes
4079 :     Keywords:
4080 :     Submitter: Andrew Appel
4081 :     Date: 6/3/94
4082 :     Version: 1.05a
4083 :     Severity: major
4084 :     Problem:
4085 :     Elaborating an equality expression using datacons from a functor
4086 :     parameter whose signature was pickled fails with
4087 :     "Compiler bug: Unexpected RELtyc in transtypes".
4088 :     Code:
4089 :     **** a.sig ****
4090 :     signature S =
4091 :     sig
4092 :     datatype d = A | B (* have to have two constructors *)
4093 :     end
4094 :     **** a.sml ****
4095 :     functor F (X : S) : sig end =
4096 :     struct
4097 :     val _ = (X.A = X.B) (* can't simplify - need equality fn *)
4098 :     end
4099 :    
4100 :     Transcript:
4101 :     glove$ ./sml-sc
4102 :     Standard ML of New Jersey, Version 1.03f, April 11, 1994 [SC 69a2]
4103 :     val it = () : unit
4104 :     - sc.make();
4105 :    
4106 :     Defining the group...
4107 :     [scanning sources.sc]
4108 :     Compiling...
4109 :     [Parsing a.sig]
4110 :     [compiling a.sig]
4111 :     [writing .mipseb/a.sig.bin]
4112 :     [compiling a.sml]
4113 :     [writing .mipseb/a.sml.bin]
4114 :     Introducing the new bindings...
4115 :     val it = () : unit
4116 :     - ^D
4117 :     glove$ rm .mipseb/a.sml.bin
4118 :     glove$ ./sml-sc
4119 :     Standard ML of New Jersey, Version 1.03f, April 11, 1994 [SC 69a2]
4120 :     val it = () : unit
4121 :     - sc.make();
4122 :     Defining the group...
4123 :     [scanning sources.sc]
4124 :     Compiling...
4125 :     [reading .mipseb/a.sig.bin]
4126 :     [compiling a.sml]
4127 :     Error: Compiler bug: Unexpected RELtyc in transtypes
4128 :     Fix: After instantiating the functor parameter, we apply a fixup
4129 :     function that goes through it and replaces the datacons in the
4130 :     kind field of datatypes with their "instantiated" versions.
4131 :     Status: fixed in dbm-1.05b
4132 :     ----------------------------------------------------------------------
4133 :     Number: 897
4134 :     Title: core dump caused by representation optimization
4135 :     Keywords:
4136 :     Submitter: Elsa L. Gunter
4137 :     Date: 9/26/94
4138 :     Version: 1.01 - 1.05
4139 :     System: SGI / Irix5.2, Sparc / SunOS 4.1.1
4140 :     Severity: critical
4141 :     Problem: Dumps core and gives wrong answers
4142 :     Code:
4143 :     signature P_sig = sig type env end;
4144 :    
4145 :     structure P =
4146 :     struct
4147 :     type env = {free : int list} -> int (* * {free : int list} *)
4148 :     (* The free is necessary, and the record can have additional fields. *)
4149 :     (* If the range is made a pair by adding the record type in comments,
4150 :     it dumps core. If not it gives the wrong answer, printing "AAAA" and
4151 :     returning 10. *)
4152 :     end;
4153 :    
4154 :     functor Fun (structure P : P_sig) = (* The functor is necessary *)
4155 :     struct
4156 :     datatype svalue = A of (P.env) | B of (P.env list)
4157 :     (* The list as the argument of B is necessary *)
4158 :     val actions = fn (A aexp) => B([aexp])
4159 :     end
4160 :    
4161 :     structure Table = Fun(structure P = P);
4162 :    
4163 :     val Table.B [aexp] =
4164 :     Table.actions
4165 :     (Table.A
4166 :     (fn E:{free: int list} =>
4167 :     ((fn (_::_) => (print "AAAA\n";10) (* The pattern for cons is necessary *)
4168 :     | [] => (print "BBB\n";0))
4169 :     (#free E)(*, E*)))); (* uncomment if env changed to return pair
4170 :     and core dump will happen *)
4171 :    
4172 :     val x = aexp {free = []};
4173 :    
4174 :    
4175 :     Transcript:
4176 :    
4177 :     use "bad1.sml";
4178 :     [opening bad1.sml]
4179 :     signature P_sig = sig type env end
4180 :     structure P : sig type env end
4181 :     bad1.sml:13.19-13.42 Warning: match nonexhaustive
4182 :     A aexp => ...
4183 :    
4184 :     functor Fun : <sig>
4185 :     structure Table :
4186 :     sig
4187 :     datatype svalue
4188 :     con A : P.env -> svalue
4189 :     con B : P.env list -> svalue
4190 :     val actions : svalue -> svalue
4191 :     end
4192 :     bad1.sml:18.1-24.22 Warning: binding not exhaustive
4193 :     B (aexp :: nil) = ...
4194 :     val aexp = fn : P.env
4195 :     AAAA
4196 :     val x = 10 : int
4197 :     val it = () : unit
4198 :    
4199 :     Comments: This breaks HOL90 and was a real bear to isolate.
4200 :     [dbm] The incorrect behavior disappears when Compiler.Control.CG.representations
4201 :     is set to false, indicating that is has to do with representation
4202 :     optimization.
4203 :    
4204 :     Status: fixed in 107.3 [Appel]
4205 :     ----------------------------------------------------------------------
4206 :     Number: 898
4207 :     Title: mllex - start state identifiers containing underscores
4208 :     Keywords:
4209 :     Submitter: Raoul Bhoedjang, raoul@cs.vu.nl
4210 :     Date: 7/15/94
4211 :     System(s) and Version: Tools, lexgen, 0.93 distribution
4212 :     SML/NJ Version: 0.93
4213 :     Machine: sun4, sunos
4214 :     Severity: minor
4215 :     Problem: ml-lex complains about start state identifiers
4216 :     that contain underscores; the documentation
4217 :     allows such identifiers.
4218 :    
4219 :     Code: Put this in a file and feed the file name to lexGen:
4220 :    
4221 :     datatype lexresult = int
4222 :     val eof = fn() => EOF
4223 :     %%
4224 :    
4225 :     %S IN_COMMENT;
4226 :     %%
4227 :    
4228 :     "(*" => (YYBEGIN IN_COMMENT; lex());
4229 :     <IN_COMMENT>"*)" => (YYBEGIN INITIAL; lex());
4230 :     <IN_COMMENT>[\n] => (inc lineno; lex());
4231 :     <IN_COMMENT>. => (lex());
4232 :    
4233 :    
4234 :     Transcript:
4235 :    
4236 :     - val _ = lexGen "/home/raoul/proj/avc/tst.lex";
4237 :     sml-lex: syntax error, line 8: bad start state list
4238 :    
4239 :     Comments: Error msg. disappears when the underscores are removed.
4240 :     Fix: disallow underscores or modify the bit in
4241 :     lexgen.sml that recognises start states.
4242 :     Status: fixed in lexgen 1.6.0
4243 :     ----------------------------------------------------------------------
4244 :     Number: 899
4245 :     Title: makeml isn't up to date for Solaris
4246 :     Keywords:
4247 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
4248 :     Date: 8/8/94
4249 :     System(s) and Version:
4250 :     SML/NJ Version: 1.03f
4251 :     Machine: SPARC, Solaris 2.3
4252 :     Severity: major
4253 :     Problem: makeml isn't up to date for Solaris
4254 :     Comments:
4255 :     src/makeml doesn't have an entry for "-sun4 solaris"
4256 :     src/runtime/Makefile needs to #define _ASM when assembling SPARC.prim.s
4257 :     Status: fixed in 106 (makeml has gone away)
4258 :     ----------------------------------------------------------------------
4259 :     Number: 900
4260 :     Title: sml-noshare won't build on Solaris (and maybe other OS)
4261 :     Keywords:
4262 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
4263 :     Date: 8/8/94
4264 :     System(s) and Version:
4265 :     SML/NJ Version: 1.03f
4266 :     Machine: SPARC, Solaris 2.3
4267 :     Severity: major
4268 :     Problem: sml-noshare won't build on Solaris (and maybe other OSs)
4269 :     Comments:
4270 :    
4271 :     The way the noshare runtime/allmo.o is built is inherently wrong.
4272 :     run.c wants "binend" to be a global symbol located just after the
4273 :     end of the "binst" array, as is the case when linkbin has built an
4274 :     allmo.s for a shared runtime. But when a noshared runtime is built,
4275 :     the dummy allmo.c (containing: char binst[1]; char binend[1]) is
4276 :     compiled using the C compiler, in the hope that binend will be located
4277 :     just after binst. Guess what? This is not true for Solaris 2.3.
4278 :     This results in loadBinFile() (in run.c) happily using addresses in
4279 :     nowhere-land as code pointers (the test "if (internal_bin + 8 < binend)"
4280 :     is true!) with disastrous results.
4281 :    
4282 :     One fix might be to let binend be a "char*" pointing just after binst[],
4283 :     but this would require changes to all of linkbin.c, allmo.c, and run.c .
4284 :     Since linkbin.c already knows the format of allmo.s, I decided instead
4285 :     to generalize linkbin.c and let it build an appropriate allmo.s for
4286 :     the noshare runtime. This required minor changes to makeml, runtime/Makefile,
4287 :     and runtime/linkbin.c . runtime/allmo.c is no longer used.
4288 :    
4289 :     Status: fixed in 106 (noshare has gone away)
4290 :     ----------------------------------------------------------------------
4291 :     Number: 901
4292 :     Title: runtime/cfuns.c in 103f
4293 :     Keywords:
4294 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
4295 :     Date: 8/8/94
4296 :     System(s) and Version:
4297 :     SML/NJ Version: 1.03f
4298 :     Machine: SPARC, Solaris 2.3
4299 :     Severity: major
4300 :     runtime/cfuns.c (function raise_syserror()) uses sprintf() without
4301 :     having #included <stdio.h>
4302 :     getdev() (for SOLARIS) has a typo: (c == "\n") should be: (c == '\n')
4303 :    
4304 :     Fix:
4305 :    
4306 :     *** makeml.~1~ Sun Dec 19 20:56:18 1993
4307 :     --- makeml Mon Aug 8 17:00:15 1994
4308 :     ***************
4309 :     *** 103,108 ****
4310 :     --- 103,117 ----
4311 :     case $1 in
4312 :     mach) OPSYS=MACH; DEFS="$DEFS -DBSD" ;;
4313 :     sunos) OPSYS=SUNOS ;;
4314 :     + solaris|sunos5)
4315 :     + MAKE=/usr/ccs/bin/make
4316 :     + AS=/usr/ccs/bin/as
4317 :     + CPP=/usr/ccs/lib/cpp
4318 :     + CPPP="\"$CPP -P\""
4319 :     + DEFS="$DEFS -DSUNOS"
4320 :     + OPSYS=SOLARIS
4321 :     + CFL="$CFL -lsocket -lnsl"
4322 :     + ;;
4323 :     *)
4324 :     echo "$CMD must specify opsys arg for SUN (sunos or mach)"
4325 :     exit 1
4326 :     ***************
4327 :     *** 529,545 ****
4328 :     CCARG=""
4329 :     fi
4330 :    
4331 :     if test -n "$SHARE"
4332 :     then
4333 :     ! ARG="MACHINE=$MACHINE $CCARG 'CFL=$CFL' 'LDFLAGS=$LDFLAGS' 'LIBS=$LIBS' 'DEFS=$DEFS -DAS=\\\"$AS\\\"' linkbin"
4334 :     ! echo "$CMD (cd $RUNTIME; $MAKE $ARG)"
4335 :     ! (cd $RUNTIME; eval $MAKE $ARG)
4336 :     if test "$?" -ne "0"; then
4337 :     exit 1
4338 :     fi
4339 :     !
4340 :     ! echo "$CMD $RUNTIME/linkbin $BIN $RUNTIME"
4341 :     ! $RUNTIME/linkbin $BIN $RUNTIME
4342 :     if test "$?" -ne "0"; then
4343 :     exit 1
4344 :     fi
4345 :     --- 538,561 ----
4346 :     CCARG=""
4347 :     fi
4348 :    
4349 :     + ARG="MACHINE=$MACHINE $CCARG 'CFL=$CFL' 'LDFLAGS=$LDFLAGS' 'LIBS=$LIBS' 'DEFS=$DEFS -DAS=\\\"$AS\\\"' linkbin"
4350 :     + echo "$CMD (cd $RUNTIME; $MAKE $ARG)"
4351 :     + (cd $RUNTIME; eval $MAKE $ARG)
4352 :     + if test "$?" -ne "0"; then
4353 :     + exit 1
4354 :     + fi
4355 :     +
4356 :     if test -n "$SHARE"
4357 :     then
4358 :     ! echo "$CMD $RUNTIME/linkbin $BIN $RUNTIME"
4359 :     ! $RUNTIME/linkbin $BIN $RUNTIME
4360 :     if test "$?" -ne "0"; then
4361 :     exit 1
4362 :     fi
4363 :     ! else
4364 :     ! # create "noshare" allmo.o
4365 :     ! echo "$CMD $RUNTIME/linkbin $RUNTIME"
4366 :     ! $RUNTIME/linkbin $RUNTIME
4367 :     if test "$?" -ne "0"; then
4368 :     exit 1
4369 :     fi
4370 :     *** runtime/Makefile.~1~ Wed Aug 25 16:11:14 1993
4371 :     --- runtime/Makefile Mon Aug 8 16:54:25 1994
4372 :     ***************
4373 :     *** 56,65 ****
4374 :     export.o : tags.h
4375 :    
4376 :     prim.o : $(MACHINE).prim.s tags.h
4377 :     ! $(CPP) -DASM $(DEFINES) $(MACHINE).prim.s >prim.s
4378 :     $(AS) -o prim.o prim.s
4379 :     -
4380 :     - allmo.o : allmo.c tags.h ml_types.h ml_state.h mask.h
4381 :    
4382 :     linkbin: linkbin.c tags.h
4383 :     $(CC) $(CFLAGS) -o linkbin linkbin.c
4384 :     --- 56,63 ----
4385 :     export.o : tags.h
4386 :    
4387 :     prim.o : $(MACHINE).prim.s tags.h
4388 :     ! $(CPP) -DASM -D_ASM $(DEFINES) $(MACHINE).prim.s >prim.s
4389 :     $(AS) -o prim.o prim.s
4390 :    
4391 :     linkbin: linkbin.c tags.h
4392 :     $(CC) $(CFLAGS) -o linkbin linkbin.c
4393 :     *** runtime/cfuns.c.~1~ Wed Sep 1 19:47:43 1993
4394 :     --- runtime/cfuns.c Mon Aug 8 16:12:51 1994
4395 :     ***************
4396 :     *** 46,51 ****
4397 :     --- 46,52 ----
4398 :     #ifdef HPUX
4399 :     #include <sys/utsname.h>
4400 :     #endif
4401 :     + #include <stdio.h> /* declare sprintf() for raise_syserror() */
4402 :    
4403 :     #include "ml_state.h"
4404 :     #include "ml_types.h"
4405 :     ***************
4406 :     *** 2350,2356 ****
4407 :    
4408 :     #ifdef SOLARIS
4409 :     #include <limits.h>
4410 :     - #include <stdio.h>
4411 :     #include <fcntl.h>
4412 :     #include <signal.h>
4413 :     #include <errno.h>
4414 :     --- 2351,2356 ----
4415 :     ***************
4416 :     *** 2462,2468 ****
4417 :     fil.data = fbuf;
4418 :     fil.eptr = fil.ptr = 0;
4419 :     while((sts = getline(buf, &fil)) > 0) {
4420 :     ! if (((c = buf[0]) == '#') || (c == "\n") || (c == '\0')) continue;
4421 :     rest = buf;
4422 :     p = getfield(&rest); /* get and test netid */
4423 :     if (p == NULL) continue;
4424 :     --- 2462,2468 ----
4425 :     fil.data = fbuf;
4426 :     fil.eptr = fil.ptr = 0;
4427 :     while((sts = getline(buf, &fil)) > 0) {
4428 :     ! if (((c = buf[0]) == '#') || (c == '\n') || (c == '\0')) continue;
4429 :     rest = buf;
4430 :     p = getfield(&rest); /* get and test netid */
4431 :     if (p == NULL) continue;
4432 :     *** runtime/linkbin.c.~1~ Wed Sep 1 19:21:31 1993
4433 :     --- runtime/linkbin.c Mon Aug 8 17:07:41 1994
4434 :     ***************
4435 :     *** 17,22 ****
4436 :     --- 17,24 ----
4437 :     * into a "runtime"/allmo.o file that defines two symbols: "binst," which
4438 :     * occurs at the beginning, and "binend" at the end.
4439 :     *
4440 :     + * linkbin runtime
4441 :     + * creates a dummy allmo.o to be used when building the "noshare" runtime.
4442 :     */
4443 :    
4444 :     #include <stdio.h>
4445 :     ***************
4446 :     *** 121,134 ****
4447 :     TEXT(asfile);
4448 :     GLOBAL(asfile, "binst");
4449 :     LABEL(asfile, "binst");
4450 :     ! WORD(asfile, MAGICNUM);
4451 :     ! SPACE(asfile, size-4);
4452 :     GLOBAL(asfile, "binend");
4453 :     LABEL(asfile, "binend");
4454 :     -
4455 :     }
4456 :    
4457 :     -
4458 :     struct {char magic[16];
4459 :     int import_cnt;
4460 :     int export_cnt;
4461 :     --- 123,136 ----
4462 :     TEXT(asfile);
4463 :     GLOBAL(asfile, "binst");
4464 :     LABEL(asfile, "binst");
4465 :     ! if( size ) {
4466 :     ! WORD(asfile, MAGICNUM);
4467 :     ! SPACE(asfile, size-4);
4468 :     ! }
4469 :     GLOBAL(asfile, "binend");
4470 :     LABEL(asfile, "binend");
4471 :     }
4472 :    
4473 :     struct {char magic[16];
4474 :     int import_cnt;
4475 :     int export_cnt;
4476 :     ***************
4477 :     *** 185,194 ****
4478 :     char as_buf[200], o_buf[200], cmd_buf[200];
4479 :     FILE *asfile, *ofile; int ofd;
4480 :     int size, i, pos, sts;
4481 :     ! if (argc!=3)
4482 :     ! die("usage: linkbin bindir runtime");
4483 :     ! dir=argv[1]; runtime=argv[2];
4484 :     ! size=process_all("BOOTLIST",dir)+process_all("BINLIST",dir);
4485 :    
4486 :     sprintf(as_buf, "%s/allmo.s", runtime);
4487 :     sprintf(o_buf, "%s/allmo.o", runtime);
4488 :     --- 187,199 ----
4489 :     char as_buf[200], o_buf[200], cmd_buf[200];
4490 :     FILE *asfile, *ofile; int ofd;
4491 :     int size, i, pos, sts;
4492 :     ! if( argc == 2 ) {
4493 :     ! runtime = argv[1]; size = 0;
4494 :     ! } else if( argc == 3 ) {
4495 :     ! dir = argv[1]; runtime = argv[2];
4496 :     ! size = process_all("BOOTLIST",dir) + process_all("BINLIST",dir);
4497 :     ! } else
4498 :     ! die("usage:\tlinkbin bindir runtime\nor\tlinkbin runtime\n");
4499 :    
4500 :     sprintf(as_buf, "%s/allmo.s", runtime);
4501 :     sprintf(o_buf, "%s/allmo.o", runtime);
4502 :     ***************
4503 :     *** 205,210 ****
4504 :     --- 210,217 ----
4505 :     fprintf (stderr, "cannot assemble %s, status = %d\n", as_buf, sts);
4506 :     exit (1);
4507 :     }
4508 :     +
4509 :     + if( size == 0 ) exit(0);
4510 :    
4511 :     out = fopen(o_buf,"r+");
4512 :     if (!out)
4513 :    
4514 :     Status: fixed in 106 (cfuns.c has gone away)
4515 :     ----------------------------------------------------------------------
4516 :     Number: 902
4517 :     Title: tab character in string in lexgen/lexgen.sml
4518 :     Keywords:
4519 :     Submitter: Mikael Pettersson (mpe@ida.liu.se)
4520 :     Date: 8/8/94
4521 :     System(s) and Version: lexgen 1.5.0 (a.k.a. lexgen94)
4522 :     SML/NJ Version: 1.03f
4523 :     Machine: all
4524 :     Severity: minor
4525 :     Problem:
4526 :    
4527 :     There's a "tab" character in a string literal in lexgen/lexgen.sml .
4528 :     This provokes an error message from the sml/nj 1.03f lexer.
4529 :    
4530 :     Code:
4531 :     Transcript:
4532 :     Comments:
4533 :     Fix:
4534 :    
4535 :     Change the "tab" character to "\t".
4536 :    
4537 :     *** lexgen.sml.~1~ Thu Jun 2 21:22:15 1994
4538 :     --- lexgen.sml Mon Aug 8 18:28:46 1994
4539 :     ***************
4540 :     *** 1090,1096 ****
4541 :     val skel_mid2 =
4542 :     "\t\t | Internal.D k => action (i,(acts::l),k::rs)\n\
4543 :     \\t\t | Internal.T k =>\n\
4544 :     ! \\t\t let fun f (a::b,r) =\n\
4545 :     \\t\t\t if a=k\n\
4546 :     \\t\t\t then action(i,(((Internal.N a)::acts)::l),(b@r))\n\
4547 :     \\t\t\t else f (b,a::r)\n\
4548 :     --- 1090,1096 ----
4549 :     val skel_mid2 =
4550 :     "\t\t | Internal.D k => action (i,(acts::l),k::rs)\n\
4551 :     \\t\t | Internal.T k =>\n\
4552 :     ! \\t\t\t let fun f (a::b,r) =\n\
4553 :     \\t\t\t if a=k\n\
4554 :     \\t\t\t then action(i,(((Internal.N a)::acts)::l),(b@r))\n\
4555 :     \\t\t\t else f (b,a::r)\n\
4556 :    
4557 :     Status: fixed in 106 (lexgen 1.6.0)
4558 :     ----------------------------------------------------------------------
4559 :     Number: 903
4560 :     Title: floating point broke on DECstation
4561 :     Keywords:
4562 :     Submitter: Daniel R. Ehrlich <ehrlich@cse.psu.edu>
4563 :     Date: 08/29/94
4564 :     System(s) and Version: Compiler (?)
4565 :     SML/NJ Version: 0.93
4566 :     Machine: DECstation 5000/33
4567 :     Severity: critical
4568 :     Problem: Can not use floating point numbers
4569 :     Code: 4.2;
4570 :     Transcript:
4571 :     Standard ML of New Jersey, Version 0.93, February 15, 1993
4572 :     val it = () : unit
4573 :     - 4.2;
4574 :    
4575 :     uncaught exception Overflow
4576 :     -
4577 :     Owner: John
4578 :     Status: obsolete [new basis]
4579 :     ----------------------------------------------------------------------
4580 :     Number: 904
4581 :     Title: equal but distinguishable strings
4582 :     Keywords:
4583 :     Submitter: Alain.Deutsch@inria.fr
4584 :     Date: 9/8/94
4585 :     Version: 103f
4586 :     System: ?
4587 :     Severity: major
4588 :     Problem:
4589 :     Two strings test equal, but a function applied to both strings
4590 :     yields different results, therefore distinguishing them.
4591 :     Transcript:
4592 :     Standard ML of New Jersey, Version 1.03f, April 11, 1994
4593 :     - - fun Bug(s: string) =
4594 :     let val file = "/tmp/G00099"
4595 :     val stream = open_out(file)
4596 :     val _ = output(stream, s)
4597 :     val _ = close_out(stream)
4598 :     val stream = open_in(file)
4599 :     val s' = input(stream, size(s))
4600 :     val _ = close_in(stream)
4601 :    
4602 :     fun f(s: string) =
4603 :     case s of
4604 :     "OK\n" => 0
4605 :     | _ => 1
4606 :     in
4607 :     (f s, f s', s=s')
4608 :     end;
4609 :    
4610 :     val Bug = fn : string -> int * int * bool
4611 :    
4612 :     - - val bug = Bug("OK\n");
4613 :     val bug = (0,1,true) : int * int * bool
4614 :    
4615 :     - - Bug("FOObar");
4616 :     val it = (1,1,true) : int * int * bool
4617 :    
4618 :     Then the first run Bug("OK\n") gives the following inconsistent
4619 :     result: s and s' are equal but distinguishable. This looks very
4620 :     much like a bug.
4621 :    
4622 :     Status: fixed in 1.07
4623 :     ----------------------------------------------------------------------
4624 :     Number: 905
4625 :     Title: type insecurity with local around functor declaration
4626 :     Keywords: type checking, core dump, value restriction
4627 :     Submitter: Claudio Russo,cvr@dcs.ed.ac.uk
4628 :     Date: 9/12/94
4629 :     System(s) and Version: Compiler
4630 :     SML/NJ Version: 0.93
4631 :     Machine: Solaris but I guess all others too
4632 :     Severity: critical
4633 :     Problem:
4634 :    
4635 :     There is a type insecurity arising from the (non-standard according to
4636 :     the Definition) use of local declarations in functor bindings,
4637 :     ie. some well typed programs go "wrong" in the sense of Milner.
4638 :     Consider the following:
4639 :    
4640 :     Code:
4641 :    
4642 :     local val lr = ref [] in
4643 :     functor F (type t) =
4644 :     struct
4645 :     exception Empty;
4646 :     local datatype s = S of t
4647 :     in
4648 :     fun put x = lr:= [(S x)]
4649 :     fun get () = case !lr of
4650 :     [S x] => x
4651 :     | _ => raise Empty
4652 :     end
4653 :     end
4654 :     end; (* local *)
4655 :    
4656 :     structure A = F(type t = unit -> unit);
4657 :     structure B = F(type t = bool);
4658 :    
4659 :     B.put true;
4660 :     (A.get ()) (); (* an attempt to apply a boolean to an argument *)
4661 :    
466