Replies: 5 comments 12 replies
-
I've public some releases. https://github.com/VictorMiasnikov/cm3/releases https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20221108_14-05 I hope this file: Schutz_2022-06-08_and_cm3-all-AMD64_LINUX-d5.11.9-AMD64_LINUX(Debian_8.11.1_and_{{GCC_4.9.2}})-2022-11-08_14-05__FIXed__by__VVM__2022-11-14_08-16__AMD64_LINUX__Target__cm3-fbcb95d.tar.xz can be relative usefull. |
Beta Was this translation helpful? Give feedback.
-
Alternative method: Unpack cm3-all-* to /usr/local/cm3. Unpack source code to folder P.S. This: steal useful. |
Beta Was this translation helpful? Give feedback.
-
I've got a successful install using: this page |
Beta Was this translation helpful? Give feedback.
-
`MODULE Main; IMPORT IO; (* So we can print things *) VAR name: TEXT; (* a string variable called "name" *) BEGIN
It compiles and runs fine. What's the warning about then? Thx |
Beta Was this translation helpful? Give feedback.
-
On 2/23/23 03:12, VictorMiasnikov wrote:
Please see about |<*FATAL ANY*>| inside #791 (comment) <#791 (comment)>
and near.
P.S. I continue re-reading and see good example ( I add one line):
|MODULE hello2 EXPORTS Main; IMPORT IO; <* FATAL IO.Error *> <*FATAL ANY*> VAR name: TEXT; BEGIN TRY IO.Put("Gimme your name: "); name := IO.GetLine(); EXCEPT IO.Error => (*do nothing*) END; IO.Put("Your name was entered as: " & name & "\n"); END hello2.|
With Victor's addition of the TRY-EXCEPT statement,
you don't. The signature of IO.GetLine says RAISES{Error}
to tell you that *it* can raise Error. But the TRY-EXCEPT
wrapped around the call on GetLine will catch it and ignore
it, so it will not propagate out of this version of Hello2.
In the original version, without the TRY-EXCEPT, if the exception
came out of GetLine, it would propagate right on through hello, so
a RAISES would be appropriate.
Unfortunately, Modula-3 does not
provide a syntax for RAISES on blocks, only on procedures. And
your code is directly inside the main block of the main module,
so there is no place.
The right way would be to pull out your code into a procedure,
put a call to that in the main block, and put the RAISES on it.
|MODULE hello2 EXPORTS Main; IMPORT IO; <*FATAL ANY*> PROCEDURE Work ( ) RAISES {IO.Error} VAR name: TEXT; BEGIN IO.Put("Gimme your name: "); name := IO.GetLine(); IO.Put("Your name was entered as: " & name & "\n"); END(*Work*) BEGIN (*hello2*) Work ( ) END hello2.|
I usually put very little in a module's block,
just a call or two on something. If it's not the
main program module, usually nothing at all, or
a call on some module-specific but global initialization.
The only thing FATAL does is suppress the compiler warning
that a fatal exception, that is neither caught by a TRY-EXCEPT
nor announced by a RAISES, can't be ruled out by the language.
… |(* HELP - where do I put RAISES {IO.Error} *) |
—
Reply to this email directly, view it on GitHub <#1155 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABSVZNHSFXUWXHKDYDIXVCDWY4SYLANCNFSM6AAAAAAVCIDZFM>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
what have I missed? tia ...
_
Beta Was this translation helpful? Give feedback.
All reactions