Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#195] SuccessorML do expression in Functor arguments.

Date:
2018-03-08 22:11
Priority:
3
State:
Open
Submitted by:
Bug Submitter (webuser)
Assigned to:
David MacQueen (dbm)
Machine Architecture:
x86
Operating System:
Linux
Component:
Compiler
Resolution:
Accepted As Bug
Severity:
Major
OS Version:
SML/NJ Version:
110.82
Keywords:
SuccessorML do
URL:
Transcript (of reproduction):
$ (echo 'CM.make "foo.cm";';echo 'SMLofNJ.exportFn("foo.x86-linux",Main.main);') | CM_VERBOSE=false sml -Cparser.succ-ml=true Standard ML of New Jersey v110.82 [built: Thu Mar 8 13:23:37 2018] - Error: Compiler bug: ElabMod: elabmod: extractSig Unexpected dec val it = false : bool stdIn:2.34-2.43 Error: unbound structure: Main in path Main.main $ sml foo.sml Standard ML of New Jersey v110.82 [built: Thu Mar 8 13:23:37 2018] [opening foo.sml] foo.sml:19.24-19.46 Error: syntax error: deleting DO IDS STRING
Source (for reproduction):
functor FIXME () = struct end structure Main = struct fun $ _ = () (* Note recommended syntax: INSERTING DO *) (* structure F0 = FIXME($"some random note") *) (* Works. *) structure F1 = FIXME(val _ = $"some random note") (* :( *) structure F2 = FIXME(do $"some random note") fun main _ = () end
Summary:
SuccessorML do expression in Functor arguments.

Detailed description
When performing do expressions within functors,
the compiler can encounter a few errors
(with syntax the compiler might occasionally recommend),

the "val _ =" form works, however,
replacing that with do can fail in a few ways depending upon how you invoke smlnj.
Additional comments:
The name of the functor I noticed this with just happened to be FIXME,
not meant to indicate the location of the problem.

Submitted via web form by matt rice <ratmice@gmail.com>

Comments:

No Comments Have Been Posted

Attached Files:

Changes

Field Old Value Date By
assigned_tojhr2018-05-11 20:11jhr
assigned_tonone2018-03-25 12:12jhr
detailsWhen performing do expressions within functors, the compiler can encounter a few errors (with syntax the compiler might occasionally recommend), the "val _ =" form works, however, replacing that with do can fail in a few ways depending upon how you invoke smlnj. Additional comments: The name of the functor I noticed this with just happened to be FIXME, not meant to indicate the location of the problem. Submitted via web form by matt rice <ratmice@gmail.com> 2018-03-25 12:12jhr
ResolutionNone2018-03-25 12:12jhr
SeverityCosmetic2018-03-25 12:12jhr
Transcript (of reproduction) $ (echo 'CM.make "foo.cm";';echo 'SMLofNJ.exportFn("foo.x86-linux",Main.main);') | CM_VERBOSE=false sml -Cparser.succ-ml=true Standard ML of New Jersey v110.82 [built: Thu Mar 8 13:23:37 2018] - Error: Compiler bug: ElabMod: elabmod: extractSig Unexpected dec val it = false : bool stdIn:2.34-2.43 Error: unbound structure: Main in path Main.main $ sml foo.sml Standard ML of New Jersey v110.82 [built: Thu Mar 8 13:23:37 2018] [opening foo.sml] foo.sml:19.24-19.46 Error: syntax error: deleting DO IDS STRING 2018-03-25 12:12jhr
Source (for reproduction)functor FIXME () = struct end structure Main = struct fun $ _ = () (* Note recommended syntax: INSERTING DO *) (* structure F0 = FIXME($"some random note") *) (* Works. *) structure F1 = FIXME(val _ = $"some random note") (* :( *) structure F2 = FIXME(do $"some random note") fun main _ = () end 2018-03-25 12:12jhr