Some people have asked me to translate the help... I have no time to translate the help in the software (this is even not uptodate in french , the current one was for the first version...) but I chose to translate this quick introduction... I am sorry for my poor english and the clumsy translation (sorry I do not "translate" the figures).
This document is a quick presentation ofWinscm through a working session example. It is the text given to our students when they discover this programming environment. It is not an exhaustive user's guide which presents all the possibilities of the software, some are even not raised (projects for example). However, the following should be enough for discovering Winscm even for absolute beginners.
This text constitutes as well a part of the annex of the book "Débuter la programmation avec Scheme"published by ITP France.
With the explorer, select the directory containing the Winscm software and double-click on the icon titled Winscm. An advertising window appears. A brief moment later, the interpreter window opens then the Winscm window too.
The Winscm window have some components you can find in most of MS-Windows applications (FIG 1): a title bar, a system menu, maximize and minimize buttons, tool bar (buttons with most current actions), scrollbars (to scroll text when it is longer than the size of the window)...

A contextual menu can be open by right-clicking the mouse. This menu depends on the window where was the cursor at clicking.
To activate a menu, you have two solutions:
You can get help (sorry in french...) either through Help menu, or by clicking the button with a question mark, or by pressinf the F1 key (in this case you have a contextual help: it depends on the current situation when you press the key).
In this window, and only in this one, you can evaluate expressions: it is the window of the language, other windows are only for edition.
The interpreter took place in the Winscm window. You can display it in full screen by pressing simultaneously the Alt and Enter keys (when this window is active). You go back in the same way.
This example will illustrate, among other things, the links between the edit area and the interpreter area. We will discover too the main fonctionnalities of the software. You may have more information by reading the help (in french).
In this session, we will work with a still begun program. Therefore we first have to open the file containing this program. This can be done by activating the command Open of the File menu, or by clicking on the button with an open folder on it, or else by activating the contextual menu of the variables area and chosing open.
Then a window opens, which asks you to chose your file (FIG 2). The one we are interested in is in the c:\winscm95\travail directory. Its name is exemple1.scm.

Then, you have to select the right directory in the directory area, then to double-click on the program name in the program names area. Then the file opens. You can see the list of defined objects which appears in the variables area.
By clicking on one of the name (we should say identifier), the text (or code) that defines it appears in the edit area.
Let us click on the identifier cub (FIG 3). Its definition appears in different colors and lines are indented with a convention that will be explained later. The code for color is the following:
To define a new variable, you can use two ways:

The edit window becomes empty; you can now enter the code of the new variable to define. Enter the next code (even if you do not understand it at now - but it should not look so strange...) which defines the new variable carre+1:
Maybe have you noticed that when you type a closing round bracket, the corresponding opening one flashed (this may be too fast on some PC). Moreover, at the left of the status bar (bottom of main window) appears the beginning of the expression you have finished with this closing brackets. This proves to be necessary when you have imbricated expressions. You will quickly be convinced.
You probably have noticed too that indentation is automatically performed; its goal is to improve the readibility of programs. You will soon be aware that this is a great help when you have quite long definitions. The indent convention is the following: the sub-expressions of an expression are lined the one under the others (but you have to insert a end of line - Enter key - between each).
There are two different steps. To distinguish them, we will name the first one by ``store'' and the second by ``save''.
First, we have to do such that the variable will be effectively defined in the file. Store is performed atomatically if the Enter key is pressed after the last bracket of the definition. Anoter solution is to right-click in the edit area and to chose the Store command. A heading appears when the variable is stored if the Heading option of the contextual menu of variables area is activated. It is to facilitate the writing of comments.
If an error is detected (not every synatx error is) during storage, a warning appears. You can still store the text, the name of the variable appears then in red. It could be corrected later.
To save the file, you have to use either Save or Save under of File menu, or click on the the button with a disk on it. The Save under command allows you to change the file name (FIG 5).

For example, you can save the current file under the new name (monfichier.scm par exemple). Let us note that the extension ``.scm'' is added by default. The edit window took the name of the file.
It is important to be aware that at now, since no interaction between edition and the interpreter has occured, objects defined in the file we have opened are not known by scheme. To convince you, it suffices to try to evaluate the expression (carre+1 2): an error occurs. This told you that the identifier carre is unknown. Indeed, every variable must be defined in the interperter if you want to evaluate (and then to use) it.
If you want the variable carre+1 to be known by scheme, you must make scheme evaluate its definition. A way is to select the variable in the variables area, then to activate the contextual menu in the edit area (remember, it is by right-clicking) and then to chose the Evaluate(FIG 6) command. Another way is to click on the button with the balloon. This evaluation is automatically performed when storing if the Auto option of the contextual menu of variables area is activated.

In each case, we notce that something happens in the interpreter window. Indeed, the code of the definition of carre+1 has been transmitted to scheme. This is similar as if the definition (define carre+1 (lambda ... )) had been written in the interpreter window. Then Scheme has evaluated and thus know this identifier, we will check that.
Let us try to evaluate the expression (carre+1 1) again... Another error occurs~! But this time, this is the carre variable which is unknown. This is indeed used in the definition of carre+1. But, the carre must have been defined -in Scheme- before any use of its identifier. Therefore we have to evaluate the definition of carre too, this can be done in the same way as for carre+1.
Once it is done, the evaluation of (carre+1 1) is at last possible without error and the result is returned.
Now if we want to use the variable cube, we should have to redo the same with this variable and so on for each one. This could quickly become tedious. Happily, there is another solution. It consists in to activate the contextual menu of the variables area (FIG 7) and to chose the Evaluate all (as well available in the Functions menu). In this cas, all the variables defined in the file (i.e. whose names appear in the variables area) are evaluated. Therefore they can all be used.

It is of course possible to write expressions which are not definitions. These expressions appear in the variables area under the names !divers_1, !divers_2, etc. in chronological order of writing. (FIG 8).

To evaluate a !divers_1 expression, you have to select the expression in the edit window (by highlighting it) and then to chose evaluate in the contextual menu.
It is possible to delete an expression by selecting its name and chosing Delet in the contextual menu of the variables area.
It happens sometimes that you need a variable you have alreaduy defined in an other file. For example, let us imagine you need the deuxX2+1 variable defined in the file C:\winscm95\travail\exemple2.scm. To rewrite it is a loss of time... To avoid that, it suffices to activate the Insert variable command of the File menu. Then, you just have to chose the file which contains the variables to reuse (for our example it is exemple2.scm), then in the list of variables that appears, you just have to click (once) on each variable, then to open the contextual menu of this window and chose Select. It is as well possible to insert a whole file with the Insert command of File menu (FIG 9).
![]() |
![]() |
Imported variables appears now in the variables area of exemple1.scm. You now have to evaluate them in order to use them.
Let us note that it is possible to import a variable directly from another open browser simply by "drag and drop" of its identifier: click (and let the button down) on the name of the variable in the source variables area and move the mouse pointer (still with button down) until the target variables area then release the button.
In "text mode", you have to use "cut/paste". In ``browser mode'', you have to select the variable to move, activate contextual menu, chose Move. Then, select the variable before ou after which one you want to move and chose Move Before or Move After (FIG 10). Else, you can chose Cancel Move.
![]() |
![]() |
![]() |
To leave an edit window, it suffices to double-click on its close button. Try it. Do you have thought to save it? Happily, if not, a message warned you! In a general way it is a good habit to regularly save your work: an unwilling crash of the computer may happen...
To save on a floppy disk, you must select the Save under command of File menu. And then in the drive area, chose the floppy drive (often its name is A: or B:). And last, give a name to the file in the file name area.
If for some reason, a problem occurs with the interpreter an its window is destroyed or becomes unmanageable, it is possible to restart it by chosing the command File - Reinit Scheme. You will then eventully have the choice between several interpreters, chose one by double clicking on it. (FIG 11).


Notes :
There is a small problem with the version under Windows 95 when you close the application : you have to click OK when a message appears. This has no consequence but we cannot solve the trouble. [back]
To select a piece of text, you must put the cursor at the beginning of the piece, then by holding the left button down, move the cursor until the end of the piece of text and then let the button up (the text is highlighted).[back]
scheme@lifl.fr:
pour plus d'informations.