2021-06-19 18:28 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000533mercuryBugpublic2021-05-17 13:59
Reporterpr1 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformMercury Compiler, version 20.06.OSMacosxOS Version11.3.1
Product Version 
Target VersionFixed in Version 
Summary0000533: Missing streams.int module
DescriptionA "streams.int missing" message appears when you compile the below code.
Steps To ReproduceCompile the following code (source: Rosetta Code Website):

:- func dr(string) = string.
dr(Name) = Titled :-
    some [!SB] (
        !:SB = string.builder.init,
        put_char(handle, 'D', !SB),
        put_char(handle, 'r', !SB),
        format(handle, " %s", [s(Name)], !SB),
        Titled = to_string(!.SB)
    ).
main(!IO) :-
  io.format("%s\n", [s(dr("chien"))], !IO)
  .
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001141

juliensf (administrator)

We will require more information than that in order to reproduce the issue.

1. The complete program, including all the module import declaration etc. (You say it is sourced from Rosetta coda -- which program on that site is it?)

2. What exactly was the command you used to try and compile it?

~0001142

pr1 (reporter)

Rosetta Code sample here: http://www.rosettacode.org/wiki/Variables#Mercury
Please search for "func dr(string"

Error Message I get:

p@XXX existential_types % mmc exist3.m
mercury_compile: cannot find `streams.int' in directories .,
  /usr/local/Cellar/mercury/20.06.1/lib/mercury/ints
p@XXX existential_types %

~0001143

pr1 (reporter)

Mercury Compiler, version 20.06.1, on x86_64-apple-darwin20.3.0
Copyright (C) 1993-2012 The University of Melbourne
Copyright (C) 2013-2020 The Mercury team
Usage: mmc [<options>] <arguments>
Use `mmc --help' for more information.

~0001144

zs (developer)

That still does not give us THE CODE OF THE PROGRAM YOU ARE TRYING TO COMPILE.

~0001145

pr1 (reporter)

I added it as an attachment, though.
Here it is:
:- module exist3.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.

:- implementation.
:- import_module char.

:- import_module list.
% to_char
:- import_module streams.
:- import_module string.
:- import_module string.builder.
:- import_module int.

:- func dr(string) = string.
dr(Name) = Titled :-
    some [!SB] (
        !:SB = string.builder.init,
        put_char(handle, 'D', !SB),
        put_char(handle, 'r', !SB),
        format(handle, " %s", [s(Name)], !SB),
        Titled = to_string(!.SB)
    ).

main(!IO) :-
  io.format("%s\n", [s(dr("chien"))], !IO)
  .

~0001146

zs (developer)

Sorry, I didn't see that. The automated email sent by Mantis
did not include it.

~0001147

juliensf (administrator)

The message is accurate, there is no "streams" module; the one you want is called "stream".
You also need to import the module "stream.string_writer" for this code to work.
+Notes

-Issue History
Date Modified Username Field Change
2021-05-16 22:06 pr1 New Issue
2021-05-16 23:03 juliensf Note Added: 0001141
2021-05-16 23:19 pr1 File Added: exist3.m
2021-05-16 23:19 pr1 Note Added: 0001142
2021-05-16 23:20 pr1 Note Added: 0001143
2021-05-16 23:24 zs Note Added: 0001144
2021-05-16 23:37 pr1 Note Added: 0001145
2021-05-17 00:07 zs Note Added: 0001146
2021-05-17 13:59 juliensf Note Added: 0001147
+Issue History