two colums

8
3

When you want to program loops in G15 PMN

A simple way to do it is by means of LL:nnn, where nnn is the number of repetitions you want. Then say what you want, and complete the loop with LO.

  If you put the stuff into card i:1 as above, then the command ^i1 followed by (on the next line) the command ‘cc’ to compile it, is enough to start it and get the output as shown above.

  In the example above–repeated after the output so it is easy to look at while also reading this text–you see that G15 PMN has two columns in each of its program cards. So the text above first defines the word ‘nice’. You see that the full stop is really, really huge, so there is no doubt that it is there. You also see that the characters as displayed there–and they are automatically considered as lowercase in these cards, unless you press SHIFT and get a dot above and to the right of this so-called ROBOTFONT (for it is suitable for low-resolution LED-displays on robotic instruments also)–they are rich in contrast, and that’s a GOOD thing for programmers. For instance, the ‘i’ is as different from ‘l’ and from the number ‘1′ as it is just about possible to get while still having a resemblance to typical English letters. It is also an optimistic font–it’s all pointing up, all over the place (except for the letter ‘z’, which has been mirrored, to reflect that it is last in the alphabet, and signifies typically a completion of something). Finally, let us also note that the letters of these cards are huge,–in fact, gigantic.

  Now all this sums up to what a programmer will want to have when truly complicated programs are made, made out of hundreds or even thousands of cards. Each card must be not just half-way right, or two-thirds right, but totally right–in a way. This exactness can be tiresome. The large font, the conciseness of the PMN expressions, the optimism of the bright green and the upward-pointing features of the funny characters, and the clear-cut contrast between the tools that the programmer works with–namely, first and foremost, text and numbers–all this adds up to elegance and meditative flow of programming and ease of correction, generally speaking. Nevertheless, every complex programming process will have moments of confusion, no matter how the language is structured, and how the routines are displayed.

  In any case, to return to description of the above: the first routine is called ‘nice’, and the second ‘lotsnice’. Lotsnice is defined like this:

lotsnice=
ce
ll:23
nice
lo.

So, the {menu} type of thing at bottom merely reflects what mode the card editor and performer, the CAR, was in when I took this screencopy. It also says that I work in card i:1. The {menu} becomes {edit} when the mouse is right-clicked. The {edit} becomes {menu} when CTR-W is pressed. To an artist, a smooth W looks like the metaphor of a girl’s mouse.

  The CE is Clear scrEen. If you omit it, the program will still work, but it will say YES! on the upper left to show that the program compiled in well enough. Finally, on the right column, at bottom, there is the zz type of statement. This tells the compiler that when compilation is done, then start the quoted function, in this case, the new function, or word, named lotsnice.

  To print out the text in B9FONT, which we made {actually earlier on, when the main language form was called Firth234 then Lisa GJ2 FIC3, the ‘fic3′ still being the name of the language place, norskesites.org/fic3 with a mirror-site in one of the other sites in our Yoga6dorg search engine set of sites, run in the same language, which in this case is moscowsites.org/fic3), you can use the two-letter (predefined) function B9 instead of the function PP. Of course, there are more such functions to place the characters freely on the screen. And in each case, you have the source of these functions, written in the G15 native assembly-like language, and which it is natural to get to know a bit about as you progress in G15 PMN programming, for it vastly extends what you can do with PMN so that you can do anything which is within the scope of just that type of Personal Computer, the G15 PC, as we have imagined it and realized it.

Note that the ‘zz’ command is typically the very last line in any program that we compile and run, and that is isn’t something used within a program. In other words, when we make a new word, a new function, a new program, by doing something like abcdefgh= then some lines then a dot (.), that’s fine, but the ‘zz’ won’t be found between the = and the dot. Rather, the zz stands on a line all by itself, and no dot comes after it.

When you have gone through this little example you have seen a great deal of all the main features of the language: and yet there is no end to how many books we can write about programming in it. But that concerns higher structures, techniques, approaches, methods, and getting used to using the libraries of ready-made functions, and such. Fundamentally, it always looks more or less like this type of stuff, though there are a few more features, such as how to handle long-quotes (quotes over several lines) and comments and such, that can be said to be part of the ‘syntax’ of the language.

Note that the command

^i1
cc

is enough to start the program when you include a ‘zz’. If you leave out the zz, you can start it manually by typing in the name of the program. When you have a large program, with many functions or programs {or sub-programs} within it, and you want to check how a certain part of it works without starting the main part yet, you can leave out the zz on purpose; and perhaps put it in when the program is all polished and wonderful and ready to be published to the world, perhaps as a G15 app.