seed7-users Mailing List for Seed7 (Page 3)
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(9) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
|
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
| 2011 |
Jan
(2) |
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(2) |
Aug
(6) |
Sep
(7) |
Oct
(3) |
Nov
(10) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
(1) |
| 2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2015 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2016 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
| 2021 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(12) |
Oct
(4) |
Nov
(17) |
Dec
(3) |
| 2022 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
(17) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(12) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(5) |
Dec
|
|
From: Renato A. <re...@at...> - 2023-06-14 15:53:38
|
Hi Tomas,
I am really curious about Seed7 so I decided to build it on my Mac M1.
I had only a small issue with the x11 lib not being found, which I solved
by installing it using brew:
brew install libx11
And then linking it from the brew location to /usr/local/include, so the C
compiler can find it:
sudo ln -s /opt/homebrew/include/X11 /usr/local/include/X11
After this I was able to build the compiler without issues...
make -f mk_osxcl.mak depend
make -f mk_osxcl.mak
make -f mk_osxcl.mak s7c
I am writing because I think you may want to include the above in your
documentation to make it a bit easier for people...
I would also like to suggest adding a GitHub action that can do the above
automatically, and push the binaries on the GitHub Releases Assets, so
people can download it from there (Linux, Mac and Windows are supported).
Let me know if you need help to set that up and I can send a PR!
Cheers,
Renato Athaydes
|
|
From: Thomas M. <tho...@gm...> - 2023-03-08 13:12:15
|
Hi Gary, I found something about "operation not permitted" in a MacOS terminal: https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos Starting with MacOS Mojave 10.14 they restricted what a terminal can do. Maybe this is the reason for "operation not permitted" and why sudo does not help. You can use the fix and try installing Seed7 again. If you don't want to use the fix I have another solution: I released Seed7 version 2023-03-05. In this release I changed mk_osx.mak and mk_osxcl.mak to use -mv ../doc/s7.1.gz /usr/share/man/man1 instead of mv ../doc/s7.1.gz /usr/share/man/man1 The - makes a difference. According to the description of the make commend (at https://thomasmertes.github.io/Seed7Home/scrshots/make7.htm ): If a command is prefixed with a minus sign (-) possible errors of the command are ignored. This should also apply to the make command of MacOS. So the installation of Seed7 should finish without stopping with "operation not permitted". The difference is: The manual pages of s7 and s7c will not be installed. But there are other ways to invoke the manual pages of Seed7. On my (Linux) computer I can do: seed7_5/src> man ../doc/s7.1 to display the manual page of s7. Probably this works also on MacOS (maybe it is necessary to specify an absolute path to s7.1). Please tell me, if you had success. Regards Thomas |
|
From: Thomas M. <tho...@gm...> - 2023-03-01 18:35:48
|
Hi Gary, The FAQ explains editor support for syntax highlighting: https://seed7.sourceforge.net/faq.htm#syntax_highlighting Regards Thomas |
|
From: Duke N. <duk...@gm...> - 2023-03-01 18:19:59
|
|
From: Thomas M. <tho...@gm...> - 2023-03-01 17:59:14
|
Hi Gary, When I do: > sudo gzip -c ../doc/s7.1 > /usr/share/man/man1/s7.1.gz I also get the error message: bash: /usr/share/man/man1/s7.1.gz: Permission denied But > sudo make install works on my computer. But maybe the combination of sudo and redirection from a makefile does not work on your computer. I changed mk_osx.mak and mk_osxcl.mak to use gzip -c ../doc/s7.1 > ../doc/s7.1.gz mv ../doc/s7.1.gz /usr/share/man/man1 instead of gzip -c ../doc/s7.1 > /usr/share/man/man1/s7.1.gz See attachments. Please try this and tell me about the result. Regards Thomas |
|
From: Gary C. <ch...@ma...> - 2023-02-26 16:06:59
|
Hi Thomas, Thank you for sharing your post on Reddit Pascal. I’m running Mac OS 13.2.1 and I’ve downloaded the latest copy of Seed7 (seed7_05_20230130.tgz <https://sourceforge.net/projects/seed7/files/seed7/seed7_05_20230130/seed7_05_20230130.tgz/download>). I’ve successfully compiled the Seed7 interpreter and now I’m in the process of compiling the Seed7 compiler. I was successfully with the following steps: 1) make s7c 2) make test 3) make utils But I was unsuccessful with the step 4) sudo make install ➜ src sudo make install mkdir -p /usr/local/bin cd ../bin; ln -fs `pwd`/s7 /usr/local/bin cd ../bin; ln -fs `pwd`/s7c /usr/local/bin gzip -c ../doc/s7.1 > /usr/share/man/man1/s7.1.gz /bin/sh: /usr/share/man/man1/s7.1.gz: Operation not permitted make: *** [makefile:171: install] Error 1 Since it was a permission error, I logged in as root - but still no joy. Thank you, Gary |
|
From: Zaakari <Za...@pr...> - 2022-07-30 19:08:09
|
Hey Thomas, First, some background. I've been working on a graphics editor for some time now (in Seed7, of course), and one of its main features is that the user can not only edit which hotkeys perform the various actions, but that he can edit the actions themselves (to a certain extent). This feature lead to defining a syntax for some "config" files which the editor parses--translating them into conditions and actions within the code. But as more features have become necessary/desirable, this syntax has grown rather complex to the point where I'm starting to feel like I'm making another language. As happy as I am to be making a customizable editor, it also feels like I am--perhaps pointlessly--"redefining the wheel". It feels like a waste to parse a whole bunch of new syntax, when I'm all ready using the wonderful language and parser that is Seed7. Not to mention that the complex strings read from the config files cannot be completely parsed into variables as that would require the use of pointers (and would likely be a confusing mess), and therefore the program's speed suffers due to having to parse part of the content each time a "hotkey" is matched. All that to say, it had me wondering if I could use Seed7 itself instead of making custom syntax within config files. Obviously, this could be done if I never compiled the resulting program, and just left it as a script to be run by the interpreter. But that would be less-than-ideal and needlessly confusing for the end-user as there would only be a few files they should be editing (not the whole program). Also that would require that all such programs be open-source (which might not always be desirable). Therefore, do you think it would be possible to make dynamic libraries for Seed7 programs, in the Seed7 language (similar idea to ".so" files or "DLLs")? This way I could have the end-user could write their own "library" for the hotkey management (a library that would be required by the graphics editor), which would then benefit from the type-safety and speed of being actual Seed7 code, as well as remove the need for designing another "config language". If this is possible, I'm guessing you'd also want to add some security features to the dynamic loading process, like having a separate command for including dynamic libraries (so that static libraries can't be overridden); and the ability to restrict which other libraries/functions are available to each dynamic library (so that they can't just do whatever they want)--perhaps something like a function/includes "whitelist". Anyway, I was thinking something like this could be very useful (might help with making "moddable" games too), but what do you think? Zachary |
|
From: Zaakari <Za...@pr...> - 2022-07-23 20:49:34
|
Hey Thomas, It seems I have encountered a bug involving interfaces. I've attached a short script to demonstrate the problem, but--in short--if you pass an object as an "in var" parameter into a function accepting an interface type, then pass that parameter into a sub-function as an "inout" parameter, any changes made to the object in the sub-function will affect the original object at the top level (even though, it was initially passed in as "in var"). This problem doesn't seem to occur with either simple types (like integers) or with non-interface objects, just with implementation types. If you would take a look some time, that would be great. Thanks, Zachary |
|
From: Duke N. <duk...@gm...> - 2022-06-19 18:09:08
|
Thanks!! — Duke Sent from my iPhone > On Jun 19, 2022, at 12:00 PM, Thomas Mertes <tho...@gm...> wrote: > > On Tue, 14 Jun 2022 15:29:00 +0200 Duke Normandin <dukeof...@gm...> wrote: >> So I was translating the seed7 for loop as: >> >> for [number=1 to the length of the array] do >> <some_code> >> end for; >> >> I assume that number is incremented internally. Something like the >> `foreach' construct in some languages. > > Yes, this loop works as foreach loop (and the index (number) is hidden). > > BTW I have improved the explanation in the tutorial to explicitely > state that it is a for-each-loop. See: > > http://seed7.sourceforge.net/manual/tutorial.htm#For_loop_and_containers > > I also added more examples of for-each-loops (with hash maps etc.). > > Regards > Thomas > > > > _______________________________________________ > Seed7-users mailing list > See...@li... > https://lists.sourceforge.net/lists/listinfo/seed7-users |
|
From: Duke N. <duk...@gm...> - 2022-06-19 18:06:54
|
Sorry about the garbled msg. It’s all good. The file needed tweaking. 😀 — Duke Sent from my iPhone > On Jun 19, 2022, at 11:44 AM, Thomas Mertes <tho...@gm...> wrote: > > On Sun 12. Jun 2022 15:36:00 +0200 Duke Normadin <dukeof...@gm...> wrote: >>> ---------- begin seed7.nanorc ---------- >> >> # Seed7 syntax highlighting for Nano editor >> # on Debian distros, this file lives in $HOME/.config/nano/ >> # change the colours to suit your taste. >> >> syntax "seed7" "\.sd7" >> ... >>> ---------- end seed7.nanorc ---------- >> >> This nano syntax file is a WIP and my first attempt to get >> something working. It needs improvement that is certain. :) > > The email program garbled the seed7.nanorc file a litte bit, > but I was able to restore it. > > I also did some improvements. The new version of seed7.nanorc > can be found here: > > https://github.com/ThomasMertes/seed7/blob/master/doc/seed7.nanorc > > What do you think about these improvements? > > Regards > Thomas > > > > _______________________________________________ > Seed7-users mailing list > See...@li... > https://lists.sourceforge.net/lists/listinfo/seed7-users |
|
From: Thomas M. <tho...@gm...> - 2022-06-19 18:00:42
|
On Tue, 14 Jun 2022 15:29:00 +0200 Duke Normandin <dukeof...@gm...> wrote: > So I was translating the seed7 for loop as: > > for [number=1 to the length of the array] do > <some_code> > end for; > > I assume that number is incremented internally. Something like the > `foreach' construct in some languages. Yes, this loop works as foreach loop (and the index (number) is hidden). BTW I have improved the explanation in the tutorial to explicitely state that it is a for-each-loop. See: http://seed7.sourceforge.net/manual/tutorial.htm#For_loop_and_containers I also added more examples of for-each-loops (with hash maps etc.). Regards Thomas |
|
From: Thomas M. <tho...@gm...> - 2022-06-19 17:50:14
|
On Sun, 12 Jun 2022 15:41:00 +0200 Duke Normadin <dukeof...@gm...> wrote > I know enough Emacs Lisp to hack my .emacs file, but that is all. > I believe what is needed is a seed7-mode.el. What /current/ > language would you say seed7 most resembles? I would suggest Ada or Modula2 as both languages have statements that are similar to the ones of Seed7. Regards Thomas |
|
From: Thomas M. <tho...@gm...> - 2022-06-19 17:44:23
|
On Sun 12. Jun 2022 15:36:00 +0200 Duke Normadin <dukeof...@gm...> wrote: > > ---------- begin seed7.nanorc ---------- > > # Seed7 syntax highlighting for Nano editor > # on Debian distros, this file lives in $HOME/.config/nano/ > # change the colours to suit your taste. > > syntax "seed7" "\.sd7" > ... > > ---------- end seed7.nanorc ---------- > > This nano syntax file is a WIP and my first attempt to get > something working. It needs improvement that is certain. :) The email program garbled the seed7.nanorc file a litte bit, but I was able to restore it. I also did some improvements. The new version of seed7.nanorc can be found here: https://github.com/ThomasMertes/seed7/blob/master/doc/seed7.nanorc What do you think about these improvements? Regards Thomas |
|
From: Duke N. <duk...@gm...> - 2022-06-14 13:29:24
|
On Tue, 14 Jun 2022 07:55:48 +0200
Thomas Mertes <tho...@gm...> wrote:
> On Mon, 13 Jun 2022 21:08:00 +0200
> Duke Normandin <dukeof...@gm...> wrote:
> > In your manual, you have the following examples:
> >
> > for number range [] (0, 1, 2, 3, 5, 8, 13, 20, 40, 100) do
> > for innerPlanet range {"Mercury", "Venus", "Earth", "Mars"} do
> > for letter range "the quick brown fox jumps over the lazy dog"
> > do
> >
> > Is it correct to think of `range' to mean: "to the length of"?
> > for number "to the length of" [] (0, 1, 2, .... 20, 40,100) do
>
> I don't know what you mean with "to the length of".
> There is no 'range' function. Instead the keyword 'range' is
> part of the for-loop. In case of
It's not clear what the meaning of `range' is. Usually in other
languages it can mean something like [i .. i_nth] a generator.
So I was translating the seed7 for loop as:
for [number=1 to the length of the array] do
<some_code>
end for;
I assume that number is incremented internally. Something like the
`foreach' construct in some languages.
--
Duke
** Bottom-posting, text-only is the netiquette way! **
|
|
From: Thomas M. <tho...@gm...> - 2022-06-14 05:56:02
|
On Mon, 13 Jun 2022 21:08:00 +0200
Duke Normandin <dukeof...@gm...> wrote:
> In your manual, you have the following examples:
>
> for number range [] (0, 1, 2, 3, 5, 8, 13, 20, 40, 100) do
> for innerPlanet range {"Mercury", "Venus", "Earth", "Mars"} do
> for letter range "the quick brown fox jumps over the lazy dog" do
>
> Is it correct to think of `range' to mean: "to the length of"?
> for number "to the length of" [] (0, 1, 2, .... 20, 40,100) do
I don't know what you mean with "to the length of".
There is no 'range' function. Instead the keyword 'range' is
part of the for-loop. In case of
for number range [] (0, 1, 2, 3, 5, 8, 13, 20, 40, 100) do
write(number <& " ");
end for;
writeln;
The program actually writes the line:
0 1 2 3 5 8 13 20 40 100
So number gets all the values from the array one by one.
Internally this for-loop has some index into the array
(to the array element that is currently assigned to number).
But this for loop does not show you the index.
If you have more questions just ask.
Regards
Thomas
|
|
From: Duke N. <duk...@gm...> - 2022-06-13 19:08:58
|
In your manual, you have the following examples:
[code]
for number range [] (0, 1, 2, 3, 5, 8, 13, 20, 40, 100) do
for innerPlanet range {"Mercury", "Venus", "Earth", "Mars"} do
for letter range "the quick brown fox jumps over the lazy dog" do
[/code]
Is it correct to think of `range' to mean: "to the length of"?
for number "to the length of" [] (0, 1, 2, .... 20, 40,100) do
--
Duke
** Bottom-posting, text-only is the netiquette way! **
|
|
From: Duke N. <duk...@gm...> - 2022-06-12 13:44:29
|
On Sun, 12 Jun 2022 11:01:01 +0200
Thomas Mertes <tho...@gm...> wrote:
> On Sat, 11 Jun 2022 07:04:00 +0200 Duke Normadin
> <dukeof...@gm...> wrote:
> > s7 sandbox.sd7
> > SEED7 INTERPRETER Version 5.1.632 Copyright (c) 1990-2022
> > Thomas Mertes *** sandbox.sd7(34):52: Match for {choice ::=
> > "" } failed end func;
> > -----------^
>
> Unfortunately this error message refers to the wrong line (34)
> instead of the correct one (7). I will look into this issue.
> The error message actually refers to the line
>
> var char: choice is "";
>
> where you try to initialize a char variable with a string literal.
> Char and string are different types so initializing a char with
> a string is not possible.
[snip]
Thank you for your reply! and advise! and corrections! and
suggestions!
All good learning materials.
Duke
** Bottom-posting, text-only is the netiquette way! **
|
|
From: Duke N. <duk...@gm...> - 2022-06-12 13:41:51
|
On Sun, 12 Jun 2022 11:16:02 +0200 Thomas Mertes <tho...@gm...> wrote: > On Tue, 7 Jun 2022 05:07:00 +0200 Duke Normadin <dukeof...@gm...> > wrote: > > Hi .. > > I use a Linux Debian-based distro. > > Does anybody have an emacs seed7-mode file they are willing to > > share. > > I failed to create a seed7-mode.el because of my limited > knowledge of Emacs Lisp and the details of its syntax > highlighting. > > Do you know Emacs Lisp and its syntax highlighting? I know enough Emacs Lisp to hack my .emacs file, but that is all. I believe what is needed is a seed7-mode.el. What /current/ language would you say seed7 most resembles? -- Duke ** Bottom-posting, text-only is the netiquette way! ** |
|
From: Duke N. <duk...@gm...> - 2022-06-12 13:36:32
|
On Sun, 12 Jun 2022 11:29:23 +0200
Thomas Mertes <tho...@gm...> wrote:
> On Tue, 7 Jun 2022 16:59:00 +0200 Duke Normadin <dukeof...@gm...>
> wrote:
> > I've just put together a syntax file for the nano editor.
> > It can/needs improvement(s), but it works just fine as is.
> > I can make it available. How?
>
> Great. If it is a text file (XML, JSON or otherwise non-binary)
> you can just send the file(s) content just as part of a mail like:
> ---------- begin seed7.nanorc ----------
# Seed7 syntax highlighting for Nano editor
# on Debian distros, this file lives in $HOME/.config/nano/
# change the colours to suit your taste.
syntax "seed7" "\.sd7"
##[Keywords 1]
color brightcyan "\<(begin|case|const|do|downto|else|elsif|end|enum|
exp|for|forward|func|false|if|in|include|inout|is|local|new|of|otherwise|param|range|ref|repeat|result|return|sci|struct|syntax|system|then|to|true|until|val|var|when|while)
exp|for|forward|func|false|if|in|include|inout|is|local|new|of|otherwise|param|range|ref|repeat|result|return|sci|struct|syntax|system|then|to|true|until|val|var|when|\>"
##[Keywords 2]
color brightred "array|biginteger|bigrational|bitset|boolean|char|
color|complex|duration|expr|file|float|func|hash|integer|object|proc|program|rational|reference|ref_list|
color|complex|duration|expr|file|float|func|hash|integer|object|proc|program|rational|reference|set|string|text|time|type|varfunc|void"
## strings
##color green ""(\\.|[^"])*""
## Strings, double-quoted
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%
[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^"
"%[QW]?![^!]*!"
##[Keywords 3]
## color cyan "\+|-|\>|\<|\^|:|=|:=|<>|<=|>=|><|**|<<|>>|<&|+:=|-:=|
## \*:=|\/:=|\<<:=|>>:=|\&:=|\@:="
##[Keywords 4]
color magenta "\<(and|conv|digits|div|exp|lpad|lpad0|mdiv|mod|mult|
not|or|parse|rem|rpad|sci|times|varconv)\>"
##[Keyword 5]
color brightblue "read|readln|write|writeln"
> ---------- end seed7.nanorc ----------
This nano syntax file is a WIP and my first attempt to get
something working. It needs improvement that is certain. :)
--
Duke
** Bottom-posting, text-only is the netiquette way! **
|
|
From: Thomas M. <tho...@gm...> - 2022-06-12 09:29:36
|
On Tue, 7 Jun 2022 16:59:00 +0200 Duke Normadin <dukeof...@gm...> wrote: > I've just put together a syntax file for the nano editor. > It can/needs improvement(s), but it works just fine as is. > I can make it available. How? Great. If it is a text file (XML, JSON or otherwise non-binary) you can just send the file(s) content just as part of a mail like: ---------- begin blah.xxx ---------- # Seed7 syntax highlighting for Nano ... ---------- end blah.xxx ---------- For a binary file you can try an attachment. If you allow me to add your Nano syntax highlighting to the official Seed7 release is will gladly add it. Many thanks in advance for your effort. Regards Thomas |
|
From: Thomas M. <tho...@gm...> - 2022-06-12 09:16:10
|
On Tue, 7 Jun 2022 05:07:00 +0200 Duke Normadin <dukeof...@gm...> wrote: > Hi .. > I use a Linux Debian-based distro. > Does anybody have an emacs seed7-mode file they are willing to > share. I failed to create a seed7-mode.el because of my limited knowledge of Emacs Lisp and the details of its syntax highlighting. Do you know Emacs Lisp and its syntax highlighting? Regards Thomas |
|
From: Thomas M. <tho...@gm...> - 2022-06-12 09:01:12
|
On Sat, 11 Jun 2022 07:04:00 +0200 Duke Normadin <dukeof...@gm...> wrote:
> s7 sandbox.sd7
> SEED7 INTERPRETER Version 5.1.632 Copyright (c) 1990-2022 Thomas
> Mertes *** sandbox.sd7(34):52: Match for {choice ::= "" } failed
> end func;
> -----------^
Unfortunately this error message refers to the wrong line (34)
instead of the correct one (7). I will look into this issue.
The error message actually refers to the line
var char: choice is "";
where you try to initialize a char variable with a string literal.
Char and string are different types so initializing a char with
a string is not possible.
The error message refers to the ::= operator that is never called
explizit. The ::= operator is used only by declaration statements
to initialize a variable or constant.
To correct this error use
var char: choice is ' ';
instead. This initializes the char variable choice with the
char literal ' '.
> *** sandbox.sd7(34):32: Declaration of "choice" failed
> end func;
> -----------^
This is a follow up error of the previous one.
> *** sandbox.sd7(19):52: Match for {choice getc } failed
> getc(choice);
The function getc has a file a parameter and returns a char.
So getc cannot be used with a char parameter (choice).
I suggest to use
choice := getc(IN);
instead. IN refers to the standard input file.
> *** sandbox.sd7(34):32: Declaration of "main" failed
> end func;
> -----------^
This is a follow up error of all previous errors.
> The error msgs are not very informative IMHO.
I will try to look into that.
> You have very detailed language specs, but
> very few simple examples of everything possible. Newcomers to Seed7
> have to hut and search and dig for examples at the rosettacode
> site. That is /not/ good advocacy! It's too bad that this is the
> situation, because you might have a popular and productive language
> if there was a comprehensive tutorial to learn it from.
Thank you for the hint. I will try to improve the tutorial.
Your example uses also 'break' which is not needed in Seed7 case
statements.
Below is my improved version of your example:
---------- begin sandbox.sd7 ----------
$ include "seed7_05.s7i";
$ include "float.s7i";
const proc: main is func
local
var char: choice is ' ';
var integer: tempF is 0;
var float: tempC is 0.0;
begin
writeln("Temperature Conversion Utitlity");
writeln("-------------------------------");
writeln("a - Fahrenheit TO Celsius");
writeln("b - Celsius TO Fahrenheit");
writeln("q - To exit the program");
writeln("Enter your choice");
choice := getc(IN);
case choice of
when {'a', 'A'}:
writeln("choice is " <& choice);
when {'b', 'B'}:
writeln("choice is " <& choice);
when {'q','Q'}:
writeln("Goodye ...");
otherwise:
writeln("Bad choice...");
end case;
end func;
---------- end sandbox.sd7 ----------
I hope that helps.
Regards
Thomas
|
|
From: Duke N. <duk...@gm...> - 2022-06-11 05:04:38
|
s7 sandbox.sd7
SEED7 INTERPRETER Version 5.1.632 Copyright (c) 1990-2022 Thomas
Mertes *** sandbox.sd7(34):52: Match for {choice ::= "" } failed
end func;
-----------^
*** sandbox.sd7(34):32: Declaration of "choice" failed
end func;
-----------^
*** sandbox.sd7(19):52: Match for {choice getc } failed
getc(choice);
*** sandbox.sd7(34):32: Declaration of "main" failed
end func;
-----------^
The code is here:
https://controlc.com/662efc7b
The error msgs are not very informative IMHO.
Would you clarify please.
I must say that once again I find myself struggling to learn your
programming language. You have very detailed language specs, but
very few simple examples of everything possible. Newcomers to Seed7
have to hut and search and dig for examples at the rosettacode
site. That is /not/ good advocacy! It's too bad that this is the
situation, because you might have a popular and productive language
if there was a comprehensive tutorial to learn it from.
Anyway, if you could set me straight for my current issue, then I
might be able to keep on going. TIA ..
--
Duke
** Bottom-posting, text-only is the netiquette way! **
|
|
From: Duke N. <duk...@gm...> - 2022-06-07 17:58:13
|
I've just put together a syntax file for the nano editor. It can/needs improvement(s), but it works just fine as is. I can make it available. How? -- Duke ** Bottom-posting, text-only is the netiquette way! ** |
|
From: Duke N. <duk...@gm...> - 2022-06-07 03:07:41
|
Hi .. I use a Linux Debian-based distro. Does anybody have an emacs seed7-mode file they are willing to share. I found the vim support, but ... TIA .. -- Duke ** Bottom-posting, text-only is the netiquette way! ** |