SIMPL 1.2 is out! It completes pointers, makes several error messages say more clearly what to do, and opens a place to meet other SIMPL users. Programs written for SIMPL 1.1 run unchanged, with a few small exceptions listed below.
What's new
Pointers, complete
A pointer kept in a record field or an array element can now be followed directly, to read and to write, so a chain of records reads just as you would draw it:
OUTPUT First.NextNode^.Name
First.NextNode^.NextNode^.Name ← "Cleo"
Current ← ^First
WHILE Current <> NULL
OUTPUT Current^.Name
Current ← Current^.NextNode
ENDWHILENULL is the pointer that points nowhere: P ← NULL unlinks a pointer and IF P <> NULL THEN checks it. Two pointers are now equal when they point to the same variable, and every pointer starts as NULL. Chapter 14 of the User Manual shows it all.
Clearer error messages
A ^ in the wrong place now says where it can go, instead of talking about powers. < and > between values that have no order (pointers, records, arrays, sets, TRUE and FALSE) suggest what to compare instead. And a missing comma is now Expected ',', but found..., with the symbol in quotes.
Join the community
SIMPL is made by one independent developer, with no company or advertising behind it: it grows when the people who find it useful tell others about it. Two new entries in the Help menu make that easy: Visit the SIMPL Community opens the community board here on itch.io, the place for questions, ideas and bugs, and Rate SIMPL on AlternativeTo lets you leave a rating or a short review that helps others discover SIMPL. Once you've used SIMPL for a while, it may remind you of them when you close it, at most twice.
And also
Cambridge Strict Mode now reports ^ in every kind of declaration, SIMPLR answers GOTO with no line number with a proper ? SYNTAX ERROR, and the User Manual opens again with the newest Tk 9. Everything is in the full list at the end of this post.
Compatibility
NULLis now a reserved word, likeTRUEandFALSE: a variable, field or routine namedNullmust be renamed.- Two pointers are compared by the address they hold:
P = QisTRUEwhen both point to the same variable, or are both null, where 1.1 often saidFALSE. Comparing pointers to different types of data now stops the program with an error. - A null pointer is printed
NULL(it was^NULL), and some error messages are worded differently.
Upgrading from 1.1
- Download SIMPL 1.2 and put the new
simpl.exe(Windows) orsimpl.appimage(Linux) in the same folder as the old one, replacing it. Your settings, programs and libraries live next to it, and they are kept. - To get the fixed SIMPLR: SIMPL never overwrites a file that is already in your
programsfolder, because it might be one you changed. So rename the old one first, for exampleprograms/simplr.simpltosimplr_1.1.simpl, then start SIMPL 1.2: it copies the newsimplr.simplinto the folder at startup. Your renamed copy stays as it was.
If you put SIMPL 1.2 in a new, empty folder instead, it starts with fresh copies of everything: just copy your own programs over from the old programs folder.
Thanks for using SIMPL! Questions, ideas or bugs are welcome on the community board, and if SIMPL is useful to you, a rating on AlternativeTo helps others find it.
Full list of changes
Pointers
^after a field or an array element. A pointer kept in a record field or an array element is followed directly, to read and to write:OUTPUT First.NextNode^.Name,First.NextNode^.NextNode^.Name,First.NextNode^.Name ← "Bea",Scores[1]^ ← 80. In 1.1 this was a syntax error, and the pointer had to be copied into a variable first.NULL, the null pointer.P ← NULLmakes a pointer point nowhere, andIF P <> NULL THENchecks it, so a loop can follow a chain of records to its end:WHILE Current <> NULL. Every pointer starts asNULL. The Cambridge guide has no word for it, so Cambridge Strict Mode reports it.- Comparing pointers.
=and<>compare addresses: two pointers are equal when they point to the same variable, or are both null, however each was made. To compare the values they point to, follow them:P^ = Q^. Pointers to different types of data can't be compared. - Every pointer starts as a null pointer, also a field declared
NextNode : ^TNodeand the elements ofARRAY[1:2] OF ^INTEGER: following one says Cannot dereference a null pointer. - The User Manual's Chapter 14 shows all of this, with a chain of records followed through its pointers.
Error messages
- Symbols in quotes. Expected ',', but found identifier 'S' (it was Expected ,,); keywords stay as they are (Expected THEN).
^in the wrong place.P^^orF()^now explain where^can go (after a pointer's name, a field or an element), instead of talking about powers;NULL^and^NULLhave messages of their own.2 ^ 3still says to use**for powers.<and>between values with no order (pointers, records, objects, arrays, sets,TRUEandFALSE) now give a hint that fits: what can be compared instead.
Cambridge Strict Mode
^in a declaration is now reported wherever a type is written with^in place: a field of a TYPE or a CLASS, an array of pointers (ARRAY[1:2] OF ^INTEGER), a parameter, a local variable. The guide names a pointer type first:TYPE TIntPointer = ^INTEGER.NULLis reported (see Pointers).
Community
- Help > Visit the SIMPL Community opens the community board on itch.io: the place for questions, ideas and bugs, and to talk with me and with other SIMPL users.
- Help > Rate SIMPL on AlternativeTo: a rating, a short review or a like there helps others discover SIMPL. Both links are also in About.
- Once you have used SIMPL for a while, closing it may show a short invitation to do the same. It appears at most twice, never right after an error, and Don't ask again turns it off.
Programs
- SIMPLR:
GOTOorGOSUBwith no line number now answers? SYNTAX ERROR(it was? UNDEFINED LINE 0 ERROR), andGOTO 1 / 0answers? DIVISION BY ZERO ERROR. See Upgrading from 1.1 to get it.
Fixed
- With Tk 9 the User Manual did not open.
- Assigning a pointer taken from a copied record or array stopped with an internal error.
- Two pointers to the same variable were not equal.
- A pointer field or element declared with
^started empty instead of null.